English
Language : 

PIC16LF819-I Datasheet, PDF (57/176 Pages) Microchip Technology – Enhanced Flash Microcontrollers with nanoWatt Technology
PIC16F818/819
EXAMPLE 6-1: CHANGING THE PRESCALER ASSIGNMENT FROM TIMER0 TO WDT
BANKSEL
MOVLW
MOVWF
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
CLRWDT
MOVLW
MOVWF
OPTION_REG
b'xx0x0xxx'
OPTION_REG
TMR0
TMR0
OPTION_REG
b'xxxx1xxx'
OPTION_REG
b'xxxx1xxx'
OPTION_REG
; Select Bank of OPTION_REG
; Select clock source and prescale value of
; other than 1:1
; Select Bank of TMR0
; Clear TMR0 and prescaler
; Select Bank of OPTION_REG
; Select WDT, do not change prescale value
; Clears WDT and prescaler
; Select new prescale value and WDT
EXAMPLE 6-2: CHANGING THE PRESCALER ASSIGNMENT FROM WDT TO TIMER0
CLRWDT
BANKSEL
MOVLW
MOVWF
OPTION_REG
b'xxxx0xxx'
OPTION_REG
; Clear WDT and prescaler
; Select Bank of OPTION_REG
; Select TMR0, new prescale
; value and clock source
TABLE 6-1: REGISTERS ASSOCIATED WITH TIMER0
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4 Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
01h,101h TMR0
0Bh,8Bh, INTCON
10Bh,18Bh
Timer0 Module Register
xxxx xxxx uuuu uuuu
GIE
PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
81h,181h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
Legend: x = unknown, u = unchanged, - = unimplemented locations read as ‘0’. Shaded cells are not used by Timer0.
 2004 Microchip Technology Inc.
DS39598E-page 55