SlideShare a Scribd company logo
1 of 6
WHITE PAPER


Cypress’ CapSense Successive Approximation Algorithm
By Robert Jania, Cypress Semiconductor Global Marketing Manager (RJO)

Executive Summary
Successive Approximation algorithm (CSA) is Cypress’s new capacitive sensing algorithm for the CY8C20x34 PSoC® device
family. CSA enables the implementation of an array of capacitive sensors through switched capacitor circuitry, an analog
multiplexer and digital counting functions. The hardware configuration works in conjunction with high-level software routines
from the CSA User Module found in PSoC Designer™ to compensate for environmental and physical sensor variations.

What is Capacitive Sensing?
A capacitive sensor is a pair of adjacent electrodes (Figure 1). When a conductive object is placed in proximity of the two
electrodes, the capacitance is changed. The base capacitance is often referred to as the parasitic capacitance (CP). The
physical sensor itself is typically a copper trace constructed on a PCB. Sensors can be any conductive material. For example,
one could use indium tin oxide (ITO) and print the pattern on a transparent substrate.


Figure 1. Capacitive Sensor




What is Successive Approximation?
The successive approximation method, developed by Cypress, uses the PSoC’s switched capacitor circuitry to convert
capacitance into a voltage. The voltage is then measured using a counter and a single-slope ADC. The capacitance
measurement is achieved by converting the capacitance to its equivalent resistance, using the equivalent resistance to set and
maintain voltage on a capacitor, then measuring the sampled voltage using an adjustable current source.

In addition to the sensor capacitor, CSA uses an internal capacitor (CInternal) and an optional external modification capacitor
(CMod). The block diagram for CSA appears in Figure 2.
Figure 2. CSA Block Diagram
                        V DD




                                            LPF
                                                  VREF                 EN 16-bit      Data
                   Ø1
                                                                          Timer    Processing

 CX       Ø2       CMod         CInternal

                                                          Oscillator




The circuitry brings the sensor capacitor to a voltage relative to the capacitance of the sensor. The PSoC’s internal main
oscillator (IMO) clocks the switched capacitor.

To fully understand how CSA functions, it is useful to look at the actual waveforms of CSA. Figure 3 below shows the CSA
waveform seen by probing CMod in a project with a single sensor and no finger present. Three regions can be seen in the CSA
waveform. Table 1 describes the regions that can be seen in Figure 3. Each region is described in more detail in the following
sections.

Figure 3. CSA Waveform Seen at CMod with no Finger Present




Table 1. CSA Waveform Regions

 Region                        Description
 1                             The sensor capacitor (CX) is connected on and off
                               of the bus until voltage on the bus settles to VStart.
 2                             The bus is charged by the iDAC until the voltage
                               exceeds VREF and the comparator trips.
 3                             The sensor scan is complete and the iDAC is
                               turned off. Voltage on the bus decreases as charge
                               is dissipated by the low pass filter (LPF) until the
                               next scan begins. The amount of time that this
                               voltage decreases is strictly dependant upon the
                               firmware between each scan and the CPU clock
                               speed.

January 17, 2007                                              White Paper CSA RJO.doc                              Page 2 of 6
Region 1
In Region 1 of the CSA waveform the sensor capacitor (CX) is connected to the analog global bus, then grounded, in
alternating phases. During phase 1 (φ1), CX is connected in the analog global bus in parallel with CMod and CInternal. The block
diagram of phase 1 is shown in Figure 4. CInternal and CMod share charge with CX. Charge continues to flow onto CMod and
CInternal from the iDAC current source.

Figure 4. CSA Block Diagram of Phase 1
                        V DD




                                            LPF
                                                   VREF                EN 16-bit      Data
                   Ø1
                                                                          Timer    Processing

 CX        Ø2      CMod        CInternal

                                                          Oscillator




Phase 2 (φ2) disconnects CX from the analog global bus and discharges CX by connecting it to ground, leaving only CMod and
CInternal connected. This is shown in Figure 5.

Figure 5. CSA Block Diagram of Phase 2




                                            LPF
                                                                       EN 16-bit
                                                   VREF                               Data
                   Ø1
                                                                          Timer    Processing
 CX        Ø2      CMod        CInternal

                                                          Oscillator




CX is an effective resistance to ground through phases 1 and 2. An equivalent block diagram is shown in Figure 6. The
equivalent resistance is given by:

                   1
