CHAPTER 7 16-BIT TIMER/EVENT COUNTER 0
User’s Manual U16896EJ2V0UD
244
7.4.3 External event counter operation
When the PRM01.PRM011 and PRM01.PRM010 bits are set to 11 (for counting up with the valid edge of the TI010
pin) and the TMC01.TMC013 and TMC01.TMC012 bits are set to 11, the valid edge of an external event input is
counted, and a match interrupt signal indicating matching between the TM01 register and the CR010 register
(INTTM010) is generated.
To input the external event, the TI010 pin is used. Therefore, the timer/event counter cannot be used as an
external event counter in the clear & start mode entered by the TI010 pin valid edge input (when the TMC013 and
TMC012 bits = 10).
The INTTM010 signal is generated with the following timing.
•
Timing of generation of INTTM010 signal (second time or later)
= Number of times of detection of valid edge of external event
×
(Set value of the CR010 re 1)
However, the first match interrupt immediately after the timer/event counter has started operating is generated with
the following timing.
•
Number of times of detection of valid edge of external event input
×
(Set value of the CR010 re 2)
To detect the valid edge, the signal input to the TI010 pin is sampled during the clock cycle of f
PRS
. The valid edge
is not detected until it is detected two times in a row. Therefore, a noise with a short pulse width can be eliminated.
Remarks 1.
For the alternate-function pin (TI010) settings, refer to
Table 4-12 Settings When Port Pins Are
Used for Alternate Functions
.
2.
For enabling the INTTM010 interrupt, refer to
CHAPTER 17 INTERRUPT/EXCEPTION PROCESSING
FUNCTION
.
Figure 7-10. Block Diagram of External Event Counter Operation
16-bit counter (TM01)
CR010 register
Operable bits
TMC013, TMC012
Clear
Match signal
INTTM010 signal
f
XX
/4
Edge
detection
TI010 pin
Output
controller
TO01 pin