lilrex
- 64
- 0
I hope I am putting this in the right forum (it is Hardware and Software)but here it goes.
I am having a problem with my PIC18F1220 keeping its EEPROM settings. it has thrown me for a loop for a while. Here is how it goes.
In simulation it works perfectly,
When running for the first time it loads default settings by detecting the presents of settings within the EEPROM
There after you load your settings Via. RS232 it places them in the EEPROM the EEPROM is then referenced every time the board is turned on.
Global variables are referenced and set when ever you communicate the settings as a "working" table independent from the EEPROM and are used for program operation.
What happens in real life is:
It does not load default settings on the first start up
it will set the working table as can be verified by the RS-232 com. but the program will not use them for program operation I.E. the Duty Cycle will show changed but the board will not use the new settings and the EEPROM will not be updated with the new settings.
A problem with my program you say? (of course!)
But here is the kicker!
if you program the PIC and then read the EEPROM from the programmer the first time it will show blank "all FFs" but if you load it the second time it will show that the internal (load default) subroutine has worked.
And on top of that. It all works perfectly after that!
I don’t get it! Its simple you just program it and run it and it does not work! You read the EEPROM two times and it Works exactly as it was designed!
if you mess with the power (brown outs) rapid on-off on-off cycles it will loose the EEPROM settings and you will have to re read the EEPROM twice to get it to work again.
I tried resetting with /MCLR but to no avail!
Has anyone else had this problem? ANY help will be greatly appreciated!
If you have an idea and want to see part of the code I will be happy to post it!
Thank you.
I am having a problem with my PIC18F1220 keeping its EEPROM settings. it has thrown me for a loop for a while. Here is how it goes.
In simulation it works perfectly,
When running for the first time it loads default settings by detecting the presents of settings within the EEPROM
There after you load your settings Via. RS232 it places them in the EEPROM the EEPROM is then referenced every time the board is turned on.
Global variables are referenced and set when ever you communicate the settings as a "working" table independent from the EEPROM and are used for program operation.
What happens in real life is:
It does not load default settings on the first start up
it will set the working table as can be verified by the RS-232 com. but the program will not use them for program operation I.E. the Duty Cycle will show changed but the board will not use the new settings and the EEPROM will not be updated with the new settings.
A problem with my program you say? (of course!)
But here is the kicker!
if you program the PIC and then read the EEPROM from the programmer the first time it will show blank "all FFs" but if you load it the second time it will show that the internal (load default) subroutine has worked.
And on top of that. It all works perfectly after that!
I don’t get it! Its simple you just program it and run it and it does not work! You read the EEPROM two times and it Works exactly as it was designed!
if you mess with the power (brown outs) rapid on-off on-off cycles it will loose the EEPROM settings and you will have to re read the EEPROM twice to get it to work again.
I tried resetting with /MCLR but to no avail!
Has anyone else had this problem? ANY help will be greatly appreciated!
If you have an idea and want to see part of the code I will be happy to post it!
Thank you.