R Equivalent =                        Equation 1
                 fS CX
      •    fS is the switching frequency of phases 1 and 2
      •    CX is the sensor capacitance

The constant iDAC current flows through this resistance resulting in a voltage, VStart. VStart is given by:
             1
VStart =         I DAC                Equation 2
           fS CX
      •    iDAC is the iDAC current




January 17, 2007                                             White Paper CSA RJO.doc                                 Page 3 of 6
Figure 6. CSA Block Diagram with Equivalent Resistor
                           VDD




                                             LPF
                                                                        EN 16-bit             Data
                                                    VREF
                                                                           Timer           Processing
 REquivalent           CMod      CInternal

                                                           Oscillator




VStart is set to a value below VREF with the switched capacitor circuit running. This is accomplished by tuning the iDAC through
successive approximation, which uses a binary search to determine the appropriate iDAC setting. Once the bus has been
charged to VStart, the iDAC current setting that was used is stored, and the process is repeated for each sensor in the project.


Region 2
After the voltage on CMod and CInternal settle to VStart, the measurement sequence begins. A counter clocked by the IMO is
enabled. As the counter runs, the iDAC charges CMod and CInternal until the voltage on the capacitors reaches VREF. At VREF, the
comparator disables the counter. The number of IMO clock cycles (referred to as counts) recorded by the counter is used to
determine if a finger is present on a sensor. Counts are taken after each measurement sequence and compared to the
baseline count number, a stored value with no finger present on the sensor. If the difference between the recorded counts and
the baseline counts exceeds the finger threshold value, sensor activation is detected.

The presence of a finger on the sensor increases the capacitance (CX) of the sensor, which decreases the equivalent
resistance (REquivalent) formed by the switching of φ1 and φ2. This is evident in Equation 1. The lower resistance results in a
lower voltage across the capacitors (CMod and CInternal), which we will call VFinger. Thus, it will take longer for the iDAC to charge
the voltage on the bus from VFinger to VREF than it does from VStart to VREF. This results in more counts (i.e. object present) on
the sensor. A graphical representation of the charge time on the bus with a finger present versus not present is shown in
Figure 7. The waveform in Figure 8 shows the CSA waveform with a finger present, and verifies the longer count time by the
counter.

Figure 7. Voltage on Bus with Finger and No Finger Present on Cx



                                                                                    Comparator Threshold
                        VRef
 Voltage




           VStart / No Finger



                    VFinger


                                                   Time
                    Counted
                     IMO


 No Finger Present

 Finger Present




January 17, 2007                                                  White Paper CSA RJO.doc                                  Page 4 of 6
Figure 8. CSA Waveform Seen at Cmod with Finger Present




In Figure 8, the starting voltage in region 1 has dropped. This is due to the decrease in equivalent resistance, which itself is a
result of the finger capacitance (CF) added in parallel with the sensor capacitance (CX). The charge time in region 2 is longer,
resulting in more counts on the counter compared to no finger present on the sensor. An increase in charge time can be seen
by comparing Figure 3 and Figure 8.


Region 3
In region 3 of the waveform the scan is complete and the iDAC is turned off. The voltage on the bus begins to drop due to
charge dissipation by the Low Pass Filter (LPF) on the capacitor’s input. The LPF is present to prevent the input of high
frequency noise to the comparator. This voltage continues to decrease until the next scan sequence when the voltage is reset
to VStart. The amount of time that the voltage spends decreasing depends upon the firmware executed between each scan and
the CPU clock frequency. A faster CPU clock frequency results in a smaller decrease in the voltage on the bus in region 3.

Noise Immunity
CSA offers high noise immunity, resulting in excellent sensitivity. Sensitivity is proportional to signal-to-noise ratio (SNR)
levels. The switching of the sensor capacitor in CSA reduces the outside noise sources on the sensor capacitor that could
inadvertently couple directly into the system. During phase 2, any noise introduced through the sensor capacitor is shorted
directly to ground. In addition, the grounding of the sensor capacitor reduces the input impedance of the CSA system. The
lower input impedance results in smaller voltages entering the CSA system as a result of any noise current.

