PIC12C672 MICROCHIP [Microchip Technology], PIC12C672 Datasheet - Page 28

no-image

PIC12C672

Manufacturer Part Number
PIC12C672
Description
8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC12C672-04/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12C672-04/SM
Manufacturer:
MIC
Quantity:
141
Part Number:
PIC12C672-04/SM
Manufacturer:
MICROCHIP
Quantity:
1 000
Part Number:
PIC12C672-04/SM
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC12C672-04/SM
Quantity:
540
Part Number:
PIC12C672-04/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC12C672-10E/SM
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC12C672/JW
Manufacturer:
MICKO
Quantity:
2 100
Part Number:
PIC12C672/JW
Manufacturer:
CY
Quantity:
1 650
PIC12CE5XX
7.2
An 8-bit counter is available as a prescaler for the
Timer0 module, or as a postscaler for the Watchdog
Timer (WDT), respectively (Section 8.6). For simplicity,
this counter is being referred to as “prescaler”
throughout this data sheet. Note that the prescaler
may be used by either the Timer0 module or the WDT,
but not both. Thus, a prescaler assignment for the
Timer0 module means that there is no prescaler for
the WDT, and vice-versa.
The
determine prescaler assignment and prescale ratio.
When assigned to the Timer0 module, all instructions
writing to the TMR0 register (e.g., CLRF 1, MOVWF 1,
BSF 1,x, etc.) will clear the prescaler. When assigned
to WDT, a CLRWDT instruction will clear the prescaler
along with the WDT. The prescaler is neither readable
nor writable. On a RESET, the prescaler contains all
'0's.
7.2.1
The prescaler assignment is fully under software control
(i.e., it can be changed “on the fly” during program
execution). To avoid an unintended device RESET, the
following instruction sequence (Example 7-1) must be
executed when changing the prescaler assignment from
Timer0 to the WDT.
FIGURE 7-5:
DS40172A-page 28
PSA
Note: T0CS, T0SE, PSA, PS2:PS0 are bits in the OPTION register.
Prescaler
SWITCHING PRESCALER ASSIGNMENT
WDT Enable bit
Watchdog
GP2/T0CKI
Timer
T
and
CY
Pin
( = Fosc/4)
BLOCK DIAGRAM OF THE TIMER0/WDT PRESCALER
T0SE
PS2:PS0
0
1
bits
PSA
M
U
X
(OPTION<3:0>)
0
1
T0CS
M
U
X
8-bit Prescaler
0
8 - to - 1MUX
Preliminary
Time-Out
8
MUX
WDT
1
0
1
PSA
EXAMPLE 7-1:
To change prescaler from the WDT to the Timer0
module, use the sequence shown in Example 7-2. This
sequence must be used even if the WDT is disabled. A
CLRWDT instruction should be executed before switching
the prescaler.
EXAMPLE 7-2:
CLRWDT
MOVLW
OPTION
M
U
X
1.CLRWDT
2.CLRF
3.MOVLW
4.OPTION
5.CLRWDT
6.MOVLW
7.OPTION
PSA
'xxxx0xxx'
PS2:PS0
TMR0
'00xx1111’b; ;These 3 lines (5, 6, 7)
'00xx1xxx’b ;Set Postscaler to
Cycles
Sync
2
CHANGING PRESCALER
(TIMER0 WDT)
CHANGING PRESCALER
(WDT TIMER0)
1997 Microchip Technology Inc.
;Clear WDT
;Clear TMR0 & Prescaler
; desired
;PS<2:0> are 000 or 001
; are required only if
; desired WDT rate
;Clear WDT and
;prescaler
;Select TMR0, new
;prescale value and
;clock source
TMR0 reg
Data Bus
8

Related parts for PIC12C672