PIC16F627-04 Microchip Technology, PIC16F627-04 Datasheet - Page 49

no-image

PIC16F627-04

Manufacturer Part Number
PIC16F627-04
Description
FLASH-Based 8-Bit CMOS Microcontrollers
Manufacturer
Microchip Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F627-04/P
Quantity:
31
Part Number:
PIC16F627-04/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F627-04/SO
Manufacturer:
MIC
Quantity:
933
Part Number:
PIC16F627-04/SO
Manufacturer:
MICROCHI
Quantity:
20 000
Part Number:
PIC16F627-04/SS
Manufacturer:
MICROCHIP
Quantity:
13
Part Number:
PIC16F627-04/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F627-04I/P
Quantity:
18
Part Number:
PIC16F627-04I/P
Manufacturer:
MICR
Quantity:
20 000
Part Number:
PIC16F627-04I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
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:
Address
01h
0Bh/8Bh/
10Bh/18Bh
81h
85h
Legend: — = Unimplemented locations, read as ‘0’, u = unchanged, x = unknown
1.BCF
2.CLRWDT
3.CLRF
4.BSF
5.MOVLW
6.MOVWF
7.CLRWDT
8.MOVLW
9.MOVWF
1999 Microchip Technology Inc.
Note:
SWITCHING PRESCALER ASSIGNMENT
the
STATUS, RP0 ;Skip if already in
TMR0
STATUS, RP0 ;Bank 1
'00101111’b ;These 3 lines (5, 6, 7)
OPTION
'00101xxx’b ;Set Postscaler to
OPTION
STATUS, RP0
Shaded bits are not used by TMR0 module.
Name
TMR0
INTCON
OPTION
TRISA
REGISTERS ASSOCIATED WITH TIMER0
following
CHANGING PRESCALER
(TIMER0 WDT)
Timer0 module register
TRISA7
RBPU
Bit 7
GIE
;Clear WDT
;Clear TMR0 & Prescaler
; desired PS<2:0> are
; 000 or 001
; Bank 0
; are required only if
; desired WDT rate
;Return to Bank 0
instruction
INTEDG
TRISA6
Bit 6
T0CS
Bit 5
T0IE
sequence
TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 11-1 1111 11-1 1111
T0SE
INTE
Bit 4
Preliminary
RBIE
Bit 3
PSA
To change prescaler from the WDT to the TMR0
module use the sequence shown in Example 6-2. This
precaution must be taken even if the WDT is disabled.
EXAMPLE 6-2:
CLRWDT
BSF
MOVLW
MOVWF
BCF
Bit 2
T0IF
PS2
STATUS, RP0
b'xxxx0xxx' ;Select TMR0, new
OPTION_REG
STATUS, RP0
Bit 1
INTF
PS1
CHANGING PRESCALER
(WDT TIMER0)
Bit 0
RBIF
PS0
PIC16F62X
;Clear WDT and
;prescaler
;prescale value and
;clock source
xxxx xxxx uuuu uuuu
0000 000x 0000 000u
1111 1111 1111 1111
Value on
POR
DS40300B-page 49
All Other
Value on
Resets

Related parts for PIC16F627-04