I try to make my 16f877a remember some variables by storing them in the Eprom. I think this is what ewrite/eread is meant to do.
The variables are mostly dwords. Once I change one of these variables my code is i.e.
freq2 = freq2 + step2
ewrite 0, [freq2]
freq2 is initialized as
dim freq2 as dword
and step2 as
Symbol step2 = 125
At startup, I then read the eprom with
freq2 = eread 0
Then I check if the value is out of my allowable range. If it is, I set it to a default value. The problem is, obviously no data is written to the eprom, as the default values are set each time at startup.
I also have a bit variable which I do try to ewrite/eread. I do read that one at startup as well, but do never set it to a default value. This one's not written either obviously as it is always 1 after startup.
What am I doing wrong?
Regards
Martin
Bookmarks