Anthony Nixon
2017-10-08 03:55:51 UTC
Hi all,
Still pulling my hair out with this chip.
After 24 hours, no matter what I try, I cannot read/write to internal
EEPROM. I have disabled all available code protection in fuses
including the EEPROM and have followed the data sheet as it says but
all I get back from a read is 0x00 which sort of suggests there is
some protection mechanism I am unaware of, or a fuse bit is being
programmed incorrectly.
More frustratingly, MPLABX reads/writes the EEPROM perfectly.
All used RAM registers are in ACCESS RAM space
;
; --------------------------------
; SUBROUTINE: READ INTERNAL EEPROM - 18F47K40
; --------------------------------
; HI addr in intEEPH, LO addr in intEEPL
RDeeprom movlb 0h ; probably not required
bcf NVMCON1,NVMREG0,A ; Setup Data EEPROM Access
bcf NVMCON1,NVMREG1,A ; Setup Data EEPROM Access
movf intEEPL,W,A
movwf NVMADRL,A ; Setup Address low byte
movf intEEPH,W,A
movwf NVMADRH,A ; Setup Address high byte
bsf NVMCON1,RD ; Issue EE Read
movf NVMDAT,W,A ; W = EE_DATA
return
The PICkit 3 programs/verifies and reads back the eeprom data ok, but
I cannot read the data internally. If I write to EEPROM, nothing
happens also, even after the PICkit reads back.
I have tried on different brand new chips but no joy.
The code is running as I have a 15 digit multiplexed display which
shows data correctly and talks to the PC via USB/serial port no
problem
Any ideas :-)
cheers
Tony
Still pulling my hair out with this chip.
After 24 hours, no matter what I try, I cannot read/write to internal
EEPROM. I have disabled all available code protection in fuses
including the EEPROM and have followed the data sheet as it says but
all I get back from a read is 0x00 which sort of suggests there is
some protection mechanism I am unaware of, or a fuse bit is being
programmed incorrectly.
More frustratingly, MPLABX reads/writes the EEPROM perfectly.
All used RAM registers are in ACCESS RAM space
;
; --------------------------------
; SUBROUTINE: READ INTERNAL EEPROM - 18F47K40
; --------------------------------
; HI addr in intEEPH, LO addr in intEEPL
RDeeprom movlb 0h ; probably not required
bcf NVMCON1,NVMREG0,A ; Setup Data EEPROM Access
bcf NVMCON1,NVMREG1,A ; Setup Data EEPROM Access
movf intEEPL,W,A
movwf NVMADRL,A ; Setup Address low byte
movf intEEPH,W,A
movwf NVMADRH,A ; Setup Address high byte
bsf NVMCON1,RD ; Issue EE Read
movf NVMDAT,W,A ; W = EE_DATA
return
The PICkit 3 programs/verifies and reads back the eeprom data ok, but
I cannot read the data internally. If I write to EEPROM, nothing
happens also, even after the PICkit reads back.
I have tried on different brand new chips but no joy.
The code is running as I have a 15 digit multiplexed display which
shows data correctly and talks to the PC via USB/serial port no
problem
Any ideas :-)
cheers
Tony
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist