BAT32G1x9 user manual | Chapter 7 Timer A
254 / 1149
Rev.1.02
7.5.5
Setup steps for TAO pins and TAIO pins
After reset, the multiplexed I/O ports of the TAO pin and the TAIO pin are input ports. When you want to output
from the TAO pin and the TAIO pin, you must follow the steps below to set it.
Change the step
(1) Set the mode.
(2) Sets the initial value to allow output.
(3) Place the TAO pin and the TAIO pin at the position "0" of the port register.
(4) Set the bit of the port mode register corresponding to the TAO pin and the TAIO pin to output mode.
(Starting with the TAO pin and taio pin) output
(5) Start counting (TSTART=1 for TACR0 registers).
When entering from the TAIO pin, you must follow the steps below to set it up.
(1) Set the mode.
(2) Set the initial value and select Edge.
(3) Set the bit of the port mode register corresponding to the TAIO pin to input mode.
(input starting from the TAIO pin).
(4) Start counting (TSTART=1 for TAMR0 registers).
(5) Wait until the TCSTF bit of the TACR0 register becomes "1" (counting).
(Event counter mode only)
(6) Input external events from the TAIO pin.
(7) Invalid treatment of the measured value must be performed at the end of the first measurement (the second
and subsequent measurements are valid).
(Pulse width measurement mode and pulse period measurement mode only)
7.5.6
When timer A is not used
When timer A is not used, the TAMR0 register must be placed at the TMOD2~TMOD0 position "000B" (timer
mode) and will
TOENA position "0" of the TAIOC0 register (TAO output is disabled).
7.5.7
Timer A runs the stop of the clock
The provision or stop of the timer A clock can be controlled via the TMAEN bit of the PER1 register. However,
the following SFR cannot be accessed when timer A's clock stops, but must be accessed in the state that provides
timer A clock.
TA0 registers, TACR0 registers, TAMR0 registers, TAIOC0 registers, and TAISR0 registers