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

X modem receive handling

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








X modem receive handling
PostPosted: Fri Feb 10, 2006 12:05 am     Reply with quote

Hi

I am using Xmodem to read in a text file. The text file contains Max and Min values. I want to export the file from Excel. Once the file is read into the PIC, I need to extract the information and save to EEprom. I have never done this before. I would not even know where to start. The file will look like this:
Max Min
255 6
100 8

I have written the xmodem routine. The files is read into a RAM Buffer. I just don't know how to extract the string information and save it as unsigned int8 in EEprom.
Foe example , I need to find 255 and convert it to unsigned int8, then find 6 etc. Please could you offer some pointers and advice on the best way to do this. What functions does the compiler support to handle this? Confused
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 12, 2006 2:51 pm     Reply with quote

You want to know how to convert a buffer which contains ASCII Hex
values into 8-bit integer values.

To do this, you can use the atoi() function, or use the abbreviated
version of it, which is known as axtoi(). It only accepts ASCII Hex
characters as the input, instead of hex and decimal, so it's smaller.
http://www.ccsinfo.com/forum/viewtopic.php?p=679#679

Do you want to write the result to "data eeprom" inside the PIC
or to an external EEPROM chip ?

To access Data eeprom, you should use these CCS functions:
write_eeprom()
read_eeprom()
They are described in the CCS manual, which can be downloaded here:
http://www.ccsinfo.com/download.shtml#CompilerManual

To access an external EEPROM chip, you should use the appropriate
driver file for your chip. The driver files are in this folder:
c:\Program Files\Picc\Drivers
For example, if you're using a Microchip 24LC256 chip, then use
the 24256.C driver file.
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