??? 10/08/08 15:50 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#158937 - Issues Responding to: ???'s previous message |
Looking at your code I see some issues.
For the EEPROMs I've used you cannot simply read. You first have to write the address then send a repeated start then read the data. Currently you have the writes commented out. In your call to i2c_transmit you pass 0x00. Why? This should be the address of the EEPROM. You call i2c_init and pass 0xA0. This should be the microcontroller's I2C address not the address of another I2C device. Also 0xA0 can't be valid because the address is shifted up by one bit. Perhaps you mean 0x50? Please note that the I2C generated code from Code Architect is meant as a starting point. It can do most communication with most devices. For things like repeated starts you will need to start customizing the ISR. My suggestion is to try writing a single byte first as that is the simplest arrangement and one that the Code Architect code should be able to handle without changes. It is expected that users of Code Architect look at the generated code and understand what it does. For example each time you see an SFR being used look it up in the device user manual. Andy |