grasshopper
01-22-2009, 11:37 PM
I noticed that the BS2 Object contains 3 types of write / reads. Could someone clarify the differences that each one offers.
Write(Addr,Value, size)
Write to EEPROM in code space, from top (32767) to bottom (0)
where 0 = top of memory
Write_HighMem(Addr,Value, size)
Write to upper 32K of 64K EEPROM
Write_HighMem(0,myVal,2) ' write byte variable myVal to upper 32K lowest address
Write_CodeMem(Addr,Value, size)
Write to direct code memory
Useful in having a variable survive a reset
From what I see Write just starts storing data from the top. Is this so that one wont over write the stack?
The other 2 methods I am not clear on. Currently I am using the Write_HighMem and it seems to work. I just want to learn more.
Write(Addr,Value, size)
Write to EEPROM in code space, from top (32767) to bottom (0)
where 0 = top of memory
Write_HighMem(Addr,Value, size)
Write to upper 32K of 64K EEPROM
Write_HighMem(0,myVal,2) ' write byte variable myVal to upper 32K lowest address
Write_CodeMem(Addr,Value, size)
Write to direct code memory
Useful in having a variable survive a reset
From what I see Write just starts storing data from the top. Is this so that one wont over write the stack?
The other 2 methods I am not clear on. Currently I am using the Write_HighMem and it seems to work. I just want to learn more.