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

Help on this...

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



Joined: 07 Sep 2003
Posts: 51

View user's profile Send private message Yahoo Messenger

Help on this...
PostPosted: Tue Sep 09, 2003 6:24 pm     Reply with quote

Mabuhay!

How can I input a hex to an eeprom? do i have to use the get_hex() function?

please provide me a sample code snippet.

thanx
Charlie U
Guest







PostPosted: Tue Sep 09, 2003 9:36 pm     Reply with quote

:?:

Can you give us a clue as to what type of EEPROM you are interested in??

There are several types: first is internal EEPROM on your chip (which chip are you using?!?!), next is external EEPROM, and again what type; I2C serial or SPI serial?
Guest








PostPosted: Tue Sep 09, 2003 11:40 pm     Reply with quote

Charlie U wrote:
:?:

Can you give us a clue as to what type of EEPROM you are interested in??

There are several types: first is internal EEPROM on your chip (which chip are you using?!?!), next is external EEPROM, and again what type; I2C serial or SPI serial?


EEPROM type is 24LC256 or FM24C256
target chip: PIC18452
protocol: I2C

Thanx
ttelmah
Guest







Re: Help on this...
PostPosted: Wed Sep 10, 2003 8:08 am     Reply with quote

rrb011270 wrote:
Mabuhay!

How can I input a hex to an eeprom? do i have to use the get_hex() function?

please provide me a sample code snippet.

thanx

I think you need to get clear in your mind, what you actually want to do.
'Hex', is a way of representing numerical values, using conventional 'text' characters.
So, the number decimal '77', can be represented by the hex code '4D', but if stored into a single byte, displays as the ASCII character 'M'., and is held internally as the binary value '00101101'.
Now the EEPROM, stores numbers. If you have a value arriving in hex, and use the existing input functions to read this into a single byte, this byte can simply be stored to the EEPROM as a number (at this point, 'hex' doesn't come into it at all...). The code 'gethex', is a simple routine contained in one of the driver files, to convert an incoming ASCII 'hex' string, into it's numeric form. If you have a value arriving in text, and need to convert this to numeric, this is a good starting place, but has nothing to do with storing numbers in the EEPROM.
If you need to actually store an internal number, in hex, then the SPRINTF function, allows a value to be converted to the ASCII representation, and the resulting text string, could then be sent to the EEPROM, one character at a time.

Best Wishes
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