PIC16HV540 Microchip Technology, PIC16HV540 Datasheet - Page 25

no-image

PIC16HV540

Manufacturer Part Number
PIC16HV540
Description
Enhanced PIC16C54 EPROM-Based 8-Bit CMOS Microcontroller
Manufacturer
Microchip Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16HV540-04/P
Manufacturer:
Microchip
Quantity:
1 736
Part Number:
PIC16HV540-04/SO
Manufacturer:
Microchip
Quantity:
485
Part Number:
PIC16HV540-04I/P
Manufacturer:
MICROCHIP
Quantity:
664
Part Number:
PIC16HV540-04I/SO
Manufacturer:
Maxim
Quantity:
41
Part Number:
PIC16HV540-20/P
Quantity:
5
6.0
The Timer0 module has the following features:
• 8-bit timer/counter register, TMR0
• 8-bit software programmable prescaler
• Internal or external clock select
Figure 6-1 is a simplified block diagram of the Timer0
module, while Figure 6-2 shows the electrical structure
of the Timer0 input.
Timer mode is selected by clearing the T0CS bit
(OPTION<5>). In timer mode, the Timer0 module will
increment every instruction cycle (without prescaler). If
TMR0 register is written, the increment is inhibited for
the following two cycles (Figure 6-3 and Figure 6-4).
The user can work around this by writing an adjusted
value to the TMR0 register.
FIGURE 6-1:
- Readable and writable
- Edge select for external clock
2000 Microchip Technology Inc.
T0CKI
pin
Note 1:
TIMER0 MODULE AND TMR0
REGISTER
T0SE
2:
3:
F
(1)
Bits T0CS, T0SE, PSA, PS2, PS1 and PS0 are located in the OPTION register.
The prescaler is shared with the Watchdog Timer (Figure 6-6).
Bit 0 of TMR0 will be output on OSC2/CLKOUT pin when RC oscillator mode is selected.
TIMER0 BLOCK DIAGRAM
OSC
/4
T0CS
0
1
(1)
PS2, PS1, PS0
Programmable
Prescaler
3
Preliminary
(2)
(1)
PSA
1
0
(1)
Counter mode is selected by setting the T0CS bit
(OPTION<5>). In this mode, Timer0 will increment
either on every rising or falling edge of pin T0CKI. The
incrementing edge is determined by the source edge
select bit T0SE (OPTION<4>). Clearing the T0SE bit
selects the rising edge. Restrictions on the external
clock input are discussed in detail in Section 6.1.
The prescaler may be used by either the Timer0 mod-
ule or the Watchdog Timer, but not both. The prescaler
assignment is controlled in software by the control bit
PSA (OPTION<3>). Clearing the PSA bit will assign the
prescaler to Timer0. The prescaler is not readable or
writable. When the prescaler is assigned to the Timer0
module, prescale values of 1:2, 1:4,..., 1:256 are select-
able. Section 6.2 details the operation of the prescaler.
A summary of registers associated with the Timer0
module is found in Table 6-1.
PSout
Internal Oscillator
Drive Circuit
(2 cycle delay)
Sync with
Internal
Clocks
Oscillator Mode
PSout
Select
Sync
PIC16HV540
M
U
X
(3)
0
TMR0 reg
Data bus
“SLEEP”
DS40197B-page 25
8
OSC2/
CLKOUT
7

Related parts for PIC16HV540