The input of the comparator for CSA includes an internal LPF to reduce the effect of high frequency noise on sensor scans.
External to the PSoC, an optional bus modification capacitor (CMod) further improves noise performance by acting as a bypass
capacitor. The bypass capacitor prevents erroneous device interrupts by eliminating large voltage swings on the device inputs.


Summary
The PSoC Mixed-Signal Array is a configurable array of digital and analog resources, Flash memory, RAM, an 8-bit
microcontroller and several other features. These features allow PSoC to implement innovative capacitive sensing techniques
in its CapSense portfolio. PSoC’s intuitive development environment can be used to configure and reconfigure the device to
meet design specifications and specification changes. Successive Approximation exhibits exceptional sensitivity and noise
immunity, low power consumption and a fast update rate, along with the flexible design process inherent to the PSoC.

For more information on PSoC, go to www.cypress.com. For more information on PSoC CapSense, visit
www.cypress.com/capsense. For a more detailed explanation of the use of switched capacitors in the CSA algorithm, please
see the CSA User Module Data Sheet inside PSoC Designer™ free at www.cypress.com/psocdesigner. For a comprehensive
derivation of switched capacitor equations, see AN2041, “Understanding Switched Capacitor Analog Blocks” at
www.cypress.com/design/AN2041, or reference Design With Operational Amplifiers and Analog Integrated Circuits, by Sergio
Franco.




January 17, 2007                                    White Paper CSA RJO.doc                                            Page 5 of 6
Cypress Semiconductor
                                                                                                                                              198 Champion Court
                                                                                                                                         San Jose, CA 95134-1709
                                                                                                                                             Phone: 408-943-2600
                                                                                                                                                 Fax: 408-943-4730
                                                                                                                                           http://www.cypress.com

© Cypress Semiconductor Corporation, 2007. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes
no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other
rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an
express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a
malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application
implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.




January 17, 2007                                                    White Paper CSA RJO.doc                                                                Page 6 of 6

More Related Content

What's hot

Regions of operation of bjt and mosfet
Regions of operation of bjt and mosfetRegions of operation of bjt and mosfet
Regions of operation of bjt and mosfetMahoneyKadir
 
B.e. vi semester-power electronics lab
B.e. vi semester-power electronics  labB.e. vi semester-power electronics  lab
B.e. vi semester-power electronics labbalaji1986
 
5 band graphic equaliser
5 band graphic equaliser5 band graphic equaliser
5 band graphic equaliserviv3ksharma
 
BJT Biasing for B.Tech Ist Year Engineering
BJT Biasing for B.Tech Ist Year EngineeringBJT Biasing for B.Tech Ist Year Engineering
BJT Biasing for B.Tech Ist Year EngineeringRaghav Bansal
 
Common Emitter circuit
Common Emitter circuitCommon Emitter circuit
Common Emitter circuitMahoneyKadir
 
IC Design of Power Management Circuits (I)
IC Design of Power Management Circuits (I)IC Design of Power Management Circuits (I)
IC Design of Power Management Circuits (I)Claudia Sin
 
Rec101 unit ii (part 2) bjt biasing and re model
Rec101 unit ii (part 2) bjt biasing and re modelRec101 unit ii (part 2) bjt biasing and re model
Rec101 unit ii (part 2) bjt biasing and re modelDr Naim R Kidwai
 
dc biasing of bjt
dc biasing of bjtdc biasing of bjt
dc biasing of bjtabhinavmj
 
U N I T I I Baseband Demod V S H
U N I T I I  Baseband Demod  V S HU N I T I I  Baseband Demod  V S H
U N I T I I Baseband Demod V S HPrathmesh Ghodke
 
Ac analysis of bjt and mosfet inverting amplifiers
Ac analysis of bjt and mosfet inverting amplifiersAc analysis of bjt and mosfet inverting amplifiers
Ac analysis of bjt and mosfet inverting amplifiersMahoneyKadir
 
Electronics 1 : Chapter # 05 : DC Biasing BJT
Electronics 1 : Chapter # 05 : DC Biasing BJTElectronics 1 : Chapter # 05 : DC Biasing BJT
Electronics 1 : Chapter # 05 : DC Biasing BJTSk_Group
 
Lect2 up350 (100328)
Lect2 up350 (100328)Lect2 up350 (100328)
Lect2 up350 (100328)aicdesign
 
Communicationlabmanual
CommunicationlabmanualCommunicationlabmanual
Communicationlabmanualjkanth26
 

