Datasheet
FS98O22
Rev. 1.6 59/146
z Counter mode:
There are two 16-bit counters (CTA and CTB) in Programmable Counter unit.
Operation:
1. Clear FQTMB and MUXSEL[2] register flags to make the Programmable Counter work as Counter.
2. Setup MUXSEL[1:0] to decide the input clock signal.
Table 6-11 Programmable Counter Clock signal selection table
MUXSEL[1:0] Clock signal
11 PFI
10 ECK
01 Instruction Cycle
00 ICK
3. If PFI is assigned to be the Clock signal, users could set TE to invert the PFI voltage level.
4. Clear OVAB register flag to set the CTA as the working counter. When CTA counter overflows, the
interrupt (CTIE) will be triggered.
5. Clear CTIF and set the CTIE and GIE register flag to enable the Programmable Counter interrupt.
6. Setup CTB[15:0]. CTA[15:0] will be filled with the same value as CTB[15:0]. When CTA[15:0] overflows, it
will be filled with the same value again. User could decide CTA timeout by setting up CTB[15:0] register.
7. Set TON to start the counter.
8. When CTA counter overflows, the interrupt will be triggered.
9. Users could clear TON register flag to stop the counting process.
CLK
TON
CTA_CLK
CTA FFF9 FFFB FFFC FFFD FFFE FFFF FFF9 FFFA
CTB XXXX
XXXX FFFA
INT
FFF9
FFFB FFFC FFFD FFFE FFFF FFFA FFFB
X1 0 1
CTIF
FFFA
FFFC FFFD FFFE FFFF FFFA
Software Write into CTB
Software Clear
FFFB FFFC
Software no Clear
Software ClearSoftware Set
Software Write into CTB (CTA same as CTB)
When CTIE=1
Figure 6-4 Programmable Counter Counter mode
FORTUNE'
Properties
For Reference Only