165
CHAPTER 8 8/16-BIT CAPTURE TIMER/COUNTER
■
Counter Function
The counter function counts the falling edges of the external clocks input to the P33/EC external pin. The 8/
16-bit capture timer/counter can operate independently because the EC pin acts as an external clock input
pin. Only timer 0 can select the external clock. The counter function operates using timer 0 with the 8-bit
mode or with the 16-bit mode.
• The counter function counts the number of edges of the external clocks selected by the count clock
selection bit (CINV) of the timer 0 control register (TCR0). When the number of edges equals the
setting value, the counter function generates an interrupt request and inverts the output level of the
square wave output pin.
• In timer 0 for the 8-bit mode, a count operation up to 2
8
is possible.
• In the 16-bit mode, a count operation up to 2
16
is possible.
• Inputting an external clock whose cycle is constant enables the counter to be used as a device whose
function is similar to an interval timer.