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

Pic16f628 - 24c64 (eeprom)

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







Pic16f628 - 24c64 (eeprom)
PostPosted: Thu Nov 07, 2002 7:34 am     Reply with quote

Could anybody please help me with this problem of mine???
I want to read and write an eeprom....
the only thing appearing on my screen when reading the eeprom is alot of ff ff ff ff ff ff....

What is wrong???

Please help me...


void main (void){
long eeprom_adresse=0x0100;
int count;
byte tabell[16]="p12345678901234";
byte copy[16];

init_ext_eeprom();
lcd_init();

lcd_putc("EEPROM-test 1.1");
puts("Hello");
delay_ms(3000);
lcd_putc('\f');



write16_ext_eeprom(0x50, eeprom_adresse, tabell);
delay_ms(100);
read16_ext_eeprom(0x50,eeprom_adresse, kopi);
for(count=0;count<16;count++){
printf("\n\%x",copy[count]);
delay_ms(100);
}
}//end
___________________________
This message was ported from CCS's old forum
Original Post ID: 8647
Tomi
Guest







Re: Pic16f628 - 24c64 (eeprom)
PostPosted: Thu Nov 07, 2002 10:04 am     Reply with quote

I assume you are about 24C65 I2C EEPROM.
What are write16_ and read16_ functions (post the code)? (I think they are 16-byte block read/write functions but what is 0x50?)
In the line "read16_ext_eeprom(0x50,eeprom_adresse, kopi);" : is "kopi" a typo?



:=Could anybody please help me with this problem of mine???
:=I want to read and write an eeprom....
:=the only thing appearing on my screen when reading the eeprom is alot of ff ff ff ff ff ff....
:=
:=What is wrong???
:=
:=Please help me...
:=
:=
:=void main (void){
:=long eeprom_adresse=0x0100;
:=int count;
:=byte tabell[16]="p12345678901234";
:=byte copy[16];
:=
:=init_ext_eeprom();
:=lcd_init();
:=
:=lcd_putc("EEPROM-test 1.1");
:= puts("Hello");
:= delay_ms(3000);
:= lcd_putc('\f');
:=
:=
:=
:=write16_ext_eeprom(0x50, eeprom_adresse, tabell);
:=delay_ms(100);
:=read16_ext_eeprom(0x50,eeprom_adresse, kopi);
:= for(count=0;count<16;count++){
:= printf("\n\%x",copy[count]);
:= delay_ms(100);
:= }
:=}//end
___________________________
This message was ported from CCS's old forum
Original Post ID: 8653
oscar
Guest







Re: Pic16f628 - 24c64 (eeprom)
PostPosted: Fri Nov 08, 2002 12:30 pm     Reply with quote

First thing I noticed is that you have kopi instead of copy in this line:
read16_ext_eeprom(0x50,eeprom_adresse, kopi);
That might be the issue.
good luck.
Oscar

:=Could anybody please help me with this problem of mine???
:=I want to read and write an eeprom....
:=the only thing appearing on my screen when reading the eeprom is alot of ff ff ff ff ff ff....
:=
:=What is wrong???
:=
:=Please help me...
:=
:=
:=void main (void){
:=long eeprom_adresse=0x0100;
:=int count;
:=byte tabell[16]="p12345678901234";
:=byte copy[16];
:=
:=init_ext_eeprom();
:=lcd_init();
:=
:=lcd_putc("EEPROM-test 1.1");
:= puts("Hello");
:= delay_ms(3000);
:= lcd_putc('\f');
:=
:=
:=
:=write16_ext_eeprom(0x50, eeprom_adresse, tabell);
:=delay_ms(100);
:=read16_ext_eeprom(0x50,eeprom_adresse, kopi);
:= for(count=0;count<16;count++){
:= printf("\n\%x",copy[count]);
:= delay_ms(100);
:= }
:=}//end
___________________________
This message was ported from CCS's old forum
Original Post ID: 8697
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