English
Language : 

C8051F980-C-GM Datasheet, PDF (101/325 Pages) Silicon Laboratories – Ultra Low Power, 8-2 kB Flash, Capacitive Sensing MCU
C8051F99x-C8051F98x
8.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 “21.
Port Input/Output” ). Configuring the input multiplexer to a port pin not configured as an analog input will
cause the capacitive sense comparator to output incorrect measurements.
8.2. Initializing the Capacitive Sensing Peripheral
The following procedure is recommended for properly initializing the CS0 peripheral:
1. Enable the CS0 block (CS0EN = 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.
8.3. Capacitive Sense Start-Of-Conversion Sources
A capacitive sense conversion can be initiated in one of eight 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
8. Perform a single scan of all enabled channels
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).
Single Scan Mode allows all channels enabled in the CS0SCAN0 and CS0SCAN1 registers to be scanned
in a single pass. An end of scan interrupt can be enabled to trigger once all selected channels have been
converted. See Section “8.9. Automatic Scanning (Method 2—CS0SMEN = 1)” on page 104 for more
details about this mode.
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.2
101