English
Language : 

PIC16LF720_11 Datasheet, PDF (91/244 Pages) Microchip Technology – 20-Pin Flash Microcontrollers with nanoWatt XLP Technology
PIC16(L)F720/721
12.0 TIMER0 MODULE
The Timer0 module is an 8-bit timer/counter with the
following features:
• 8-bit timer/counter register (TMR0)
• 8-bit prescaler (shared with Watchdog Timer)
• Programmable internal or external clock source
• Programmable external clock edge selection
• Interrupt on overflow
• TMR0 can be used to gate Timer1
Figure 12-1 is a block diagram of the Timer0 module.
12.1 Timer0 Operation
The Timer0 module can be used as either an 8-bit timer
or an 8-bit counter.
12.1.1 8-BIT TIMER MODE
The Timer0 module will increment every instruction
cycle, if used without a prescaler. 8-Bit Timer mode is
selected by clearing the T0CS bit of the OPTION
register.
When TMR0 is written, the increment is inhibited for
two instruction cycles immediately following the write.
Note:
The value written to the TMR0 register
can be adjusted, in order to account for
the two instruction cycle delay when
TMR0 is written.
12.1.2 8-BIT COUNTER MODE
In 8-Bit Counter mode, the Timer0 module will increment
on every rising or falling edge of the T0CKI pin.
8-Bit Counter mode using the T0CKI pin is selected by
setting the T0CS bit in the OPTION register to ‘1’.
The rising or falling transition of the incrementing edge
for either input source is determined by the T0SE bit in
the OPTION register.
FIGURE 12-1:
BLOCK DIAGRAM OF THE TIMER0/WDT PRESCALER
FOSC/4
T0CKI
T1GSS = 11
TMR1GE
WDTE
0
1
0
T0SE
T0CS
1
PSA
8-bit
Prescaler
8
1
SYNC
2 TCY
0
PSA
Data Bus
8
TMR0
Set Flag bit T0IF
on Overflow
Overflow to Timer1
Low-Power
WDT OSC
Divide by
512
PS<2:0>
1
WDT
Time-out
0
PSA
 2011 Microchip Technology Inc.
Preliminary
DS41430B-page 91