2013-12-18 05:52 AM
Hi
I'm trying to write data to eeprom using I2C protocol (Polling Method), but while checking event 5 (EV5) as well as event 6 (EV6) I'm getting '' Bus error & Arbitration loss '' error. How can i overcome this... please help me somebody #i2c #basic-electronics #stm32f103rrbt6 #need-help-interfacing-to-eeprom2013-12-18 08:34 AM
Hi
Can I check my understanding : EV5 = transmitted Start bit in master transmit mode EV6 = Address and W/R bit sent + ACK ? ''I'm getting '' Bus error & Arbitration loss '' error.'' It is likely that the I2C bus has SDA or SCL pulled low. You need to put an oscilloscope or logic analyser on the bus and look at what is happening. You are not always in total control of the I2C bus. The SDA and SCL are open collector outputs - meaning that it is possible for some other device to pull the lines low.2013-12-18 11:25 PM
Thanks for reply sung.chen_chung
Actually I'm using stmf103 controller & 24c04 EEPROM. Here the only master is controller & only one slave is EEPROM.so how bus line can be pulled low ?? & I'm getting '' Bus error & Arbitration loss '' error. I tried but i could not able to notice anything on oscilloscope, still it appears for a fraction of second. Is their any other way to clear this error ?? Please..help me2013-12-19 02:11 AM
Hi
It does not matter that you only have a single master and single slave device. Any device can pull either SDL or SCK low. Both SDL and SCK must be high to signify the bus is idle. If either line is low (when you probe with your scope) then no I2C transmittion can occur. From you description - you are not successfully sending the start bit or possibly not sending the device address +R/W bit. Do you understand the I2C protocol? Are you just trying to write code to talk the the EEPROM?2013-12-19 03:04 AM
Yes, you are right Start bit is not initiating, even if its initiated also I'm not getting response for address transmission. I'm getting Bus error or Arbitration lost error.. As per you the Bus line is pulled low right... what can i do, to proceed for next step ? what are the points should i note down to have a synchronous communication ? See the attachment....
Thank you.. waiting ________________ Attachments : I2c_Code.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hztv&d=%2Fa%2F0X0000000bQx%2F9fPkDBMVEna9g4eJtKd.Zx5b2Tah29tsnunqcQcu6Dc&asPdf=false2013-12-19 03:08 AM
2013-12-19 03:24 AM
2013-12-19 03:33 AM
Before any I2C transmission, the software should check the bus is ok/idle.
Have you checked the datasheet for the eeprom? How long does it take before it is ready?2013-12-20 12:51 AM
2013-12-20 04:37 AM
Hi Selva
That is OK. I understand that you are getting frustrated. What I am trying to do is to get you to understand that sometimes, the problem is not in the code. You are dealing with electronics here and they have their quirks. I am trying to get you to understand the system (the STM32 Discovery + the I2C EEPROM that you have attached). ''i have read the eeprom datasheet its taking less than 3 milisec'' 3ms is a very long time for embedded processor! Well actually <3ms is a useless figure! ''After power ON I'm initiating start condition... Should i give any Delay ??'' Yes - a BIG delay if the EEPROM take 3ms