PDA

View Full Version : Newbe how to save srtrings



MR2010
- 18th January 2010, 04:28
how to save string in eeprom ?
string ex: "hello world" and each time i get different string i want to save it


SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
B0 = B0 [ ARRAYVAR + 1] ?????
WRITE B0,ARRAYVAR

I NEED HELP I KNOW ITS WRONG THIS CODE THANKS
SORRY FOR MY EMGLISH

InitialDriveGTR
- 22nd January 2010, 16:55
Your code will only write to eeprom once.


SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
B0 = B0 [ ARRAYVAR + 1] ?????
WRITE B0,ARRAYVAR

try this maybe? Not sure if this works but should


index var byte
code_index var word
ArrayVar var byte[64]
code_index = 0
SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
for index = 1 to 64
WRITE code_index,ArrayVar[index]
code_index = code_index + 1
next

MR2010
- 24th January 2010, 01:16
Your code will only write to eeprom once.


SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
B0 = B0 [ ARRAYVAR + 1] ?????
WRITE B0,ARRAYVAR

try this maybe? Not sure if this works but should


index var byte
code_index var word
ArrayVar var byte[64]
code_index = 0
SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
for index = 1 to 64
WRITE code_index,ArrayVar[index]
code_index = code_index + 1
next


thank you DriveGTR for help i will try it and post result