What's hot (20)

Regions of operation of bjt and mosfet
Regions of operation of bjt and mosfetRegions of operation of bjt and mosfet
Regions of operation of bjt and mosfet
 
B.e. vi semester-power electronics lab
B.e. vi semester-power electronics  labB.e. vi semester-power electronics  lab
B.e. vi semester-power electronics lab
 
5 band graphic equaliser
5 band graphic equaliser5 band graphic equaliser
5 band graphic equaliser
 
Hw4
Hw4Hw4
Hw4
 
Fet basics-1
Fet basics-1Fet basics-1
Fet basics-1
 
FinalReport
FinalReportFinalReport
FinalReport
 
BJT Biasing for B.Tech Ist Year Engineering
BJT Biasing for B.Tech Ist Year EngineeringBJT Biasing for B.Tech Ist Year Engineering
BJT Biasing for B.Tech Ist Year Engineering
 
Common Emitter circuit
Common Emitter circuitCommon Emitter circuit
Common Emitter circuit
 
IC Design of Power Management Circuits (I)
IC Design of Power Management Circuits (I)IC Design of Power Management Circuits (I)
IC Design of Power Management Circuits (I)
 
Rec101 unit ii (part 2) bjt biasing and re model
Rec101 unit ii (part 2) bjt biasing and re modelRec101 unit ii (part 2) bjt biasing and re model
Rec101 unit ii (part 2) bjt biasing and re model
 
dc biasing of bjt
dc biasing of bjtdc biasing of bjt
dc biasing of bjt
 
U N I T I I Baseband Demod V S H
U N I T I I  Baseband Demod  V S HU N I T I I  Baseband Demod  V S H
U N I T I I Baseband Demod V S H
 
Ac analysis of bjt and mosfet inverting amplifiers
Ac analysis of bjt and mosfet inverting amplifiersAc analysis of bjt and mosfet inverting amplifiers
Ac analysis of bjt and mosfet inverting amplifiers
 
Electronics 1 : Chapter # 05 : DC Biasing BJT
Electronics 1 : Chapter # 05 : DC Biasing BJTElectronics 1 : Chapter # 05 : DC Biasing BJT
Electronics 1 : Chapter # 05 : DC Biasing BJT
 
Lect2 up350 (100328)
Lect2 up350 (100328)Lect2 up350 (100328)
Lect2 up350 (100328)
 
finalreport
finalreportfinalreport
finalreport
 
Koding
KodingKoding
Koding
 
Communicationlabmanual
CommunicationlabmanualCommunicationlabmanual
Communicationlabmanual
 
Line coding
Line coding Line coding
Line coding
 
Gain parameters of BJT
Gain parameters of BJTGain parameters of BJT
Gain parameters of BJT
 

Similar to CapSense Capacitive Sensing Successive Approximation Algorithm

ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING  ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING csijjournal
 
Analog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose MonitoringAnalog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose Monitoringcsijjournal
 
An approach to design Flash Analog to Digital Converter for High Speed and Lo...
An approach to design Flash Analog to Digital Converter for High Speed and Lo...An approach to design Flash Analog to Digital Converter for High Speed and Lo...
An approach to design Flash Analog to Digital Converter for High Speed and Lo...VLSICS Design
 
Design of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADC
Design of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADCDesign of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADC
Design of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADCAman JanGra
 
Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9kehali Haileselassie
 
Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9kehali Haileselassie
 
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50Ruthvik Vaila
 
analog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptanalog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptdaredevil15082004
 
Design of an ADC using High Precision Comparator with Time Domain Offset Canc...
Design of an ADC using High Precision Comparator with Time Domain Offset Canc...Design of an ADC using High Precision Comparator with Time Domain Offset Canc...
Design of an ADC using High Precision Comparator with Time Domain Offset Canc...IJTET Journal
 
power grid synchronization failure detection
power grid synchronization failure detectionpower grid synchronization failure detection
power grid synchronization failure detectionJay Hind
 
Cathode Ray Oscilloscope
Cathode Ray OscilloscopeCathode Ray Oscilloscope
Cathode Ray Oscilloscoperajainayat
 
Design of oscillators using cmos ota
Design of oscillators using cmos otaDesign of oscillators using cmos ota
Design of oscillators using cmos otaIISRT
 
