Timers - Renesas M16C Series Hardware Manual

16-bit microcopmuter
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

R8C/11 Group

19.4 Timers

19.4.1 Timers X, Y and Z
(1) Timers X, Y and Z stop counting after reset. Therefore, a value must be set to these timers and
prescalers before starting counting.
(2) Even if the prescalers and timers are read out simultaneously in 16-bit units, these registers are
read byte-by-byte in the microcomputer. Consequently, the timer value may be updated during the
period these two registers are being read.
19.4.2 Timer X
(1) Do not rewrite the TXMOD0 to TXMOD1 bits, the TXMOD2 bit and TXS bit simultaneously.
(2) In pulse period measurement mode, the TXEDG bit and TXUND bit in the TXMR register can be
set to "0" by writing "0" to these bits in a program. However, these bits remain unchanged when "1"
is written. To set one flag to "0" in a program, write "1" to the other flag by using the MOV instruction.
(This prevents any unintended changes of flag.)
Example (when setting TXEDG bit to "0"):
MOV.B
(3) When changing to pulse period measurement mode from other mode, the contents of the TXEDG bit
and TXUND bit are indeterminate. Write "0" to the TXEDG bit and TXUND bit before starting counting.
(4) The prescaler X underflow which is generated for the first time after the count start may cause that
the TXEDG bit is set to "1". When using the pulse period measurement mode, leave more than
two periods of the prescaler X right after count starts and set the TXEDG bit to "0".
19.4.3 Timer Y
(1) Do not rewrite the TYMOD0 and TYS bits simultaneously.
19.4.4 Timer Z
(1) Do not rewrite the TZMOD0 to TZMOD1 bits and the TZS bit simultaneously.
(2) In programmable one-shot generation mode and programmable wait one-shot generation mode,
when setting the TZS bit in the TC 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 reload register and stops.
Therefore, the timer count value should be read out in programmable one-shot generation mode
and programmable wait one-shot generation mode before the timer stops.
19.4.5 Timer C
(1) Access the TC, TM0 and TM1 registers in 16-bit units.
This prevents the timer value from being updated between the low-order byte and high-order byte
are being read.
Example (when Timer C is read):
MOV.W
Rev.1.20
Jan 27, 2006
REJ09B0062-0120
#10XXXXXXB,008BH
0090H,R0
; Read out timer C
page 191 of 204
19. Usage Notes

Advertisement

Table of Contents
loading

This manual is also suitable for:

R8c/11 seriesR8c/tiny series

Table of Contents