TIMERS and TIMER/COUNTERS KS57C2308/P2308/C2316/P2316
11-14
TC0 EVENT COUNTER FUNCTION
Timer/counter 0 can monitor or detect system events by using the external clock input at the TCL0 pin as the
counter source. The TC0 mode register selects rising or falling edge detection for incoming clock signals. The
counter register TCNT0 is incremented each time the selected state transition of the external clock signal occurs.
With the exception of the different TMOD0.4–TMOD0.6 settings, the operation sequence for TC0's event counter
function is identical to its programmable timer/counter function. To activate the TC0 event counter function,
Set TMOD0.2 to "1" to enable TC0;
Clear TMOD0.6 to "0" to select the external clock source at the TCL0 pin;
Select TCL0 edge detection for rising or falling signal edges by loading the appropriate values to TMOD0.5
and TMOD0.4.
Table 11-5. TMOD0 Settings for TCL0 Edge Detection
TMOD0.5 TMOD0.4 TCL0 Edge Detection
0 0 Rising edges
0 1 Falling edges