10 years, 1 month ago.

I2C data problem

Hello;

I am using LPC1768 as micro controller and i use it as a i2c bus master. To send the I2C signal to long distance(25 meters) I use P82B96 I2C buffer. When I use short cable between master and slaves communication works without any problem and I see below signal in the scope./media/uploads/serhat_ayser/image_-1-.jpeg

After I try same setup with long wire communication does not work. As seen in the image below the data duration is shorter than the first try(which is with the short wire) but the number of high logic levels are same with the first one. Can anyone guess why such problem occurs.

/media/uploads/serhat_ayser/image.jpeg

Best Regards.

Where did you place your I2C buffer? Beginning? End? Halfway?

In principle I2C isn't intended for these distances, RS232 or even RS485 is. Looking at your timescale you already use a fairly low speed? Are those supposed to be identical? I would try to measure what is right before, and right behind your buffer(s), because I would guess something is not going as planned there. What kind of pull-up do you use? For larger distances a smaller pull-up can improve performance (but too small isn't a good idea, don't overdo it).

posted by Erik - 08 Mar 2014

I use I2C buffer from the end of the master pcb buffer end beginning of the slave pcb. In other words, From mbed to buffer the signal goes with I2C with 5 V logic level than buffer makes it differential send the data to the slave PCB with 25 m CAT5 cable. Then, the buffer on the slave side converts it to the I2C signal with 5V logic level. That is the scenerio. As stated in the datasheet of the buffer with this IC signal can send up to 100 meters. I use 1k pull-up Best Regards.

posted by Serhat AYSER 09 Mar 2014

Hello;

In my trials CAT5 cable is in wrapped form like a toroid. After I roll out the cable communication works properly. Thanks for your attention. Best Regards.

posted by Serhat AYSER 11 Mar 2014

3 Answers

10 years, 1 month ago.

So it works OK when using short cables with the buffers inserted,but it fails with buffers and longer cables?

What voltages are you using on the buffered section of the connection. Have you checked that the shared ground is OK, in the scope images it looks like your GND level has some noise. Are all pull-up resistors installed and connected. What is the I2C datarate, start low.. Try to show both SDA and SCL on the scope.

10 years, 1 month ago.

The cable length limit for an I²C serial bus is inversely proportional to the bus speed or clock rate. Even with buffers the type of cable you use will dramatically effect the distance. Cable capacitance is your problem here. Shielded 22 AWG twisted pair cables have capacitance in the range of 100-240 pF/m. So the maximum bus length of an I2C link is about 1 meter at 100 Kbaud, or 10 meters at 10 Kbaud without buffers. Unshielded cable and correctly designed PCB track layout typically has much less capacitance so speeds can be increased, but should only be used within an otherwise shielded enclosure to reduce RF born interference. I²C communication was designed mainly for on board local peripheral devices, consider using an RF link, Xbee is simple to use.

10 years, 1 month ago.

Yes with the long cables it fails. GND's are shared in the system and pull-ups are also OK. I try diffent rates 100kHz, 10kHz ,1 kHz, 100 Hz. The SDA and SCL scope measurements are like below. I use 5 V and 12 V. /media/uploads/serhat_ayser/image3.jpeg

Also I measure the SDA from master and slave side(connected with 25 meter CAT5 cable).Here is the result. /media/uploads/serhat_ayser/image4.jpeg

It seems like there is no delay between two ends.

As seen at the first two images that are in my first post the data lengths are not same with the long and short cable. Can the reason be the lack of acknowledge bit. In other words when the ack feedback is not sent from the slave to the master, does master stop the communication or wait for ack from the master. Can it be the situation?

Best Regards

If the master does not get an ACK it will stop communication.

posted by Erik - 09 Mar 2014

It is hard to see but from your third picture it look like you are sending 2 bytes. The first is 0x00, that means you are trying to send data to slaves responding to the general call address 0. The lsb is 0, so you want to write. The slave responds and sends Ack (9th bit is low), the next byte you send is not acknowledged (9th bit is high) and the master aborts. Is this what your software tries to do? Did you implement the code to respond to the general call address.

posted by Wim Huiskamp 09 Mar 2014