Exo
Active Member
Hi,
I found a bug in MPLAB 7.41's simulator regarding the internal data eeprom
when you are performing interrupt based eeprom writing. (start write - do something else - on interrupt start write of next byte - do something else - ...)
On a real pic, when you start an eeprom write to adress X, then already change the address for the next write (for example , INCF EEADR, to have it ready for the next byte to be written) you will find that when the write completes and the eeprom interrupt flag is set (PIR2<EEIF>) the eeprom address register (EEADR) is back to value X.
However , in the MPLAB sim this isn't the case, When the write completes EEADR is unaffected.
I'm just sharing this because i spent 3 hours finding an 'error' in my code wich didn't work for real but did fine in the MPLAB sim.
EDIT: PIC16F in this case, i don't know about PIC18F's behaviour
I found a bug in MPLAB 7.41's simulator regarding the internal data eeprom
when you are performing interrupt based eeprom writing. (start write - do something else - on interrupt start write of next byte - do something else - ...)
On a real pic, when you start an eeprom write to adress X, then already change the address for the next write (for example , INCF EEADR, to have it ready for the next byte to be written) you will find that when the write completes and the eeprom interrupt flag is set (PIR2<EEIF>) the eeprom address register (EEADR) is back to value X.
However , in the MPLAB sim this isn't the case, When the write completes EEADR is unaffected.
I'm just sharing this because i spent 3 hours finding an 'error' in my code wich didn't work for real but did fine in the MPLAB sim.
EDIT: PIC16F in this case, i don't know about PIC18F's behaviour