Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
get_epp_val
movlw 2h
movwf EEADR
bsf status, 5 ; bank1
bsf EECON1, 0 ; read
bcf status, 5 ; bank0
movf EEDATA, w ; w = val from adr 2h
retlw 0
write_epp_val
movlw 2h
movwf EEADR ; EEADR = 2h
movlw 77h
movwf EEDATA ; EEDATA = 77h
bsf status, 5 ; bank1
bcf intcon, 7 ; int off
bsf EECON1, 2 ; enable write
movlw 55h
movwf EECON2
movlw 0AAh
movwf EECON2
bsf EECON1, 1 ; write NOW 77h @adr 2h
bsf INTCON, 7 ; int on
bcf status, 5 ; bank0
retlw 0
call get_epp_val
or
call write_epp_val
LIST p=16F88
include "P16F88.inc"
__config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF
errorlevel -302
Cblock 0x20
OLD,NEW
endc
banksel TRISA ;bank 1
movlw 0x42 ;1MHz clock
movwf OSCCON
goto start
read
banksel EEADR
movlw 2h
movwf EEADR
bsf STATUS, 5 ; bank1
bsf EECON1, 0 ; read
bcf STATUS, 5 ; bank0
movf EEDATA, w ; w = val from adr 2h
return
write
movlw 2h
movwf EEADR ; EEADR = 2h
movfw NEW
banksel EEDATA
movwf EEDATA
banksel EECON1
bsf STATUS, 5 ; bank1
bcf INTCON, 7 ; int off
bsf EECON1, 2 ; enable write
movlw 55h
movwf EECON2
movlw 0AAh
movwf EECON2
bsf EECON1, 1 ; write NOW 77h @adr 2h
bsf INTCON, 7 ; int on
bcf STATUS, 5 ; bank0
return
start
call read
banksel OLD
movwf OLD
incf OLD,f
movfw OLD
movwf NEW
call write
call read
goto start
end