2011-04-06 06:53 AM
I2C Problem / timeout
2011-05-17 05:30 AM
I think AN2824 will help you.
2011-05-17 05:30 AM
Maybe
1). your timeout is too short 2). you get no ACK from EEPROM after ADDR has been sent (power supply for EEPROM is unstable) 3). your timeout runs out because the loop is interrupted (any interrupts activated?) 4). I would compare as if ( SystemTicks >= TimeOut) ... P.S. look for AN3281 on ST site.2011-05-17 05:30 AM
Hi,
When you write in EEPROM you must write by packet in accordance with Page size and for read operation you can read all the contents of EERPOM in one operation. i.e:Page size of 24C64 EEPROM is 32byte, you must proceed as follow to write 50 bytes from address 0x000F: 1- Write in address 0x000F 17bytes. (32 - 15) 2- Wait until EEPROM is ready for another operation ( in write operation EEPROM take time to actually write bytes in memory).You can code a function that implement this sequence: 1- generate start 2- Send EEPROM Address 3- if Nack received redo (1) and (2). if ACK received exit this function and start new operation (read or write). There is a new Library called CPAL it's a high layer driver for I2C IP. In CPAL package there are examples developped to work with 24C64 EEPROM. link :http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32_i2c_cpal.zip