EEPROM command for storing Word data

pmolsen

Senior Member
Is there any way to use the EEPROM statement to store word data rather than having to manually convert each byte to hex and back etc? Like the WORD option in Read and Write?
 

Technical

Technical Support
Staff member
symbol word1 = 12345
symbol word2 = 23456
symbol word3 = 34567

symbol top1 = word1 / 256
symbol top2 = word2 / 256
symbol top3 = word3 / 256

eeprom 0,(word1,top1,word2,top2,word3,top3)
 

westaust55

Moderator
@Technical,

Would it be possible for Rev Ed to add that fact, that is, the ability to use the WORD keyword with the EEPROM/DATA commands in the PICAXE Manual 2.
It is discussed for the READ and WRITE commands but not EEPROM and DATA (page 49 in V6.9)
Takes away the assumption it may work, and/or the need to search the forum or ask here.
 
Last edited:

Technical

Technical Support
Staff member
Why we would say it is possible to use the WORD keyword when it is not...!!!

But we could add this example of how to workaround.
 

westaust55

Moderator
Ah yes.
I was not reading your example correctly :eek:
reading in hast, saw:
eeprom 0,(word1,top1,word2,top2,word3,top3)
as:
eeprom 0,(word top1,word top2, word top3)

now where are those specs :cool:
 

Technical

Technical Support
Staff member
You can only store byte data - so 512 is not 512, it is 0

In binary 512 is %10 00000000
The 'value' that actually gets saved is the lower 8 bits... %00000000
 
Top