M16C/62P Group (M16C/62P, M16C/62PT)
15. Timers
Rev.2.41
Jan 10, 2006
Page 160 of 390
REJ09B0185-0241
15.2.2
Event Counter Mode
In event counter mode, the timer counts pulses from an external device or overflows and underflows of other
timers (see Table 15.7). Figure 15.20 shows TBiMR Register in Event Counter Mode.
NOTES:
1. The TB0S to TB2S bits are assigned to the bit 5 to bit 7 in the TABSR register, and the TB3S to
TB5S bits are assigned to the bit 5 to bit 7 in the TBSR register.
Table 15.7
Specifications in Event Counter Mode
Item
Specification
Count Source
• External signals input to TBiIN pin (i=0 to 5) (effective edge can be selected in
program)
• Timer Bj overflow or underflow (j=i-1, except j=2 if i=0, j=5 if i=3)
Count Operation
• Down-count
• When the timer underflows, it reloads the reload register contents and
continues counting
Divide Ratio
1/(n+1) n: set value of TBi register 0000h to FFFFh
Count Start Condition
Set TBiS bit
(1)
to “1” (= start counting)
Count Stop Condition
Set TBiS bit to “0” (= stop counting)
Interrupt Request
Generation Timing
Timer underflow
TBiIN Pin Function
Count source input
Read from Timer
Count value can be read by reading TBi register
Write to Timer
• When not counting and until the 1st count source is input after counting start
Value written to TBi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to TBi register is written to only reload register
(Transferred to counter when reloaded next)
http://www.xinpian.net
提供单片机解密、IC解密、芯片解密业务
010-62245566 13810019655