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

EEPROM / PIC newbie question

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








EEPROM / PIC newbie question
PostPosted: Wed Jun 15, 2005 10:18 am     Reply with quote

EEPROM Block and Address
Posted: Wed Jun 15, 2005 7:43 am

--------------------------------------------------------------------------------
*** THIS IS FROM OTHER POST THREAD *** PCM recommand to use a
new thread, I post it here, these 2 post are mine, I guess you know what exactly information I want, any suggestion is welcome 'cause I am new to EEPROM and PIC *********


Sorry for the basic question but I need some explaination..

I am new to EEPROM and PIC, after I read the previous post and some datasheet for 24LC01B and 24LC256 with I2C interface. The control byte or the device address always be 1010 for eeprom. Example the 24LC01 is a 1Kbit device.

The questions I have are,
1. How do I identify the block?
2. How do I identify the word address? (starting address like 0x00, 0x01, or what?)
3. How many blocks and how many word can it stores? Code:

Code:
void write_ext_eeprom(BYTE address, BYTE data) {
   while(!ext_eeprom_ready());
   i2c_start();
   i2c_write(0xa0);
   i2c_write(address);  == > ??? what address do I need to start with?????
   i2c_write(data);
   i2c_stop();
}


BYTE read_ext_eeprom(BYTE address) {
   BYTE data;

   while(!ext_eeprom_ready());
   i2c_start();
   i2c_write(0xa0);
   i2c_write(address);   == >    ??? what address do I need to start with?????

   i2c_start();
   i2c_write(0xa1);
   data=i2c_read(0);
   i2c_stop();
   return(data);
}

I couldn't find the information on the 24LC01, 24LC256 datasheet.

Thanks
Guest








PostPosted: Wed Jun 15, 2005 10:20 am     Reply with quote

How to use EEPROM with PIC
Posted: Wed Jun 15, 2005 10:12 am

--------------------------------------------------------------------------------

Sorry for the newbie question, but I need help to understand the EEPROM and PIC Communication.

I am new to PIC and EEPROM, after I read datasheet for 24LC32 and I have the following questions, I couldn't find answer from the datasheet.

Questions:


Quote:
1. How to use the A2, A1, A0
Let say if I use 3 of 24C32 device connect to the same I2C bus,
How do I config the A2-A0?


2. How to translate(mapping) from 4096 bytes to address 0x0000-0x0fff
and how to use the address ( example, how many word can I store in the
4096 bytes memory, and if I want to store the adc result (255 or 0xFF) to
the 4096 bytes memory, how do I store it and what is the starting
address? How much memory does the 255 use from the memory? How do
I know the next address to use if I want to store more data in to the
EEPROM.
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