CY8CKIT-040 PSoC
®
4000 Pioneer Kit Guide, Doc. # 001-91316 Rev. *F
97
Code Examples
■
Proximity Scanning Mode:
In proximity scanning mode, the device primarily scans the proximity sensor, and the touchpad
sensors are scanned for activity. The previously selected RGB color is turned on with intensity
proportional to the proximity signal strength. The device enters active scanning mode when a
Trackpad element is touched. It stays in proximity scanning mode as long as there is some activ-
ity on the proximity sensor. If the hand moves out of proximity range, the device will return to
sleep-scan mode.
Output Interfaces
■
Optional TX Interface
The firmware also features an optional UART TX interface, which can be enabled or disabled
based on need. To enable or disable the TX interface, uncomment or comment TX_ENABLE
macro present in
main.h
. The firmware also provides an option to select between two types of
packets that are transmitted over the TX line. One packet contains the raw count, baseline, and
signal data of all the sensors in the system in multichart format (refer to
multichart charting tool). Another type of packet sends out just the Trackpad coordinates. To
select between these two types of packets, you can use the MINIMAL_TX macro. If the macro is
commented out, then the first type of packet is transmitted. If the macro is present, then the sec-
ond type of packet is sent.
Note:
To view the MINIMAL_TX data, you can use BCP (as explained in
CapSense Color Palette (Minimal TX) - Commands.iic
and
CapSense Color Pal-
ette (Minimal TX) - Variables.ini
files available under
...\Firmware\PSoC 4\Bridge Files
's Multichart tool can be used to view the first type of packet because of the packet
size.
■
Software PrISM for LED Intensity Control
The firmware uses a software implemented 7-bit PRS for controlling the LED intensity through
Precision Illumination Signal Modulation (PrISM). The implementation uses the SysTick timer
available as part of Cortex-M0 CPU subsystem. The SysTick timer generates the interrupt where
the PRS computations are performed to generate the Pseudo Random signal at the output of the
LED pins. The implementation details can be found in
RGB_PRSm.h
and
RGB_PRSm.c
files
available as part of the project. The polynomial used to generate the PRS is fixed to [7,6,5,2]. The
period or repeat rate of the PRS is 127 counts. With SysTick timer generating an ISR at 20 kHz,
this will result in a ~150 Hz output. Because the output is not a fixed pulse-width signal and is, a
high-frequency signal (with a maximum frequency of 10 kHz and average of around 5 kHz), the
signal easily gets filtered out avoiding any flickers usually noticed with PWM signals at this fre-
quency.
Содержание CY8CKIT-040 PSoC 4000 Pioneer Kit
Страница 20: ...CY8CKIT 040 PSoC 4000 Pioneer Kit Guide Doc 001 91316 Rev F 20 Kit Operation...
Страница 37: ...CY8CKIT 040 PSoC 4000 Pioneer Kit Guide Doc 001 91316 Rev F 37 Hardware...
Страница 73: ...CY8CKIT 040 PSoC 4000 Pioneer Kit Guide Doc 001 91316 Rev F 73 Code Examples Raw count and Baseline...