NEC UPD703116 User Manual page 297

32-bit single-chip microcontrollers
Table of Contents

Advertisement

(1) Timers 10, 11 (TM10, TM11)
TM1n is a general-purpose timer (in general-purpose mode) and 2-phase encoder input up/down counter (in
UDC mode).
This timer counts up in the general-purpose timer mode and counts up/down in the UDC mode.
TM1n can be read/written in 16-bit units.
Cautions 1. Write to TM1n is enabled only when the TM1CEn bit of the TMC1n register is "0" (count
operation disabled).
2. Continuous reading of TM1n is prohibited. If TM1n is continuously read, the second
read value may differ from the actual value. If TM1n must be read twice, be sure to read
another register between the first and the second read operation.
Correct usage example
TM10 read
TM11 read
TM10 read
TM11 read
3. Writing the same value to the TM1n, CC1n0, and CC1n1 registers, and the STATUSn
register is prohibited. Writing the same value to the CCRn, TUMn, TMC1n, SESA1n, and
PRM1n registers, and CM1n0 and CM1n1 registers is permitted (writing the same value
is guaranteed even during a count operation).
15
14
13
12
TM10
15
14
13
12
TM11
TM1n start and stop is controlled by the TM1CEn bit of timer control register 1n (TMC1n).
The TM1n operation consists of the following two modes.
(a) General-purpose timer mode
In the general-purpose timer mode, TM1n operates as a 16-bit interval timer, free-running timer, or for
PWM output.
Counting is performed based on the clock selected by software.
Division by the prescaler can be selected for the count clock from among f
f
/32, f
/64, or f
CLK
CLK
base clock, refer to 9.2.4 (1) Timer 1/timer 2 clock selection register (PRM02)).
CHAPTER 9 TIMER/COUNTER FUNCTION
11
10
9
8
7
6
11
10
9
8
7
6
/128 with bits PRM12 to PRM10 of prescaler mode register 1n (PRM1n). (f
CLK
User's Manual U14492EJ5V0UD
Incorrect usage example
TM10 read
TM10 read
TM11 read
TM11 read
5
4
3
2
1
0
5
4
3
2
1
0
Address
Initial value
FFFFF5E0H
0000H
Address
Initial value
FFFFF600H
0000H
/2, f
/4, f
/8, f
/16,
CLK
CLK
CLK
CLK
CLK
297
:

Advertisement

Table of Contents
loading

Table of Contents