Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/18/04 07:35
Read: times


 
#81431 - I2C with P89C668
Hello ,

I need some help on using P89C668HBA with a 24C512 EEPROM.
I am trying it with the I2C interface with the code as mentioned by ESAcademy at the following link:

http://www.esacademy.com/faq/progs/i2c.htm

This code is meant for P8x554. Is the I2C implementation on this different from 89c668 ?
The datasheet for
89c668 mentions that it is the same as in 8x552.

I am trying the following :

eeprom_write_byte(0x00,0x51); // Ascii character "Q"
delay_ms(100);
recd = eeprom_read_byte(0x00);
printf("n char is %c",recd);

The interrupt routine shows the following statii :
for write byte
case 0x08:
case 0x18:
case 0x28:
case 0x28:
case 0x28:

for read byte
case 0x08:
case 0x18:
case 0x28:
case 0x28:
case 0x10:
case 0x40:
case 0x58:
I am using a compiler which does not support enum so I had to make some changes by using
#define instead.
As far as I can see the interrupt sequence is running through fine. I have got the above sequence by inserting debug printf statements and disabling the timer T0. I have also tried after removing all the printf statements and enabling the T0 timer.
I am not using the statements :
P1M1 |= 0xC0; // set P1.6 and P1.7 open drain
P1M2 |= 0xC0;
The value getting returned is junk. I tried changing the read address position , so the junk character changes indicating that a new address is being read ???
Anyone can throw some ideas after a cursory look on the above ?

Thanks for reading my post
Thomas


List of 6 messages in thread
TopicAuthorDate
I2C with P89C668            01/01/70 00:00      
   codearchitect            01/01/70 00:00      
      668 I2C with EEPROM            01/01/70 00:00      
         speed and pullup            01/01/70 00:00      
   speed / pull up            01/01/70 00:00      
   problem solved            01/01/70 00:00      

Back to Subject List