CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ6V0UD
236
(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 in synchronization with 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 and 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 CRn0 register is set by an 8-bit memory manipulation instruction.
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 that is set by a 16-bit memory manipulation instruction. 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.
RESET input sets these registers to 00H.
Caution
If data is set in a cascade connection, always set after stopping the timer.
Remark
n = 2 to 7
m = 2, 4, 6
7.3.4 Timer n control register
The following two types of registers control timer n.
• Timer clock selection registers n0, n1 (TCLn0, TCLn1)
• 8-bit timer mode control register n (TMCn)
Содержание V850/SB1
Страница 2: ...User s Manual U13850EJ6V0UD 2 MEMO ...