??? 11/25/09 17:52 Modified: 11/25/09 17:53 Read: times |
#171166 - Send sensible address values. Responding to: ???'s previous message |
You have the basic structure of writing and reading a 24C256 eeprom. But why not use an unsigned 16 bit variable for the address register and write:
i2c_transmit_byte(address >> 8);//High byte of address i2c_transmit_byte(address & 0xFF);//Low byte of address You are trying to access address: 0xAAAA in a device that can only access 0x0000 to 0x7FFF. Write each primitive sequence as a function. Then you can re-use it every time you want to read/write in your program. And most importantly re-use in other programs. Also bear in mind that the eeprom will take 3 or 4 ms to write. Either allow a 5ms delay or poll the device when you want to do the next operation. i.e. take note of the ACK from when you send a Slave byte. David. |
Topic | Author | Date |
AT24C256 | 01/01/70 00:00 | |
help | 01/01/70 00:00 | |
BitBang's Amost Always.... | 01/01/70 00:00 | |
Why use void functions | 01/01/70 00:00 | |
thanks | 01/01/70 00:00 | |
Writing to specific address | 01/01/70 00:00 | |
Send sensible address values. | 01/01/70 00:00 | |
I2C_0.0.zip | 01/01/70 00:00 | |
no luck, | 01/01/70 00:00 | |
You have more pins to mis-wire. | 01/01/70 00:00 | |
i2c used, What should be the address | 01/01/70 00:00 | |
Read Murray's excellent Help Files | 01/01/70 00:00 | |
Incorrect reply | 01/01/70 00:00 | |
Please take some time to READ the Help | 01/01/70 00:00 | |
single byte read write working | 01/01/70 00:00 | |
I2C_0.1.zip released!![]() | 01/01/70 00:00 |