PIC16F887 EEPROM

Quote from desmondchan71 on May 16, 2025, 10:36 amHello,
I am working on handling the EEPROM of PIC16F887 (not PIC16F877). I copy the config of ROM of PIC16F88 (please see my previous work) to 887 but it crashes the simulator every time I run the code to read the EEPROM. The ROM config used in PIC16F88 works fine. I need more advice on the config. Thank you.
Hello,
I am working on handling the EEPROM of PIC16F887 (not PIC16F877). I copy the config of ROM of PIC16F88 (please see my previous work) to 887 but it crashes the simulator every time I run the code to read the EEPROM. The ROM config used in PIC16F88 works fine. I need more advice on the config. Thank you.


Quote from desmondchan71 on May 19, 2025, 1:15 pmHello,
Please find the zip file attached, with the circuit/ASM/HEX and modified config file for 16F887.
Thank you.
Hello,
Please find the zip file attached, with the circuit/ASM/HEX and modified config file for 16F887.
Thank you.
Uploaded files:
Quote from arcachofo on May 19, 2025, 3:25 pmThanks for the files.
Problem seems to be with EEPROM data register.Simulide expetcs an 8 bit register for EEPROM, so you can solve it like this (dataregs="EEDAT"):
<rom name="ROM" configregsA="EECON1" configregsB="EECON2" dataregs="EEDAT" addressreg="EEADR,EEADRH" interrupt="EEPR"/>
I didn't dive too much in the asm code, but seems that it is not writing to EPPROM, only reading, but I guess it should work as well.
Thanks for the files.
Problem seems to be with EEPROM data register.
Simulide expetcs an 8 bit register for EEPROM, so you can solve it like this (dataregs="EEDAT"):
<rom name="ROM" configregsA="EECON1" configregsB="EECON2"
dataregs="EEDAT"
addressreg="EEADR,EEADRH"
interrupt="EEPR"/>
I didn't dive too much in the asm code, but seems that it is not writing to EPPROM, only reading, but I guess it should work as well.

Quote from desmondchan71 on May 20, 2025, 10:49 amThank you very much. It works.
Thank you very much. It works.