this is my example code i cannot able to get the data on hyperterminal.....pls check the code
#use i2c(master, sda=PIN_C4, scl=PIN_C3)
#use rs232(baud=9600, xmit=pin_c6,rcv=pin_c7)
void main()
{
int data=0,data1=8;
output_b(0x00);
output_low(pin_c3);
output_high(pin_c4);
i2c_start();
output_low(pin_c2);
i2c_write(0x00);address to external eeprom
delay_ms(100);
i2c_write(8); data to the 0x00 th location
delay_ms(100);
data=i2c_read(0);
delay_ms(100);
i2c_stop();
while(1)
{
putc(data);
delay_ms(1000);
puts("hai");
output_b(data);
delay_ms(1000);
}
}
#use i2c(master, sda=PIN_C4, scl=PIN_C3)
#use rs232(baud=9600, xmit=pin_c6,rcv=pin_c7)
void main()
{
int data=0,data1=8;
output_b(0x00);
output_low(pin_c3);
output_high(pin_c4);
i2c_start();
output_low(pin_c2);
i2c_write(0x00);address to external eeprom
delay_ms(100);
i2c_write(8); data to the 0x00 th location
delay_ms(100);
data=i2c_read(0);
delay_ms(100);
i2c_stop();
while(1)
{
putc(data);
delay_ms(1000);
puts("hai");
output_b(data);
delay_ms(1000);
}
}