CHAPTER 9 TIMER/COUNTER FUNCTION (REAL-TIME PULSE UNIT)
319
User’s Manual U14492EJ3V0UD
(2) Operation in general-purpose timer mode
TM1n can perform the following operations in the general-purpose timer mode.
(a) Interval operation
TM1n and CM1n0 always compare their values and the INTCM1n0 interrupt is generated upon
occurrence of a match. TM1n is cleared (0000H) at the count clock following the match.
Furthermore, when one more count clock is input, TM1n counts up to 0001H. The interval time can be
calculated with the following formula.
Interval time = (CM1n0 value + 1)
×
TM1n count clock rate
Caution
Interval operation can be achieved by setting the ENMD bit of the TMC1n register to “1”.
(b) Free-running operation
TM1n performs full count operation from 0000H to FFFFH, and after the TM1OVFn bit of the STATUSn
register is set (to “1”), TM1n is cleared and resumes counting. The free-running cycle can be calculated
with the following formula.
Free-running cycle = 65536
×
TM1n count clock rate
Caution
The free-running operation can be achieved by setting the ENMD bit of the TMC1n
register to “0”.
(c) Compare function
TM1n connects two compare register (CM1n0, CM1n1) channels and two capture/compare register
(CC1n0, CC1n1) channels.
When the TM1n count value and the set value of one of the compare registers match, a match interrupt
(INTCM1n0, INTCM1n1, INTCC1n0
Note
, INTCC1n1
Note
) is output.
Particularly in the case of interval operation, TM1n is cleared upon generation of the INTCM1n0 interrupt.
Note
This match interrupt is generated when CC1n0 and CC1n1 are set to the compare register mode.
Содержание V850E/IA1 mPD703116
Страница 2: ...2 User s Manual U14492EJ3V0UD MEMO...