CHAPTER 6 16-BIT TIMER/EVENT COUNTER
126
User’s Manual U11302EJ4V0UM
(1) 16-bit compare register (CR00)
CR00 is a 16-bit register whose value is constantly compared with the 16-bit timer register (TM0) count value,
and an interrupt request (INTTM0) is generated if they match.
It can also be used as the register that holds the interval time when TM0 is set to interval timer operation, and
as the register that sets the pulse width when TM0 is set to PWM output operation.
CR00 is set with a 16-bit memory manipulation instruction. Values from 0001H to FFFFH can be set.
RESET input makes CR00 undefined.
Cautions 1. The PWM data (14 bits) must be set in the higher 14 bits of CR00. The lower two bits must
be set to 00.
2. CR00 should be set to a value other than 0000H. This means that when the timer is used
as an event counter, a 1-pulse count operation is not possible.
3. When the value after CR00 is changed is smaller than that of the 16-bit timer register (TM0),
TM0 continues to count and overflows, then resumes counting from 0. Therefore, if the value
after CR00 is changed is smaller than the value before CR00 is changed, the timer needs
to be restarted after CR00 is changed.
(2) 16-bit capture register (CR01)
CR01 is a 16-bit register used to capture the contents of the 16-bit timer (TM0).
The capture trigger is the INTP0/TI0 pin valid edge input. The INTP0 valid edge is set by the external interrupt
mode register (INTM0).
CR01 is read with a 16-bit memory manipulation instruction.
RESET input makes CR01 undefined.
Caution If the valid edge for the TI0/P00 pin is input during a read from CR01, CR01 does not perform
the capture operation and holds the previous data. In this case, however, the interrupt request
flag (PIF0) is set because a valid edge is detected.
(3) 16-bit timer register (TM0)
TM0 is a 16-bit register that counts the count pulse.
TM0 is read with a 16-bit memory manipulation instruction.
RESET input sets TM0 to 0000H.
Caution As reading of the value of TM0 is performed via CR01, the previously set value of CR01 is lost.
Содержание mPD780208 Subseries
Страница 2: ...2 User s Manual U11302EJ4V0UM MEMO...