English
Language : 

C8051F99X_10 Datasheet, PDF (101/322 Pages) Silicon Laboratories – Ultra Low Power, 8-2 kB Flash, Capacitive Sensing MCU
C8051F99x-C8051F98x
8.8. Automatic Scanning (Method 1—CS0SMEN = 0)
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,
respectively. 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), auto-
scan configures CS0MX to the next sequential port pin configured as an analog input and begins a
conversion on that channel. All other pins between CS0SS and CS0SE which are set as analog inputs are
grounded during the conversion. 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 “8.2 Auto-Scan Example” on page 101.
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. Auto-scan will also complete the current rotation when the device is halted
for debugging.
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.
SFR Configuration:
CS0CN = 0x80 Enables CS0
CS0CF = 0x70
CS0SS = 0x02
CS0SE = 0x0D
Enables Auto-scan
as start-of-
conversion source
Sets P2.2 as Auto-
scan starting channel
Sets P3.5 as Auto-
scan ending channel
P2MDIN = 0xF2 Configures P2.3,
P2.2, P2.0 as analog
inputs
P3MDIN = 0x04 Configures P3.0-P3.1
and P3.3-P3.7 as
analog inputs
A P2.0 0
D P2.1 1
A P2.2 2
A P2.3 3
D P2.4 4
D P2.5 5
D P2.6 6
D P2.7 7
A P3.0 8
A P3.1 9
D P3.2 10
A P3.3 11
A P3.4 12
A P3.5 13
A P3.6 14
A P3.7 15
...
Figure 8.2. Auto-Scan Example
Scans on channels
not configured as
analog inputs result
in indeterminate
values that cannot
trigger a CS0
Greater Than
Interrupt event
Rev. 1.0
101