CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Fill EEPROM memory from usart

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hubble



Joined: 11 Dec 2006
Posts: 10

View user's profile Send private message Send e-mail

Fill EEPROM memory from usart
PostPosted: Thu Jun 12, 2008 12:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jun 12, 2008 2:37 pm     Reply with quote

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

View user's profile Send private message Send e-mail

hubble
PostPosted: Tue Jun 17, 2008 11:22 am     Reply with quote

Thank you for answer.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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