CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ4V0UM
211
(1) 8-bit counters 2 to 7 (TM2 to TM7)
TMn is an 8-bit read-only register that counts the count pulses.
The counter is incremented synchronous to the rising edge of the count clock.
TM2 and TM3 or TM5 and TM6 can be connected in cascade and used as 16-bit timers.
When TMm and TMm+1 are connected in cascade and used as a 16-bit timer, they can be read by a 16-bit
memory manipulation instruction. However, since they are connected via the internal 8-bit bus, TMm and
TMm+1 are read separately. Consequently, they should be read twice one compared to allow for count variation.
When the count is read out during operation, the count clock input temporarily stops and the count is read at that
time. In the following cases, the count becomes 00H.
(1) RESET is input.
(2) TCEn is cleared.
(3) TMn and CRn0 match in the clear and start mode that occurs when TMn and CRn0 match.
Caution When connected in cascade, these registers become 00H even when TCEn in the lower
timers (TM2, TM4, TM6) is cleared.
Remark
n = 2 to 7
m = 2, 4, 6
(2) 8-bit compare registers 2 to 7 (CR20 to CR70)
The value set in CRn0 is always compared to the count in 8-bit counter n (TMn). If the two values match, an
interrupt request (INTTMn) is generated (except in the PWM mode).
The value of CRn0 can be set in the range of 00H to FFH, and can be written during counting.
When TMm and TMm+1 are connected in cascade and used as a 16-bit timer, CRm0 and CR (m+1) 0 operate
as a 16-bit compare register. This register generates an interrupt request (INTTMm) when the counter value and
register value are compared as 16 bits and match. Since the 1 interrupt request is also generated at
that time, mask the 1 interrupt request when TMm and TMm+1 are used connected in cascade.
Caution If data is set in a cascade connection, always set after stopping the timer.
Remark
n = 2 to 7
m = 2, 4, 6
Содержание MPD703030A
Страница 2: ...User s Manual U13850EJ4V0UM 2 MEMO ...
Страница 514: ...User s Manual U13850EJ4V0UM 514 MEMO ...