|
|
View previous topic :: View next topic |
Author |
Message |
memoally
Joined: 25 Jan 2010 Posts: 35
|
How can I write a string on eeprom? |
Posted: Mon Feb 22, 2010 12:51 pm |
|
|
Hi everyone. I want to write a string on eeprom, then print that data on
an lcd, but I dont know how to do. I want to write:
also combinations like this. But these writings are not variables, only
writings for several cases. (e.g if x=1 print M929 , if x=2 print M939....).
Should the data to be written on eeprom be variables? I tried to use:
Code: |
lcd_init();
lcd_gotoxy(1,1);
write_eeprom(0, M929);
printf(lcd_putc, read_eeprom(0));
lcd_gotoxy(6,1);
write_eeprom(1, y-4/1);
printf(lcd_putc, read_eeprom(1));
lcd_gotoxy(1,2);
write_eeprom(2, B:||||);
printf(lcd_putc, read_eeprom(2));
|
But it does not work. Can anyone correct me or give me an advice to
write a string on eeprom and that shows it on an lcd. If there is an
example code, please share with me.
There is also one more question, I don't know how many bytes are used
by a string. I have 20 writings like above and I use 16f876 which has 256
bytes eeprom. Is this memory enough for this job? _________________ compiler version: 4.105
pic: 16f876
clock frequency: 4MHz |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 22, 2010 4:51 pm |
|
|
Do you need to write to the eeprom at run-time with write_eeprom()
(as shown in your code) ? If so, this thread has sample code:
http://www.ccsinfo.com/forum/viewtopic.php?t=29309
Or, do you only need to put the strings into eeprom when the PIC is
programmed by the ICD programmer ? Then you can use the #rom
statement to put the strings into eeprom. |
|
|
memoally
Joined: 25 Jan 2010 Posts: 35
|
|
Posted: Tue Feb 23, 2010 4:47 pm |
|
|
Sorry for late answer and also thank you, pcm programmer. It was not mandatory to use eeprom but I think it was the best choice for the work. Anyway, I solved the problem by using alternative ways Thank you again... _________________ compiler version: 4.105
pic: 16f876
clock frequency: 4MHz |
|
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|