Page
34
Regardless of which other options are selected, Timer 2 can operate in Timer or Counter mode If
Source
is set to Timer, Timer 2 increments from the system clock. If it is set to Counter, it
increments on either rising or falling edge (set by
Edge
) on T2 pin (pin32 - PD7).
A
prescaler
can be applied to increase overflow time in timer mode.
PWM Enable
This enables Pulse Width Modulation mode for this Timer. The resolution is set to 8-bit. So the
timer counts from $00 to $FF and down to $00. The match value is set in the
Compare Value
Field. When the Timer value matches the value set in the Compare Value field (which will occur
twice every cycle - on upcount and downcount), the output action that results on PWM2 (pin 17 -
PB7)) can be set by the
Output Action
radio buttons :
Disconnected - No effect on output pin
Non-inverted - Cleared on upcount, set on downcount
Inverted - Set on upcount, cleared on downcount
Output Compare
The value of Timer 0 is compared with the value set in the
Compare Value
Field. When a match
is detected, the effect on the output pin (OC2 - pin 17 - PB7) is set by the
Output
radio buttons.
If the Clear Timer box is checked, the timer is reset to $00 in the CPU clock cycle after a match.
The output can be configured as illustrated.