AP08113
Capacitive-Touch Color Wheel Implementation
Implementation of Color Wheel with XC822T
Application Note
17
V1.0, 2010-08
6
Implementation of Color Wheel with XC822T
There are several on-chip modules used in the Color Wheel Application Kit. The configuration and usage of these
modules are described in this chapter.
6.1
Real-Time Clock (RTC) Module
Real-Time Clock is configured for 1 second and is used for wake-up in the Power saving control module.
6.2
Power Saving Control Module
The power saving mode saves on the power consumption when the board is not used. Power Down Mode is
entered when the centre button is pressed for a long period. The configurations are:
•
Power Down Mode 2
•
Power down with RTC running
•
Wake-up without reset
SFR LTS_TSVAL value is saved before entering Power Down Mode. At wake-up (every 1 second, by the RTC
module), the software waits for the Time Frame flag (indicates touch-sensing on one pad completed) before
comparing the current SFR LTS_TSVAL with the saved_value (i.e. saved value of LTS_TSVAL - user-defined
TSVAL_SUBTRACTION).
If the latest SFR LTS_TSVAL value is more than the saved_value, it means that the centre button is not pressed.
The Power Down Mode is therefore re-entered and the latest SFR LTS_TSVAL value is re-saved. The cycle then
repeats. If the SFR LTS_TSVAL value is less than or equal to the saved_value, it means that the centre button is
being pressed, therefore Power Down Mode is exited and the Color Wheel board will turn on (‘On/Off’ LED light
turns on). With above mentioned protocol, timing to enter Power Down Mode is consistent, while timing to exit
Power Down Mode varies, depending on when the user touches the centre button.
6.3
CCU6 Module
CCU6 is used to control the color, saturation and brightness level at RGB LED (D2). RGB LED utilizes COUT60
(P1.0), COUT61 (P1.2) and COUT62 (P0.5) for PWM control.
6.4
Interrupt System Module
External interrupt 0 (P2.0) (low level triggered) is enabled. This emulates a Reset pin. If a negative edge is
detected at P2.0, soft reset will be activated. It is triggered by XC800_FLOAD tool to enter UART BSL Mode at
next boot-up.
Time Slice and Time Frame interrupts are also enabled to set up the configurations for LEDTSCU.
6.5
UART Module
UART module is enabled for debugging to transmit and receive data via P0.6 (TXD/RXD).
6.6
LED and Touch-Sense Controller Unit Module
LEDTSCU module is used for touch-sensing and driving the LEDs. The configuration is:
•
4 Touch-Sense inputs (P0.0, P0.1, P0.2 and P0.3)
•
1 LED column (P0.4)
•
4 LED line pins (P0.0, P0.1, P0.2 and P0.3)
All manuals and user guides at all-guides.com