![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Christian Bech Guest
|
Pic16f628 - 24c64 (eeprom) |
Posted: Thu Nov 07, 2002 7:34 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Tomi Guest
|
Re: Pic16f628 - 24c64 (eeprom) |
Posted: Thu Nov 07, 2002 10:04 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
oscar Guest
|
Re: Pic16f628 - 24c64 (eeprom) |
Posted: Fri Nov 08, 2002 12:30 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|