PIC14000-04 Microchip Technology, PIC14000-04 Datasheet - Page 40
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
PIC14000-04
Manufacturer Part Number
PIC14000-04
Description
28-Pin Programmable Mixed Signal Controller
Manufacturer
Microchip Technology
Datasheet
1.PIC14000-04.pdf
(152 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
PIC14000-04/SO
Manufacturer:
Microchip Technology
Quantity:
135
Company:
Part Number:
PIC14000-04/SO
Manufacturer:
Maxim
Quantity:
103
Company:
Part Number:
PIC14000-04/SP
Manufacturer:
Microchip
Quantity:
482
Part Number:
PIC14000-04/SP
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC14000-04/SS
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC14000-04/SS
Manufacturer:
MICROCHI
Quantity:
20 000
PIC14000
6.3.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,
(Example 6-1) must be executed when changing the
prescaler assignment from Timer0 to WDT.
EXAMPLE 6-1:
10.BCF
TABLE 6-1:
TABLE 6-2:
DS40122B-page 40
TMR0
OPTION
INTCON
Legend: x = unknown,
Note 1: For reset values of registers in other reset situations refer to Table 10-4.
1.BCF
2.CLRWDT
3.CLRF
4.BSF
5.MOVLW '00101111'b;These 3 lines (5, 6, 7)
6.MOVWF OPTION
7.CLRWDT
8.MOVLW '00101xxx'b ;Set Postscaler to
9.MOVWF OPTION
Address
01h
0Bh/8Bh
81h
87h
Legend: r = Reserved locations
Register Name
SWITCHING PRESCALER ASSIGNMENT
Shaded boxes are not used by Timer0 module
the
STATUS,RP0
TMR0
STATUS, RP0 ;Bank 1
STATUS, RP0 ;Return to Bank 0
Name
TMR0
INTCON
OPTION
TRISC
SUMMARY OF TIMER0 REGISTERS
REGISTERS ASSOCIATED WITH TIMER0
following
CHANGING PRESCALER
(TIMER0 WDT)
Timer/counter register
Configuration and prescaler assign-
ment bits for TMR0.
TMR0 overflow interrupt flag and
mask bits.
TRISC7
RCPU
;Skip if already in
; Bank 0
;Clear WDT
;Clear TMR0 & Prescaler
; are required only
; if desired PS<2:0>
; are 000 or 001
; desired WDT rate
Bit 7
GIE
instruction
Function
TRISC6
PEIE
Bit 6
r
sequence
TRISC5
T0CS
Bit 5
T0IE
Preliminary
TIMER0 TIMER/COUNTER
TRISC4
T0SE
Bit 4
To change prescaler from the WDT to the Timer0
module use the sequence shown in Example 6-2. This
precaution must be taken even if the WDT is disabled.
EXAMPLE 6-2:
r
Address
CLRWDT
BSF
MOVLW
MOVWF
BCF
0Bh
01h
81h
TRISC3
Bit 3
PSA
r
STATUS, RP0
B'xxxx0xxx'
OPTION
STATUS, RP0
CHANGING PRESCALER
(WDT TIMER0)
TRISC2
Bit 2
T0IF
PS2
Power-on Reset Value
1996 Microchip Technology Inc.
;Clear WDT and
;prescaler
;Select TMR0, new
;prescale value and
;clock source
xxxx xxxx
1111 1111
0000 000x
TRISC1
Bit 1
PS1
r
TRISC0
Bit 0
PS0
r