Design of oscillators using cmos ota
Design of oscillators using cmos otaDesign of oscillators using cmos ota
Design of oscillators using cmos otaRamesh Patriotic
 
Iisrt 5-design of oscillators using cmos ota
Iisrt 5-design of oscillators using cmos otaIisrt 5-design of oscillators using cmos ota
Iisrt 5-design of oscillators using cmos otaIISRTJournals
 
A NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTER
A NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTERA NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTER
A NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTERVLSICS Design
 
Design & implementation of 3 bit flash adc in 0.18µm cmos
Design & implementation of 3 bit flash adc in 0.18µm cmosDesign & implementation of 3 bit flash adc in 0.18µm cmos
Design & implementation of 3 bit flash adc in 0.18µm cmosIAEME Publication
 

Similar to CapSense Capacitive Sensing Successive Approximation Algorithm (20)

ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING  ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING
 
Analog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose MonitoringAnalog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose Monitoring
 
An approach to design Flash Analog to Digital Converter for High Speed and Lo...
An approach to design Flash Analog to Digital Converter for High Speed and Lo...An approach to design Flash Analog to Digital Converter for High Speed and Lo...
An approach to design Flash Analog to Digital Converter for High Speed and Lo...
 
3BITFLASHADC
3BITFLASHADC3BITFLASHADC
3BITFLASHADC
 
Design of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADC
Design of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADCDesign of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADC
Design of Low Power High Speed 4-Bit TIQ Based CMOS Flash ADC
 
Mast content
Mast contentMast content
Mast content
 
Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9
 
Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9Bipolar junction transistor characterstics biassing and amplification, lab 9
Bipolar junction transistor characterstics biassing and amplification, lab 9
 
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
 
analog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptanalog to digital adn digital to analog .ppt
analog to digital adn digital to analog .ppt
 
ARRHYTHMIA.pptx
ARRHYTHMIA.pptxARRHYTHMIA.pptx
ARRHYTHMIA.pptx
 
Design of an ADC using High Precision Comparator with Time Domain Offset Canc...
Design of an ADC using High Precision Comparator with Time Domain Offset Canc...Design of an ADC using High Precision Comparator with Time Domain Offset Canc...
Design of an ADC using High Precision Comparator with Time Domain Offset Canc...
 
Ece
EceEce
Ece
 
power grid synchronization failure detection
power grid synchronization failure detectionpower grid synchronization failure detection
power grid synchronization failure detection
 
Cathode Ray Oscilloscope
Cathode Ray OscilloscopeCathode Ray Oscilloscope
Cathode Ray Oscilloscope
 
Design of oscillators using cmos ota
Design of oscillators using cmos otaDesign of oscillators using cmos ota
Design of oscillators using cmos ota
 
Design of oscillators using cmos ota
Design of oscillators using cmos otaDesign of oscillators using cmos ota
Design of oscillators using cmos ota
 
Iisrt 5-design of oscillators using cmos ota
Iisrt 5-design of oscillators using cmos otaIisrt 5-design of oscillators using cmos ota
Iisrt 5-design of oscillators using cmos ota
 
A NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTER
A NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTERA NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTER
A NEW APPROACH TO DESIGN LOW POWER CMOS FLASH A/D CONVERTER
 
Design & implementation of 3 bit flash adc in 0.18µm cmos
Design & implementation of 3 bit flash adc in 0.18µm cmosDesign & implementation of 3 bit flash adc in 0.18µm cmos
Design & implementation of 3 bit flash adc in 0.18µm cmos
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

