R8C/18 Group, R8C/19 Group
Rev.1.30
Apr 14, 2006
Page 134 of 233
REJ09B0222-0130
14.2.5
Notes on Timer Z
•
Timer Z stops counting after a reset. Set the values in the timer and prescaler before the count
starts.
•
Even if the prescaler and timer are read out in 16-bit units, these registers are read 1 byte at a
time by the MCU. Consequently, the timer value may be updated during the period when these
two registers are being read.
•
Do not rewrite bits TZMOD0 to TZMOD1, and the TZS bit simultaneously.
•
In programmable one-shot generation mode and programmable wait one-shot generation mode,
when setting the TZS bit in the TZMR register to 0 (stops counting) or setting the TZOS bit in the
TZOC register to 0 (stops one-shot), the timer reloads the value of the reload register and stops.
Therefore, in programmable one-shot generation mode and programmable wait one-shot
generation mode read the timer count value before the timer stops.
•
The TZS bit in the TZMR register has a function to instruct timer Z to start or stop counting and a
function to indicate that the count has started or stopped.
0 (count stops) can be read until the following count source is applied after 1 (count starts) is
written to the TZS bit while the count is being stopped. If the following count source is applied, 1
can be read from the TZS bit. After writing 1 to the TZS bit, do not access registers associated
with timer Z (registers TZMR, PREZ, TZSC, TZPR, TZOC, PUM, TCSC, and TZIC) except for the
TZS bit, until 1 can be read from the TZS bit. The count starts at the following count source after
the TZS bit is set to 1.
Also, after writing 0 (count stops) to the TZS bit during the count, timer Z stops counting at the
following count source.
1 (count starts) can be read by reading the TZS bit until the count stops after writing 0 to the TZS
bit. After writing 0 to the TZS bit, do not access registers associated with timer Z except for the
TZS bit, until 0 can be read from the TZS bit.