Notes On Timer Z; Notes On Timer C - Renesas R8C/18 Series Hardware Manual

16-bit single-chip mcu
Table of Contents

Advertisement

R8C/18 Group, R8C/19 Group
19.3.2

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.
19.3.3

Notes on Timer C

Access registers TC, TM0, and TM1 in 16-bit units.
The TC register can be read in 16-bit units. This prevents the timer value from being updated
between when the low-order bytes and high-order bytes are being read.
Example of reading timer C:
MOV.W
Rev.1.30
Apr 14, 2006
REJ09B0222-0130
0090H,R0
; Read out timer C
Page 222 of 233
19. Usage Notes

Advertisement

Table of Contents
loading

This manual is also suitable for:

R8c/1 seriesR8c seriesR8c/19 series

Table of Contents