BAT32G1x9 user manual | Chapter 8 Timer B
281 / 1149
Rev.1.02
8.4.3 Timer mode (output comparison function)
This is the mode that detects (relatively matches) whether the contents of the TB register and the
contents of the TBGRA register or TBGRB register are the same. If the content is the same, output any level
from the TBIO0 pin or the TBIO1 pin.
The specifications of the output comparison function are shown in Table 8-10.
Table 8-10
Specifications of the output comparison function
project
specification
Count the sources
f
CLK
, f
CLK
/2, f
CLK
/4, f
CLK
/8, f
CLK
/32
An external input signal from the TBCLKj pin that programmatically selects a valid edge
count
Increment the count
Count cycles
• When the TBCLR 1 bit and TBCCLR 0 bits of the TBCR register are "00B" (free running).
1/fk
65536fk: The frequency of the count source
• When the TBCCR registers the TBCCLR1 bit and the TBCCLR0 bit are "01B" or "10B" (in
TBGRj
Compare the setting value of the TBGRj
register when TB is set to "0000H")
when the TB is set to "0000H") when the
match is set to 1/fk
(n+1)n: TBGRj
register
Waveform output timing
Comparison matching (the contents of the TB register and the TBGRj register are the
same).
Count start criteria
Write "1" (start counting) to the TBSTART bit of the TBBR register.
Count stop conditions
Write "0" (stop count) to the TBSTART bit of the TBMR register.
Timing of the generation of
interrupt requests
• Comparison matching (the contents of the TB register and the TBGRj register are the
same).
• Overflow of TB registers
TBIO0 pin and
TBIO1
The function of the pin
I/O ports or outputs for output comparison (selected by pin).
TBCLK0 pin and
Features of the TBCLK1
pin
I/O port or external clock input
Read timer
If you read the TB register, you can read the count value.
Write timer
Can write TB registers.
Select Features
• Output comparison of the selection of output pins
1 or 2 of the TBIO0 pins and TBIO1 pins
• Compare the selection of output levels when matching
"L" level output, "H" level output, or level inversion output
• Set the TB register to the "0000H" timing
Comparison matching of overflow or TBGRj registers
•Buffer operation (see "8.4.1(2) Buffer Operation").
备注
j=A, B