BAT32G1x9 user manual | Chapter 8 Timer B
280 / 1149
Rev.1.02
(3) Run the example
An example of an input capture operation is shown in Figure 8-18.
In this example, select the double edge of the rising/falling edge as the input edge of the input snap of the TBIO0 pin,
select the falling edge as the input edge of the input capture of the TBIO1 pin, and clear the TB when the input snap of the
TBGRB register Counters for registers.
(a) The TBGRA registers and TBGRB registers must be set as input capture registers through the TBIOR
registers, and the input edges of the input capture signal must be selected from the rising, falling, and bilateral
edges.
(b) The TBSTART position of the TBBMR register must be placed "1" to start counting the TB registers.
Figure 8-18
an example of an input capture
TBGRA register
TBGRB register
TBIO1 input
TBIO0 input
Value of TB register
TBIO1
0000H
0005H
0160H
0180H
Time
By setting the TBCLR bits 0 and TBCCLR 1 bits of the TBBCR registers, the count can be cleared when input
capture A or input capture B occurs. Fig. 8-18 is an example of a run when the TBCCLR1 bit and the TBCCLR0 position
"10B" are used. If set to count clearing by input capture during operation and input capture when the timer's count
value is "FFFFH", the interrupt flags for TBIMFA bits and TBIMFB bits, etc., are set to the runtime order of the count
source and input capture The TBOVF bit may also change to "1".