Hi
Does anyone have working code to write a word to the EEPROM on a PIC 12F675 and read it back again ? My basic code is as follows:
ADCIN 0, value
Pause 25
write 0, value.byte0
write 0, value.byte1
This seems to be compiled into asm in the list file exactly as the datasheet describes, but does not seem to work correctly. ie: the value is not retained on power cycle.
Compiled asm:
bsf STATUS, RP0
movwf EEDATA
bsf EECON1, WREN
movlw 55h
movwf EECON2
movlw 0AAh
movwf EECON2
bsf EECON1, WR
wrlp btfsc EECON1, WR
goto wrlp
Anyone have any ideas ? Thanks !
-Richard
Does anyone have working code to write a word to the EEPROM on a PIC 12F675 and read it back again ? My basic code is as follows:
ADCIN 0, value
Pause 25
write 0, value.byte0
write 0, value.byte1
This seems to be compiled into asm in the list file exactly as the datasheet describes, but does not seem to work correctly. ie: the value is not retained on power cycle.
Compiled asm:
bsf STATUS, RP0
movwf EEDATA
bsf EECON1, WREN
movlw 55h
movwf EECON2
movlw 0AAh
movwf EECON2
bsf EECON1, WR
wrlp btfsc EECON1, WR
goto wrlp
Anyone have any ideas ? Thanks !
-Richard