I spent quite some time trying to be able to write data to EEPROM, but no matter what I did it wouldn't work. Even when I copied the exact same code the book provides, it didn't do anything. I emailed Prof. Emami about it today and this is his response:
*************
Hi Andrew, the reason why it doesn't write to the EEPROM is that you do not disable the EEPROM write mode at the end.Also the EEPROM write interrupt flag must be cleared. (These lines are dropped in the textbook by mistake.) Try the following code and let me know if it works:
Comment
Tip: when using this code, the registers VALUE and ADDR may not work if you declared them with cblock. I just spent 40 minutes debugging, and for some reason, using udata works while cblock 0x20 doesn't do anything. Interestingly, cblock 0x70 does work, but that's a bad idea for other reasons.
Hi andrew thanks for this.
It really helped :)
© 2024 Created by PML. Powered by
You need to be a member of Personal Mechatronics Lab to add comments!
Join Personal Mechatronics Lab