CHAPTER 9 TIMER/COUNTER FUNCTION
310
User’s Manual U15195EJ5V0UD
9.2.5 Operation
(1) Operation in general-purpose timer mode
TM10 can perform the following operations in the general-purpose timer mode.
(a) Interval operation (when ENMD bit of TMC10 register = 1)
TM10 and CM100 always compare their values and the INTCM100 interrupt is generated upon
occurrence of a match. TM10 is cleared (0000H) at the count clock following the match.
Furthermore, when one more count clock is input, TM10 counts up to 0001H.
The interval time can be calculated with the following formula.
Interval time = (CM100 value + 1)
×
TM10 count clock rate
(b) Free-running operation (when ENMD bit of TMC10 register = 0)
TM10 performs a full count operation from 0000H to FFFFH, and after the TM1OVF0 bit of the STATUS0
register is set (to 1), TM10 is cleared to 0000H at the next count clock and resumes counting.
The free-running cycle can be calculated by the following formula.
Free-running cycle = 65,536
×
TM10 count clock rate
(c) Compare function
TM10 connects two compare register (CM100, CM101) channels and two capture/compare register
(CC100, CC101) channels.
When the TM10 count value and the set value of one of the compare registers match, a match interrupt
(INTCM100, INTCM101, INTCC100
Note
, INTCC101
Note
) is output. Particularly in the case of interval
operation, TM10 is cleared upon generation of the INTCM100 interrupt.
Note
This match interrupt is generated when CC100 and CC101 are set to the compare register mode.
(d) Capture function
TM10 connects two capture/compare register (CC100, CC101) channels.
When CC100 and CC101 are set to the capture register mode, the value of TM10 is captured in
synchronization with the corresponding capture trigger signal.
Furthermore, an interrupt request signal (INTCC100, INTCC101) is generated by the valid edge of the
INTP100, INTP101 input signals specified as the capture trigger signals.
Содержание PD703114
Страница 2: ...2 User s Manual U15195EJ5V0UD MEMO ...