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

24LC512

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







24LC512
PostPosted: Tue Oct 09, 2007 5:59 pm     Reply with quote

Hello , I´m trying to use the eeprom 24LC512 for the first time , I´m using 24512.c driver . A wrote this code , but he´s only reading zero from the eeprom . Is the code right. Could some confirm me the connections of 24LC512 , pin A1 A2 A3 , Wp ,pullups etc
the code:
#define EEPROM_SDA PIN_B6
#define EEPROM_SCL PIN_B7

main()
{
long int i;
BYTE d;
BYTE data;
set_tris_b(0b11000000);

lcd_init();
init_ext_eeprom();
delay_us(100);

delay_ms(400);
data=1;

//wite eeprom eeprom
for(i=0;i<100;i++)
{
data=data+1;
write_ext_eeprom(i,data);
delay_us(10);

}


for(i=0;i<100;i++)
{
d=read_ext_eeprom(i);

printf(lcd_putc,"%u",d);


delay_ms(1000);
printf(lcd_putc,"\f");
delay_ms(1000);

/////
}



}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 09, 2007 6:13 pm     Reply with quote

See this thread for a link to a schematic. It's for a 24LC256, but the
pins are the same, and it shows how to connect them.
http://www.ccsinfo.com/forum/viewtopic.php?t=27461
dustimv



Joined: 18 Sep 2007
Posts: 4

View user's profile Send private message

PostPosted: Tue Oct 09, 2007 10:04 pm     Reply with quote

Please note on the schematic listed above, the pins are mirrored, due to the IC being placed on the back of the board.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 09, 2007 10:24 pm     Reply with quote

Quote:
due to the IC being placed on the back of the board.

That's not true.
Look at the photo of the board on page 7 of the manual:
http://ww1.microchip.com/downloads/en/DeviceDoc/51275b.pdf
The 24LC256 is in a circle labeled "14", and it's on the top side of the
board on the left side.

Here's a large photo of the PicDem2-Plus (non-Rohs version) that
I found on the net. The 24LC256 is U4.
http://www.units.it/~atmocube/presentazioni/galilei_07/picdem2plus.JPG
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