CHAPTER 7 8-BIT TIMER/EVENT COUNTER
153
User’s Manual U11302EJ4V0UM
(1) 8-bit compare registers (CR10, CR20)
These are 8-bit registers used to compare the value set to CR10 with the 8-bit timer register 1 (TM1) count
value, and the value set to CR20 with the 8-bit timer register 2 (TM2) count value, and, if they match,
generate an interrupt request (INTTM1 and INTTM2, respectively).
CR10 and CR20 are set with an 8-bit memory manipulation instruction. They cannot be set with a 16-bit
memory manipulation instruction. When the compare register is used as an 8-bit timer/event counter,
values from 00H to FFH can be set. When the compare register is used as a 16-bit timer/event counter,
values from 0000H to FFFFH can be set.
RESET input makes CR10 and CR20 undefined.
Cautions 1. When using the compare register as a 16-bit timer/event counter, be sure to set data after
stopping timer operation.
2. When the values of CR10 and CR20 after changing are smaller than those of the 8-bit timer
registers (TM1, TM2), TM1 and TM2 continue to count. When they overflow, counting starts again
from 0. Therefore, it is necessary to restart the timer after changing the values of CR10 and CR20
if the values of CR10 and CR20 are smaller than the values before changing.
(2) 8-bit timer registers 1, 2 (TM1, TM2)
These are 8-bit registers used to count count pulses.
When TM1 and TM2 are used in the separate mode, they should be read with an 8-bit memory manipulation
instruction. When TM1 and TM2 are used in 16-bit timer mode, the 16-bit timer register (TMS) should be
read with a 16-bit memory manipulation instruction.
RESET input sets TM1 and TM2 to 00H.
7.3 8-Bit Timer/Event Counter Control Registers
The following four registers are used to control the 8-bit timer/event counter.
•
Timer clock select register 1 (TCL1)
•
8-bit timer mode control register (TMC1)
•
8-bit timer output control register (TOC1)
•
Port mode register 3 (PM3)
(1) Timer clock select register 1 (TCL1)
This register sets the count clock of 8-bit timer registers 1 and 2.
TCL1 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL1 to 00H.
Содержание mPD780204
Страница 2: ...2 User s Manual U11302EJ4V0UM MEMO ...