Rev. 1.60
198
August 20, 2019
Rev. 1.60
199
August 20, 2019
BS66F340/BS66F350/BS66F360/BS66F370
Touch A/D Flash MCU with LED Driver
BS66F340/BS66F350/BS66F360/BS66F370
Touch A/D Flash MCU with LED Driver
Start
Write Ref. OSC internal
Capacitor value
to Data Memory (Sector 6 )
Touch Key Auto Scan Operation Start
Set Start bit TKST 0
1
Busy flag TKBUSY=1
All Time Slot
Counter overflow ?
No
Initiate Time Slot &
16-bit C/F Counter
All Time Slot counter &
16-bit C/F counter
Start to count
Time Slot &
16-bit C/F Counter
Keep counting
Yes
TKRCOV = 1
Generate Interrupt
request flag
Read C/F counter value from
Data Memory (Sector 5)
Touch key scan end
Set TKST bit 1
0
End
Load Ref. OSC internal
Capacitor value from
Data Memory (Sector 6 )
Store C/F counter value to
Data Memory (Sector 5 )
All key scan finish ?
Yes
No
Touch key busy flag
TKBUSY=0
Change next key
Touch Key Auto Scan Mode Flow Chart – TKMOD=0, TSCS=0
Touch Key Interrupt
The touch key only has single interrupt, when the time slot counter in all the touch key modules or
in the touch key module 0 overflows, an actual touch key interrupt will take place. The touch keys
mentioned here are the keys which are enabled. The 16-bit C/F counter, 16-bit counter, 5-bit time
slot unit period counter and 8-bit time slot counter in all modules will be automatically cleared.
Progrsmming Considerations
After the relevant registers are setup, the touch key detection process is initiated the changing the
TKST Bit from low to high. This will enable and synchronise all relevant oscillators. The TKRCOV
flag which is the time slot counter flag will go high when the counter overflows. When this happens
an interrupt signal will be generated.
When the external touch key size and layout are defined, their related capacitances will then
determine the sensor oscillator frequency.