CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ6V0UD
222
7.2.4 Operation as external event counter
TMn can be used as an external event counter that counts the number of clock pulses input to the TIn0 pin from
an external source by using 16-bit timer register n (TMn).
Each time the valid edge specified by prescaler mode register n0 (PRMn0) has been input, TMn is incremented.
When the count value of TMn matches with the value of 16-bit capture/compare register n0 (CRn0), TMn is
cleared to 0, and an interrupt request signal (INTTMn0) is generated.
The edge is specified by ESn00 and ESn01 bits of prescaler mode register n0 (PRMn0). The rising, falling, or
both the rising and falling edges can be specified.
The valid edge is detected through sampling at a count clock cycle of f
XX
/2, and the capture operation is not
performed until the valid level is detected two times. Therefore, noise with a short pulse width can be removed.
Figure 7-18. Control Register Settings in External Event Counter Mode
(a) 16-bit timer mode control registers 0, 1 (TMC0, TMC1)
TMCn3
TMCn2
TMCn1
OVFn
TMCn
0
0
0
0
1
1
0/1
0
Clears and starts on
match between TMn
and CRn0.
(b) Capture/compare control registers 0, 1 (CRC0, CRC1)
CRCn2
CRCn1
CRCn0
CRCn
0
0
0
0
0
0/1
0/1
0
CRn0 as compare
register
Remark
0/1:
When these bits are reset to 0 or set to 1, other functions can be used along with the external
event counter function. For details, refer to
7.1.4 (1) 16-bit timer mode control registers 0, 1
(TMC0, TMC1)
and
7.1.4 (2) Capture/compare control registers 0, 1 (CRC0, CRC1)
.
Содержание V850/SB1
Страница 2: ...User s Manual U13850EJ6V0UD 2 MEMO ...