newbie having trouble writing and reading to eprom
HBROWN
Posts: 2
Anyone please help.· I am currently using a AD592 to take temperature measurements and am getting adequate readings however when I go back to retrieve data prior data changes to more current data before I can retrieve it.· Any ideas????
Comments
My guess is that the PAUSE in the WriteMemory routine is killing you, timewise:
·WRITEMEMORY:
FOR LOCATION = 0 TO 2
LOW 0
PAUSE 5
RCTIME 0,0, RCT
TEMP=RCT
WRITE LOCATION, TEMP
PAUSE 5000· '<<
Change this PAUSE
NEXT
RETURN
I see no requirement for a PAUSE after a WRITE command in the PBASIC Help File, and if the wait is designed to PAUSE after the latest RCTIME command, it needn't be any longer than the others, presuming they are sufficiently long as they are presently coded. Therein, change the
PAUSE 5000
to (say)
PAUSE 500
or even something·less. That should add substantial speed to your progam. There are other possible areas where speed might be gained, but let's start there first to see if that gives you·the execution speed increase·you seem to be requesting.
You may also want to look carefully at:
WHAT you are storing in the various EEPROM locations,
WHERE you are storing it,
HOW you are storing it and·lastly,
WHY you are storing it when you are.
I have a sneaking suspicion that you're not doing what you think you are, although I certainly don't know from the program what the exact goal is. Remember also that a "wild" STORE can ruin your whole day by overwriting the USER PROGRAM AREA with USER DATA!
P.S. I'm not trying to nitpick, honestly. You may want to change your references to "Kalvin" to read "Kelvin" if it is Kelvin Termperature you're working with, just for understandability, and the future reference of others.
Regards,
Bruce Bates
Thanks,
heather
There are two Stamps in Class books with example programs you can try.· Both are available for download from www.parallax.com -> Downloads -> Stamps in Class Tutorials:·
Regards, Andy