204CHAPTER 8 16-BIT TIMER/EVENT COUNTERCRC0 00/10/100000CRC00CRC01CRC02CR00 set as compare registerTMC0 00/1110000OVF0TMC01TMC02TMC03Clear & start with match of TM0 and CR008.5.5 External event counter operationThe external event counter counts the number of external clock pulses to be input to the TI00/P00 pin with the16-bit timer register (TM0).TM0 is incremented each time the valid edge specified with the external interrupt mode register 0 (INTM0) is input.When the TM0 counted value matches the 16-bit capture/compare register 00 (CR00) value, TM0 is cleared to0 and the interrupt request signal (INTTM00) is generated.Set the value other than 0000H to CR00 (1-pulse count operation cannot be performed).The rising edge, the falling edge or both edges can be selected with bits 2 and 3 (ES10 and ES11) of INTM0.Because operation is carried out only after the valid edge is detected twice by sampling at the interval selectedwith the sampling clock select register (SCS), noise with short pulse widths can be removed.Figure 8-26. Control Register Settings in External Event Counter Mode(a) 16-bit timer mode control register (TMC0)(b) Capture/compare control register 0 (CRC0)Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the external eventcounter. See the description of the respective control registers for details.