You need to log in to create posts and topics.

PIC16F887 EEPROM

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.

Hi.

I think it should work, can you share an example to reproduce the problem?

Hello,

Please find the zip file attached, with the circuit/ASM/HEX and modified config file for 16F887.

Thank you.

Uploaded files:

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.

Thank you very much. It works.