|
|
View previous topic :: View next topic |
Author |
Message |
vardhan Guest
|
Reading eeprom to a pointer with separator |
Posted: Fri Jan 15, 2010 12:24 am |
|
|
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
|
|
Posted: Fri Jan 15, 2010 1:39 pm |
|
|
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
|
|
Posted: Fri Jan 15, 2010 10:44 pm |
|
|
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
|
|
Posted: Sat Jan 16, 2010 3:05 am |
|
|
How about using printf()? |
|
|
vardhan Guest
|
|
Posted: Sun Jan 17, 2010 11:12 pm |
|
|
hi,
its using fprintf... |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Jan 18, 2010 1:14 am |
|
|
Quote: | its using fprintf... |
So what you've actually been asking for? |
|
|
|
|
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
|