BAT32G1x9 user manual | Chapter 10 Timer M
380 / 1149
Rev.1.02
(1) Operation example
By setting the CCLR0 to CCLR2 bits of the TMCRi registers (i=0, 1), the timer M i is applied when input
capture or comparison matching occurs The count value is reset. If the comparison expectation value is "FFFFH",
it changes from "FFFFH" to "0000H" in the same way as the overflow, and the overflow flag changes to "1".
Figure 10-50
An example of an output comparison function
value in Tmi register
TSTARTi bit of
TMSTR register
TMIOAi output
IMFA bit of
TMSRi register
TMIOBi output
IMFB bit of
TMSRi register
TMIOCi output
IMFC bit of
TMSRi register
Initial output
L
voltage level
Initial output
L
voltage level
Initial output
H
voltage level
inverted phase output
while compare matching
while compare matching,
output "H" voltage level
while compare matching,
output "L" voltage level
set to 0 via program
set to 0 via program
set to 0 via program
Stop
counting
restart
counting
remain output voltage level
remain output voltage level
remain output voltage level
counting source
Note: i=0,1
m: The setting value of the TMGRAi register
n: The setting value of the TMGRBi register
p: The setting value of the TMGRCi register
The conditions in the above figure are as follows:
The CSELi bit of the TMSTR register is "1" (TMi does not stop when the comparison matches).
The TMBFCi bits and TMBFDi bits of the TMMR registers are "0" (TMGRCi and TMGRDi do not operate as
buffers).
The EAi bits of the TMOER1 register, the EBi bits, and the ECi bits are "0" (allowing the outputs of TMIOAi,
TMIOBi, and TMIOCi).
The CCLR2~CCLR0 bits of the TMCRi register are "001B" (when the TMGRAi comparison matches, the TMi
position is "0000H").
The TMOCR registers TOAi bit and TOBi bit are "0" (the initial output "L" level is used before comparison
matching) and the TOCi bit is "1" (The initial output "H" level is before the comparison matches).
The IOA2~IOA0 bits of the TMIORAi register are "011B" (TMIOAi inverts the output when the TMGRAi
comparison matches).
The IOB2~IOB0 of the TMIORAi register is "010B" (when the TMGRBi comparison matches, the TMIOBi outputs
the "H" level).
The IOC3~IOC0 of the TMIORCi register is "1001B" (TMIOCi outputs the "L" level when the TMGRCi
comparison matches).
The IOD3~IOD0 of the TMIORCi register is "1000B" (the TMGRDi register does not control the output of the
TMIOBi pin, and it is forbidden to compare the output of the matching pin).