CapSense Capacitive Sensing Successive Approximation Algorithm

  • 1. WHITE PAPER Cypress’ CapSense Successive Approximation Algorithm By Robert Jania, Cypress Semiconductor Global Marketing Manager (RJO) Executive Summary Successive Approximation algorithm (CSA) is Cypress’s new capacitive sensing algorithm for the CY8C20x34 PSoC® device family. CSA enables the implementation of an array of capacitive sensors through switched capacitor circuitry, an analog multiplexer and digital counting functions. The hardware configuration works in conjunction with high-level software routines from the CSA User Module found in PSoC Designer™ to compensate for environmental and physical sensor variations. What is Capacitive Sensing? A capacitive sensor is a pair of adjacent electrodes (Figure 1). When a conductive object is placed in proximity of the two electrodes, the capacitance is changed. The base capacitance is often referred to as the parasitic capacitance (CP). The physical sensor itself is typically a copper trace constructed on a PCB. Sensors can be any conductive material. For example, one could use indium tin oxide (ITO) and print the pattern on a transparent substrate. Figure 1. Capacitive Sensor What is Successive Approximation? The successive approximation method, developed by Cypress, uses the PSoC’s switched capacitor circuitry to convert capacitance into a voltage. The voltage is then measured using a counter and a single-slope ADC. The capacitance measurement is achieved by converting the capacitance to its equivalent resistance, using the equivalent resistance to set and maintain voltage on a capacitor, then measuring the sampled voltage using an adjustable current source. In addition to the sensor capacitor, CSA uses an internal capacitor (CInternal) and an optional external modification capacitor (CMod). The block diagram for CSA appears in Figure 2.
  • 2. Figure 2. CSA Block Diagram V DD LPF VREF EN 16-bit Data Ø1 Timer Processing CX Ø2 CMod CInternal Oscillator The circuitry brings the sensor capacitor to a voltage relative to the capacitance of the sensor. The PSoC’s internal main oscillator (IMO) clocks the switched capacitor. To fully understand how CSA functions, it is useful to look at the actual waveforms of CSA. Figure 3 below shows the CSA waveform seen by probing CMod in a project with a single sensor and no finger present. Three regions can be seen in the CSA waveform. Table 1 describes the regions that can be seen in Figure 3. Each region is described in more detail in the following sections. Figure 3. CSA Waveform Seen at CMod with no Finger Present Table 1. CSA Waveform Regions Region Description 1 The sensor capacitor (CX) is connected on and off of the bus until voltage on the bus settles to VStart. 2 The bus is charged by the iDAC until the voltage exceeds VREF and the comparator trips. 3 The sensor scan is complete and the iDAC is turned off. Voltage on the bus decreases as charge is dissipated by the low pass filter (LPF) until the next scan begins. The amount of time that this voltage decreases is strictly dependant upon the firmware between each scan and the CPU clock speed. January 17, 2007 White Paper CSA RJO.doc Page 2 of 6
  • 3. Region 1 In Region 1 of the CSA waveform the sensor capacitor (CX) is connected to the analog global bus, then grounded, in alternating phases. During phase 1 (φ1), CX is connected in the analog global bus in parallel with CMod and CInternal. The block diagram of phase 1 is shown in Figure 4. CInternal and CMod share charge with CX. Charge continues to flow onto CMod and CInternal from the iDAC current source. Figure 4. CSA Block Diagram of Phase 1 V DD LPF VREF EN 16-bit Data Ø1 Timer Processing CX Ø2 CMod CInternal Oscillator Phase 2 (φ2) disconnects CX from the analog global bus and discharges CX by connecting it to ground, leaving only CMod and CInternal connected. This is shown in Figure 5. Figure 5. CSA Block Diagram of Phase 2 LPF EN 16-bit VREF Data Ø1 Timer Processing CX Ø2 CMod CInternal Oscillator CX is an effective resistance to ground through phases 1 and 2. An equivalent block diagram is shown in Figure 6. The equivalent resistance is given by: 1 R Equivalent = Equation 1 fS CX • fS is the switching frequency of phases 1 and 2 • CX is the sensor capacitance The constant iDAC current flows through this resistance resulting in a voltage, VStart. VStart is given by: 1 VStart = I DAC Equation 2 fS CX • iDAC is the iDAC current January 17, 2007 White Paper CSA RJO.doc Page 3 of 6
  • 4. Figure 6. CSA Block Diagram with Equivalent Resistor VDD LPF EN 16-bit Data VREF Timer Processing REquivalent CMod CInternal Oscillator VStart is set to a value below VREF with the switched capacitor circuit running. This is accomplished by tuning the iDAC through successive approximation, which uses a binary search to determine the appropriate iDAC setting. Once the bus has been charged to VStart, the iDAC current setting that was used is stored, and the process is repeated for each sensor in the project. Region 2 After the voltage on CMod and CInternal settle to VStart, the measurement sequence begins. A counter clocked by the IMO is enabled. As the counter runs, the iDAC charges CMod and CInternal until the voltage on the capacitors reaches VREF. At VREF, the comparator disables the counter. The number of IMO clock cycles (referred to as counts) recorded by the counter is used to determine if a finger is present on a sensor. Counts are taken after each measurement sequence and compared to the baseline count number, a stored value with no finger present on the sensor. If the difference between the recorded counts and the baseline counts exceeds the finger threshold value, sensor activation is detected. The presence of a finger on the sensor increases the capacitance (CX) of the sensor, which decreases the equivalent resistance (REquivalent) formed by the switching of φ1 and φ2. This is evident in Equation 1. The lower resistance results in a lower voltage across the capacitors (CMod and CInternal), which we will call VFinger. Thus, it will take longer for the iDAC to charge the voltage on the bus from VFinger to VREF than it does from VStart to VREF. This results in more counts (i.e. object present) on the sensor. A graphical representation of the charge time on the bus with a finger present versus not present is shown in Figure 7. The waveform in Figure 8 shows the CSA waveform with a finger present, and verifies the longer count time by the counter. Figure 7. Voltage on Bus with Finger and No Finger Present on Cx Comparator Threshold VRef Voltage VStart / No Finger VFinger Time Counted IMO No Finger Present Finger Present January 17, 2007 White Paper CSA RJO.doc Page 4 of 6
  • 5. Figure 8. CSA Waveform Seen at Cmod with Finger Present In Figure 8, the starting voltage in region 1 has dropped. This is due to the decrease in equivalent resistance, which itself is a result of the finger capacitance (CF) added in parallel with the sensor capacitance (CX). The charge time in region 2 is longer, resulting in more counts on the counter compared to no finger present on the sensor. An increase in charge time can be seen by comparing Figure 3 and Figure 8. Region 3 In region 3 of the waveform the scan is complete and the iDAC is turned off. The voltage on the bus begins to drop due to charge dissipation by the Low Pass Filter (LPF) on the capacitor’s input. The LPF is present to prevent the input of high frequency noise to the comparator. This voltage continues to decrease until the next scan sequence when the voltage is reset to VStart. The amount of time that the voltage spends decreasing depends upon the firmware executed between each scan and the CPU clock frequency. A faster CPU clock frequency results in a smaller decrease in the voltage on the bus in region 3. Noise Immunity CSA offers high noise immunity, resulting in excellent sensitivity. Sensitivity is proportional to signal-to-noise ratio (SNR) levels. The switching of the sensor capacitor in CSA reduces the outside noise sources on the sensor capacitor that could inadvertently couple directly into the system. During phase 2, any noise introduced through the sensor capacitor is shorted directly to ground. In addition, the grounding of the sensor capacitor reduces the input impedance of the CSA system. The lower input impedance results in smaller voltages entering the CSA system as a result of any noise current. The input of the comparator for CSA includes an internal LPF to reduce the effect of high frequency noise on sensor scans. External to the PSoC, an optional bus modification capacitor (CMod) further improves noise performance by acting as a bypass capacitor. The bypass capacitor prevents erroneous device interrupts by eliminating large voltage swings on the device inputs. Summary The PSoC Mixed-Signal Array is a configurable array of digital and analog resources, Flash memory, RAM, an 8-bit microcontroller and several other features. These features allow PSoC to implement innovative capacitive sensing techniques in its CapSense portfolio. PSoC’s intuitive development environment can be used to configure and reconfigure the device to meet design specifications and specification changes. Successive Approximation exhibits exceptional sensitivity and noise immunity, low power consumption and a fast update rate, along with the flexible design process inherent to the PSoC. For more information on PSoC, go to www.cypress.com. For more information on PSoC CapSense, visit www.cypress.com/capsense. For a more detailed explanation of the use of switched capacitors in the CSA algorithm, please see the CSA User Module Data Sheet inside PSoC Designer™ free at www.cypress.com/psocdesigner. For a comprehensive derivation of switched capacitor equations, see AN2041, “Understanding Switched Capacitor Analog Blocks” at www.cypress.com/design/AN2041, or reference Design With Operational Amplifiers and Analog Integrated Circuits, by Sergio Franco. January 17, 2007 White Paper CSA RJO.doc Page 5 of 6
  • 6. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone: 408-943-2600 Fax: 408-943-4730 http://www.cypress.com © Cypress Semiconductor Corporation, 2007. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. January 17, 2007 White Paper CSA RJO.doc Page 6 of 6