View previous topic :: View next topic |
Author |
Message |
hubble
Joined: 11 Dec 2006 Posts: 10
|
Fill EEPROM memory from usart |
Posted: Thu Jun 12, 2008 12:42 pm |
|
|
Hi.
How I can fill whole memory from usart?
If I use follow code,
...
int8 sText[xx], where xx not more 80 (in my example)
...
...
void main()
{
int8 value;
int8 i;
while(true){
if(kbhit()){
gets(sText);
lenght=strlen(sText);
for(i=0;i<lenght;i++0
write_eeprom(i,sText[i])
}
}
}
...
...
then I can`t fill whole EEPROM memory. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 12, 2008 2:37 pm |
|
|
This post has links to code that provide work-arrounds for the array size
limitations of the 16F-series PICs:
http://www.ccsinfo.com/forum/viewtopic.php?t=30456&start=4
With those routines, you can't use gets(), because it expects a
continuous array.
You will need to get the characters individually, in a loop, and write
each one to ram by calling one of the routines shown in the link.
You will need to look for the termination character (carriage return)
to indicate that you should exit from the loop.
When you are done getting the data, you can read the "big array"
by using one of the routines shown in the link, and write the chars
to the eeprom. |
|
|
hubble
Joined: 11 Dec 2006 Posts: 10
|
hubble |
Posted: Tue Jun 17, 2008 11:22 am |
|
|
Thank you for answer. |
|
|
|