I'm fairly sure that you have to shut off ALL interrupts while trying to write to eeprom or flash, not just DISABLE interrupts. You actually have to disable the global interrupt enable flag, then reenable it when the write is done.
I'm fairly sure that you have to shut off ALL interrupts while trying to write to eeprom or flash, not just DISABLE interrupts. You actually have to disable the global interrupt enable flag, then reenable it when the write is done.
mm, seems the ISR is too long anyways... can you post your whole code and tell which PIC you're using?
Not sure if it's a good idea to write to a EEPROM in a USART ISR.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
[I am using a 16F877A at 20MHz
I use timer1 to check the dip switch settings for the device's address and the UASRT one for data in.
Sorry for using attachment, my code was too long for the forum page
Isolate the problem...
Start with a program without any serial input or output, no nothing, just a couple of LEDs and maybe a button or two.
Write and Read the EEPROM and make the LEDs show you if the write/read works correctly or not, use the buttons to increment the addresses and data to be written.
Something tells me that something else in your program isn't working right in the first place, making you think that the EEPROM isn't being written correctly...
Maybe PBP work for you...not the other way around...
Hi everyone!
I can read and write now using the pic16f84a but I can't do that using pic16f877a.
Is there any lines I have to add inorder to allow reading and writing the eeprom?
I've read the 16f877a datasheet. It is stated there that I have to disable all interrupts before writing. I've tried that but still won't work.
A working simple code for reading and writing the internal eeprom of pic16f877a is all I need.
Please help me...
Thank you in advance.
Bookmarks