Thank you all for reading my post,
I am, for the first time, using the eeprom on a PIC18F26K22 using assembly language. I am using the code examples used in the data sheet to try and save a value in to a location in eeprom and then read it back.
I first program the PIC with the "call write_eeprom" part of my program(see code below). I then reprogram the chip with the "write_eeprom" omitted so I am only reading that address and not writing to the eeprom (call read_eeprom).
After my reading of the eeprom I compare the value read to a literal value and light an LED accordingly. If I get a non match with my result I change the literal value to 'ff' and re-programm the "read" part of my program and the result was a match and the proper LED would light telling me that the eeprom did not hold the value I wanted after power was removed. I have my BOR activated in my config. settings and I have a one second delay at the beginning of the program before I do anything.
If I simulate this in MPLABX V 3.45, this will simulate fine. The only thing that I do different is I run the call write_eeprom and then continue on and do the call read_eeprom so it all runs as one code. I do not preserve the eeprom data during call write_eeprom, but I do preserve eeprom data during call read_eeprom programming. This is a check box in the properties window for the PM3 programmer that I am using.
Can anyone help me with understanding why I am unable to keep my value in the eeprom address after I program it?
Thank you,
Peaches
Mod edit: added paragraphs as suggested below.
I am, for the first time, using the eeprom on a PIC18F26K22 using assembly language. I am using the code examples used in the data sheet to try and save a value in to a location in eeprom and then read it back.
I first program the PIC with the "call write_eeprom" part of my program(see code below). I then reprogram the chip with the "write_eeprom" omitted so I am only reading that address and not writing to the eeprom (call read_eeprom).
After my reading of the eeprom I compare the value read to a literal value and light an LED accordingly. If I get a non match with my result I change the literal value to 'ff' and re-programm the "read" part of my program and the result was a match and the proper LED would light telling me that the eeprom did not hold the value I wanted after power was removed. I have my BOR activated in my config. settings and I have a one second delay at the beginning of the program before I do anything.
If I simulate this in MPLABX V 3.45, this will simulate fine. The only thing that I do different is I run the call write_eeprom and then continue on and do the call read_eeprom so it all runs as one code. I do not preserve the eeprom data during call write_eeprom, but I do preserve eeprom data during call read_eeprom programming. This is a check box in the properties window for the PM3 programmer that I am using.
Can anyone help me with understanding why I am unable to keep my value in the eeprom address after I program it?
Thank you,
Peaches
Mod edit: added paragraphs as suggested below.
Attachments
-
8.3 KB Views: 15
Last edited by a moderator: