PDA

View Full Version : EWrite/ERead problem



atlantis
- 16th January 2007, 15:47
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

skimask
- 16th January 2007, 17:31
What am I doing wrong?

Regards
Martin

Posting in the wrong forum?

keithdoxey
- 16th January 2007, 18:29
Posting in the wrong forum?


Nope..

He is posting in the right forum, just using the wrong language LOL

If he wants to continue using the wrong language then he should pop over to the wrong forum where they know about that stuff or learn the right language :D

skimask
- 16th January 2007, 18:36
Nope..

He is posting in the right forum, just using the wrong language LOL

If he wants to continue using the wrong language then he should pop over to the wrong forum where they know about that stuff or learn the right language :D

Well, heck if we're gonna go there...who's to say what's right and what's wrong !

atlantis
- 16th January 2007, 21:12
Well guys tell me what you think the right language and the right forum for it is.

skimask
- 16th January 2007, 21:39
Well guys tell me what you think the right language and the right forum for it is.

The right language (or in this case, compiler) is your choice, the right forum for whatever you are using at the moment is not this one.

BigWumpus
- 17th January 2007, 20:53
Well guys tell me what you think the right language and the right forum for it is.

Tell you, what is the name of your compiler ?