CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
176
User’s Manual U10676EJ3V0UM
(4) Operation after changing modulo register
The contents of the timer counter modulo register (TMODn) and high-level period setting timer counter modulo
register (TMOD2H) are changed as soon as an 8-bit data memory manipulation instruction has been executed.
n
Rewrite instruction
Count pulse (CP)
Timer counter
modulo register
(TMODn)
High-level period
setting timer counter
modulo register
(TMOD2H)
m
n
Timer counter
count register (Tn)
Match signal
Match signal
0
1
m
0
If the value of TMODn after the change is less than the value of the timer counter count register (Tn), Tn
continues counting. When an overflow occurs, Tn starts counting again from 0. If the values of TMODn and
TMOD2H after the change are less than the values before change (n), it is necessary to restart the timer after
changing TMODn and TMOD2H.
n
Count pulse (CP)
Timer counter
modulo register
(TMODn)
High-level period setting
timer counter
modulo register
(TMOD2H)
m
x – 1
Timer counter
count register (Tn)
n > x > m
x
0
1
255