I'm back on my I2C problems since I was pulled off the project for a month or so. I'm still having some problems. The problem I thought was I was trying to address a 5V RAM instead of a 3.3V RAM. I have now a couple of ATMEL 256K serial RAM - 2.7V to 5V. I am still having trouble with understanding the status of the I2C bus. It appears I am getting the correct status, but even when the RAM is disconnected. I 'assume' from the status that those come from the I2C bus (LPC) and not the RAM chip itself. How do I know that the RAM has sent back an ACK? Does the new status on the bus indicate that it has? Here is how my code looks based on writing a 0x77 and reading back from an arbitrary address (0x01FFF): I2C0CONSET = 0x20; // Issue Start (status responds with 0x08) I2C0DAT = 0xA1; // Issue a write command to RAM I2C0CONSET = 0x04; // Set AA bit for ACK I2C0CONCLR = 0x28; // Clear STA and SI flags (status responds with 0x18) I2C0DAT = 0x1F; // MSB I2C0CONSET = 0x04; // Set AA bit for ACK I2C0CONCLR = 0x08; // Clear SI flag (status responds with 0x28) I2C0DAT = 0xFF; // LSB I2C0CONSET = 0x04; // Set AA bit for ACK I2C0CONCLR = 0x08; // Clear SI flag (status responds with 0x28) I2C0DAT = 0x77; // Write Byte of 0x77 I2C0CONSET = 0x04; // Set AA bit for ACK I2C0CONCLR = 0x08; // Clear SI flag (status responds with 0x28) I2C0CONSET = 0x14; // Issue a STOP I2C0CONCLR = 0x08; // Clear SI flag If I follow this with a Read Sequence, I get correct status, but an 'A1', which incidentally coincides with the Chip ID + WRI. Again, the 'A1' is read whether or not I have the RAM actually connected. Any ideas on what I am missing? I am using an Embedded Artists prototype board for this code. It is also not clear to me how I know if each step listed above is actually accepted by the RAM chip. Thanks. Sutton
Message
I2C on LPC2148
2006-04-20 by Sutton Mehaffey
Attachments
- No local attachments were found for this message.