
246
CHAPTER 11 16-BIT RELOAD TIMER
11.4.4 16-bit Reload Register (TMRLR0/TMRHR0, TMRLR1/
TMRHR1)
The 16-bit reload register (TMRLR0/TMRHR0, TMRLR1/TMRHR1) sets a reload value in
the 16-bit down counter. The value written to this register is loaded into the down
counter, and the value is counted down.
s 16-Bit Reload Register (TMRLR0
/TMRHR0, TMRLR1/TMRHR1)
Figure 11.4-5 16-Bit Reload Register (TMRLR0/TMRHR0, TMRLR1/TMRHR1)
Counting must be stopped (TMCSR: CNTE = "0") regardless of the operating mode of the 16-bit
reload register when a value is written to the 16-bit reload register (TMRLR0/TMRHR0,
TMRLR1/TMRHR1). When the software trigger bit (TRG) is set to "1" or a valid edge (rising,
falling, or both edges) of trigger input specified in the operation mode setting bits (MOD2,
MOD1, and MOD0) is input to the TIN pins, a value stored in the 16-bit reload register is loaded
into the 16-bit down counter and countdown starts.
In reload mode, when an underflow of the 16-bit down counter occurs (change from "0000H" to
"FFFFH"), a value stored in the 16-bit reload register (TMRLR0/TMRHR0, TMRLR1/TMRHR1) is
loaded into the 16-bit down counter and countdown continues. In one-shot mode, when an
underflow of the 16-bit down counter occurs, the 16-bit down counter stops at the value
"FFFFH".
Note:
Counting must be stopped (TMCSR: CNTE = "0") when a value is written to the 16-bit reload
register (TMRLR0/TMRHR0, TMRLR1/TMRHR1).
Use a word transfer instruction (MOVW 003AH, A) to write a value to the 16-bit reload
register (TMRLR0/TMRHR0, TMRLR1/TMRHR1).
Although the 16-bit reload register (TMRLR0/TMRHR0, TMRLR1/TMRHR1) is write-only and
the 16-bit timer register (TMR0/TMR1) is read-only, they are placed at the same address.
Since different values are written to, and read from these registers, none of the INC/DEC
and other instructions that result in read-modify-write (RMW) operations can be used.
WW
W
WW
W
D11
D8
D9
D10
D15
D12
D13
D14
WW
W
WW
W
D3
D0
D1
D2
D7
D4
D5
D6
Initial value
XXXXXXXXB
Initial value
XXXXXXXXB
Address
ch0:000085 H
ch1:000089 H
ch0:000084 H
ch1:000088 H
Address
bit15 bit14 bit13 bit12 bit11 bit10
bit9
bit8
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
W: Write only
X: Undefined