English
Language : 

C8051F80X_14 Datasheet, PDF (72/251 Pages) Silicon Laboratories – Mixed Signal ISP Flash MCU Family
C8051F80x-83x
13.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 “23.
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.
13.2. 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. Convert continuously
6. Convert continuously with auto-scan enabled
Conversions can be configured to be initiated continuously through one of two methods. CS0 can be con-
figured 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).
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.
13.3. Automatic Scanning
CS0 can be configured to automatically scan a sequence of contiguous CS0 input channels by configuring
and enabling auto-scan. Using auto-scan with the CS0 comparator interrupt enabled allows a system to
detect a change in measured capacitance without requiring any additional dedicated MCU resources.
Auto-scan is enabled by setting the CS0 start-of-conversion bits (CS0CF6:4) to 111b. After enabling auto-
scan, the starting and ending channels should be set to appropriate values in CS0SS and CS0SE, respec-
tively. Writing to CS0SS when auto-scan is enabled will cause the value written to CS0SS to be copied into
CS0MX. After being enabled, writing a 1 to CS0BUSY will start auto-scan conversions. When auto-scan
completes the number of conversions defined in the CS0 accumulator bits (CS0CF1:0) (see “13.5. CS0
Conversion Accumulator” ), auto-scan configures CS0MX to the next highest port pin configured as an
analog input and begins a conversion on that channel. This scan sequence continues until CS0MX
reaches the ending input channel value defined in CS0SE. After one or more conversions have been taken
at this channel, auto-scan configures CS0MX back to the starting input channel. For an example system
configured to use auto-scan, please see Figure “13.2 Auto-Scan Example” on page 73.
Note: Auto-scan attempts one conversion on a CS0MX channel regardless of whether that channel’s port pin has
been configured as an analog input.
If auto-scan is enabled when the device enters suspend mode, auto-scan will remain enabled and running.
This feature allows the device to wake from suspend through CS0 greater-than comparator event on any
configured capacitive sense input included in the auto-scan sequence of inputs.
72
Rev. 1.0