Rev. 1.60
136
August 20, 2019
Rev. 1.60
137
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
If the PTCCLR bit in the PTMC1 register is high then the counter will be cleared when a compare
match occurs from Comparator A. However, here only the PTMAF interrupt request flag will be
generated even if the value of the CCRP bits is less than that of the CCRA registers. Therefore when
PTCCLR is high no PTMPF interrupt request flag will be generated. In the Compare Match Output
Mode, the CCRA can not be set to "0".
As the name of the mode suggests, after a comparison is made, the PTM output pin will change
state. The PTM output pin condition however only changes state when a PTMAF interrupt request
flag is generated after a compare match occurs from Comparator A. The PTMPF interrupt request
flag, generated from a compare match occurs from Comparator P, will have no effect on the PTM
output pin. The way in which the PTM output pin changes state are determined by the condition of
the PTIO1 and PTIO0 bits in the PTMC1 register. The PTM output pin can be selected using the
PTIO1 and PTIO0 bits to go high, to go low or to toggle from its present condition when a compare
match occurs from Comparator A. The initial condition of the PTM output pin, which is setup after
the PTON bit changes from low to high, is setup using the PTOC bit. Note that if the PTIO1 and
PTIO0 bits are zero then no pin change will take place.
Counter Value
0x3FF
CCRP
CCRA
PTON
PTPAU
PTPOL
CCRP Int.
Flag PTMPF
CCRA Int.
Flag PTMAF
PTM O/P Pin
Time
CCRP=0
CCRP > 0
Counter overflow
CCRP > 0
Counter cleared by CCRP value
Pause
Resume
Stop
Counter
Restart
PTCCLR = 0; PTM [1:0] = 00
Output pin set to
initial Level Low
if PTOC=0
Output Toggle with
PTMAF flag
Note PTIO [1:0] = 10
Active High Output select
Here PTIO [1:0] = 11
Toggle Output select
Output not affected by
PTMAF flag. Remains High
until reset by PTON bit
Output Pin
Reset to Initial value
Output controlled by
other pin-shared function
Output Inverts
when PTPOL is high
Compare Match Output Mode – PTCCLR=0
Note: 1. With PTCCLR=0, a Comparator P match will clear the counter
2. The PTM output pin is controlled only by the PTMAF flag
3. The output pin is reset to its initial state by a PTON bit rising edge