BAT32G1x9 user manual | Chapter 7 Timer A
252 / 1149
Rev.1.02
7.5 Considerations when using Timer A
7.5.1
Start and stop control of counting
•
Event counting mode or when the counting source is set to a non-EVENTC
If you write "1" (start counting) to the TSTART bit of the TACR0 register during the counting stop, the
TCSTF of the TARCR0 register is counted within 3 source cycles The bit is "0" (stop count). With the
exception of the TCSTF bit, the associated register
note
for timer A cannot be accessed before the TCSTF
bit becomes "1" (counting).
If you write "0" (stop counting) to the TSTART bit during the counting process, the TSTF bit is "1" for 3
counting source cycles. Stop counting when the TCSTF bit changes to "0". With the exception of the
TCSTF bit, the associated register
note
for timer A cannot be accessed before the TCSTF bit becomes "0".
The interrupt register must be cleared before changing the TSTART bit from "0" to "1". For details, please
refer to "Chapter 25 Interrupt Functions".
Note: Timer
A's relevant registers:
TA0,
TACR0,
TAIOC0,
TAMR0
,
TAISR0
•
Event counting mode or when the counting source is set to EVENTC
If you write "1" (start counting) to the TSTART bit of the TARR0 register during the counting stop, there are
2 CPU clock cycles for the TARR0 register The TCSTF bit is "0" (stop count). With the exception of the
TCSTF bit, the associated register
note
for timer A cannot be accessed before the TCSTF bit becomes
"1" (counting).
If you write "0" (stop counting) to the TSTART bit during the counting process, the TCSTF bit is "1" for 2
CPU clock cycles. Stop counting when the TCSTF bit changes to "0". With the exception of the TCSTF bit,
the associated register
note
for timer A cannot be accessed before the TCSTF bit becomes "0".
The interrupt register must be cleared before changing the TSTART bit from "0" to "1". For details,
please refer to "Chapter 25 Interrupt Function".
Note: Timer
A's relevant registers:
TA0,
TACR0,
TAIOC0,
TAMR0
,
TAISR0
7.5.2
Access to flags (TEDGF bits and TUNDF bits of the TACR0 register).
If you programmatically write "0" to the TEDGF bits and TUNDF bits of the TARR0 register, these bits become
"0". However, even if you write the "1" value, it does not change. If you use a read-modify-write instruction on the
TARR0 register, even if the TEDGF bit becomes "1" (with a valid edge) and during instruction execution The
TUNDF bit becomes "1" (underflow occurs) or the TEDGF bit and TUNDF position "0" may be mistaken for timing.
The TACR0 register must be accessed via the 8-bit memory manipulation instruction.
7.5.3
Access to the Counting register
When writing THE TA0 registers continuously with both the TSTART bit and the TSTF bit of the TAC0 register
being "1" (counting), there must be at least 3 intervals between the respective write operations counts the source
clock cycles.