English
Language : 

C8051F970-A-GM Datasheet, PDF (131/454 Pages) Silicon Laboratories – Low Power Capacitive Sensing MCU with up to 32 kB of Flash
C8051F97x
18.1. Configuring Port Pins as Capacitive Sense Inputs
In order for a port pin to be measured by CS0, that port pin must be configured as an analog input (see “26. Port I/
O (Port 0, Port 1, Port 2, Port 3, Port 4, Port 5, Port 6, Crossbar, and Port Match)” ). Configuring the input
multiplexer to a port pin not configured as an analog input will cause the capacitive sense comparator to output
incorrect measurements.
18.2. Initializing the Capacitive Sensing Peripheral
The following procedure is recommended for properly initializing the CS0 peripheral:
1. Enable the CS0 block (CS0INT = 1) before performing any other initializations.
2. Initialize the Start of Conversion Mode Select bits (CS0CM[2:0]) to the desired mode.
3. Continue initializing all remaining CS0 registers.
18.3. Capacitive Sense Start-Of-Conversion Sources
A capacitive sense conversion can be initiated in one of seven ways, depending on the programmed state of the
CS0 start of conversion bits (CS0CF6:4). Conversions may be initiated by one of the following:
1. Writing a 1 to the CS0BUSY bit of register CS0CN
2. Timer 0 overflow
3. Timer 2 overflow
4. Timer 1 overflow
5. Timer 3 overflow
6. Convert continuously
7. Convert continuously with auto-scan enabled
Conversions can be configured to be initiated continuously through one of two methods. CS0 can be configured to
convert at a single channel continuously or it can be configured to convert continuously with auto-scan enabled.
When configured to convert continuously, conversions will begin after the CS0BUSY bit in CS0CF has been set. An
interrupt will be generated if CS0 conversion complete interrupts are enabled by setting the ECSCPT bit (EIE2.0).
The CS0 module uses a method of successive approximation to determine the value of an external capacitance.
The number of bits the CS0 module converts is adjustable using the CS0CR bits in register CS0MD2. Conversions
are 13 bits long by default, but they can be adjusted to 12, 13, 14, or 16 bits depending on the needs of the
application. Unconverted bits will be set to 0. Shorter conversion lengths produce faster conversion rates, and vice-
versa. Applications can take advantage of faster conversion rates when the unconverted bits fall below the noise
floor.
Note: CS0 conversion complete interrupt behavior depends on the settings of the CS0 accumulator. If CS0 is configured to
accumulate multiple conversions on an input channel, a CS0 conversion complete interrupt will be generated only after
the last conversion completes.
Rev 1.0
131