Sudhp
Member level 4
M working on a project having micro controller 89s52.
In this i have to store names up to 20.
m using 24c16 EEPROM for this....
The prblm is that the data of case 16 get overlap to ist position..
and 17th position with 2....and so on.
plz help me......
In this i have to store names up to 20.
m using 24c16 EEPROM for this....
HTML:
void Save_name()
{
start();
send_byte(0xA0);
aknowledge();
switch(nam)
{
case 0: send_byte(0x00);break;
case 1: send_byte(0x10);break;
.
.
.
case 15: send_byte(0xf0);break;
case 16: send_byte(0x100);break;
case 17: send_byte(0x110);break;
case 18: send_byte(0x120);break;
case 19: send_byte(0x130);break;
case 20: send_byte(0x140);break;
}
aknowledge();
for(i=1;i<16;i++)
{
send_byte(name[i]);aknowledge();
}
stop();
delay_ms(20);
}
void Read_name()
{
start();
send_byte(0xA0);
aknowledge();
switch(nam)
{
case 0: send_byte(0x00);break;
case 1: send_byte(0x10);break;
case 2: send_byte(0x20);break;
.
.
.
case 15: send_byte(0xf0);break;
case 16: send_byte(0x100);break;
case 17: send_byte(0x110);break;
case 18: send_byte(0x120);break;
case 19: send_byte(0x130);break;
case 20: send_byte(0x140);break;
}
aknowledge();
start();
send_byte(0xA1);
aknowledge();
for(i=1;i<16;i++)
{
name[i]=read_byte();aknowledge();
}
stop();
delay_ms(10);
}
The prblm is that the data of case 16 get overlap to ist position..
and 17th position with 2....and so on.
plz help me......