This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C Communication with a 5V device

Other Parts Discussed in Thread: MSP430F5438, PCA9306

Hi guys, 

I'm trying to communicate through I2C with a motor driver (MD25) that runs at 5V. I am using the MSP430 Experimenter's board with the MSP430F5438 microprocessor. Additionally I am using a Logic Level Converter from Sparkfun that translates 3.3 to 5 V seamlessly. I have tied SCL and SDA on both sides to VCC using a 10K resistor. When observing through the oscilloscope, I find that the start sequence is generating the right address but the MD25 is not sending an ACK on the 9th clock cycle. However, I only observe this when I observe the SCL/SDA lines from the 3.3V (MSP430) side. When trying to check from the 5V (MD25) side, I see the SDA line held high at 5V while the SCL line is at 0V.

Any insight or this, or suggestion on what might be wrong (resistors only needed on one side of the line, different logic level converter needed, etc.??)

Thanks in advance!

Alvaro 

  • Hi Alvaro,

    I do not know the Sparkfun solution! Because of that I recommend to take a look at PCA9306, a dual bi-directional I2C-bus voltage level translator (http://focus.ti.com/docs/prod/folders/print/pca9306.html).

    Rgds
    aBUGSworstnightmare

  • Thanks, I believe the level translator from Sparkfun is working fine, I am just wondering (for troubleshooting purposes): With this PCA9306 voltage level converter, would you place pull-up resistors on each side of the translator or only on the 3.3V (I2C Master) side? 

  • Logic level converters are unidirectional. SDA, however, is bidirectional, that means the diretion of the data transfer changes. And the logic level converter does not know when and where. So SDA only goes one direction, but the answer is swallowed at the converter.

    But usually, it isn't necessary to use a converter at all.

    Since I2C is open collector, none of the peers is ever driving the signal high, only low.

    So if the pullup goes to 3.3V, both sides will ever see a 0v/3.3V signal. And 3.3V are usually accepted as 'high' by 5V systems too (the trigger point is somewhere in the 2.5V range)

    Some 20 years ago I needed a bidirectional line driver, so i developed one (I have never seen such a thing commercially produced). It only works with open collector (of course, or its output would drive its own inputs, causing a lockup or oscillation).

    I did it with two open collector  inverters and two XNOR gates, I think ( the drawings are long lost).  And of course pullups on both sides (even different voltages possible with todays 74HCT chips - I was using 74LS back then, so 5V only)
    It worked flawlessly in both directions (I tested with 1MHz and got clean signal edges in both directions, no matter from which side I injected the signal.)

     

  • Hi,

    you need to have the pull-ups on both sides!

    Rgds
    aBUGSworstnightmare

  • Hey guys

    Jens-Michael Gross said:
    But usually, it isn't necessary to use a converter at all.

    So this ended up being my solution, I was finally able to read from the device and observe the data transmission on the oscilloscope. Very exciting to finally get it going!

    Thanks for your help,

    Alvaro

**Attention** This is a public forum