Posted: Thu Oct 21, 2021 9:35 am Post subject: EEProm problem
Hi.
Have a strange problem. Need to set some default values in EEprom, but one byte is failing.
I'm doing this;
zb=0
xi=50
Writeeeprom zb,xi '"0" Key OFF
incr xi
zb=1
Writeeeprom zb,xi '"1" Key On Board
incr xi
Writeeeprom zb,xi '"1" Key On Route
incr xi
zb=0
Writeeeprom zb,xi '"0" Key On Shore
incr xi
zb=20
Writeeeprom zb,xi '"20" Current limit at 20A
incr xi
zb=1
Writeeeprom zb,xi '"1" Limit type Normal
incr xi
zb=1
Writeeeprom zb,xi '"1" Lock down
I then read back the content of the EEprom, both with the programmer, and in my program, everything is fine, except the line Limit Type Normal.. There I read the hex byte 31 which is 49 des. and asc 1.
WHY, WHY???
Anybody encountered something like this??
Using Bascom 2.0.8.4 with ATMEGA2560. Programming with Arduino STK500V2.
I use a Eram Array for such variables.
This makes it easy to read the default as it is a variable.
If you are use to Arduino code you have to read more of Bascom's help
because Bascom does a lot of the work for you it has very powerful functions
that Arduino does not , two of note are the Split function and the Overlay
I have been programming ESP8266 with Arduino and with what I can
do with one command in Bascom takes a dozen lines of code with Arduino
RegardsPaul
Code:
Dim Defaults(10)AsEramByte Dim A AsByte Dim B AsByte
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum