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 CCS Technical Support

Reading eeprom to a pointer with separator

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







Reading eeprom to a pointer with separator
PostPosted: Fri Jan 15, 2010 12:24 am     Reply with quote

Hi friends,

I stored a few values to the eeprom, now I need to retrieve them with a separator (,) and then move into buffer or pointer. Please any idea or sample code.

Retrieved data
ex:- 1248,5681234567,156,20,89564,12357,247,.....
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 15, 2010 1:39 pm     Reply with quote

Is this always ASCII numeric data ? Is there any text data ?

What do you want to do with the data ? Do you simply want to
parse it out into separate arrays, storing the ASCII data ?
Do you want to make it into ASCII strings ?
Or do you want to convert the data into binary integers, such as 'int32' ?

Does the data in the eeprom have the comma separators in it ?
Or did you add those later ?

Are there any separators in the eeprom other than a comma ?
Does it contain '$' or CR, LF, etc. ?

Does the data always consist of positive integers ?

Your example shows 7 values. Is it always 7 values ?
If not, what is the maximum number of values that may be in the eeprom ?

Does each field always have the same maximum size ?
Your data shows some 8bit, some 16bit, and some 32 bit.
Are the fields always in the same order, with the same maximum size ?

What PIC are you using ?


-- It probably would be a lot easier if you would say where this data
comes from and what you want to do with it.
vardhan
Guest







PostPosted: Fri Jan 15, 2010 10:44 pm     Reply with quote

Hi PCM,

The data always consists fixed size, values of int8, int16, int32 and float, no text data and always holds positive integer.

I just want to parse the retrieved data with a separator (,) and send it thru serial port from PIC16f877A to other PIC.

The eeprom will not have any separator. After retrieving I have to put a separator.

Only separator (,) is allowed.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Jan 16, 2010 3:05 am     Reply with quote

How about using printf()?
vardhan
Guest







PostPosted: Sun Jan 17, 2010 11:12 pm     Reply with quote

hi,

its using fprintf...
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Jan 18, 2010 1:14 am     Reply with quote

Quote:
its using fprintf...

So what you've actually been asking for?
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