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.

MSP430 I2C too weak

Other Parts Discussed in Thread: PCA9515A

Hello,

I am using I2C of an MPS430F5659 (UCB1, 1k pull-up, 4 sensors, 30cm cable) and I've noticed that the SDA and SCL output in this mode are very weak (raise time of about 1us). If I toggle the output in GPIO mode it seems much stronger (raise time 20ns and 5ns with PxDS activated).

As a result, when I touch my PCB with the hand, SCL stays low and I2C doesn't work, when I do the same experiment when in GPIO mode the SCL line can go high without any problems.

Anybody has an explanation or a workaround (beside doing the I2C with bit banging)?

Thanks in advance for your answers and best regards,

Thierry

  • I2C is an open-drain bus interface.

    The required pull up resistors needed depend on the number of loads on the bus, the bus speed used, and other variables including the extra capacitance introduced by long cabling.

    The "workaround" is really the solution - you need to decrease the value of the pull-up resistors until you have an acceptable rise time.

    I would suggest trying 470 ohms as a start, based on the information you provided. See where that gets you.

  • I'll also add that this isn't anything inherent in the MSP430 implementation of I2C; it is basic electronics. All the current for low to high transitions has to come via the pullup resistors. You could do a thevinin analysis and determine what the effective RC load is that the pullup has to supply.

  • Thierry said:
    when I touch my PCB with the hand, SCL stays low

    Impossible with 1K pull-up, are you sure you have the right 1K resistors not 1M? And are they really connected?

    EDIT: It looks more you are, accidentally, using a 1n capacitor instead of a 1K resistor.

  • Hello,

    Thanks all for your answers.

    Yes I'm sure that I have a 1k resistor, I've several prototypes and all behave the same, I've even solder another pull-up to test and no change.

    If it was just a resistor problem I would expect a signal with a very bad shape when I touch the PCB. But in this case there is no signal at all and the UCBxSTAT UCSCLLOW bit is set.

  • Then there is a ~3mA of current trough your finger, I think you’re on the wrong forum, you should search for a medical health forum.

    Check I2C connections, ground etc., but also other MCU connection, floating ports, RESET etc.

  • As already said, rise time on I2C bus is only influenced by the pull-up resistors, as the MSP (or any slave) only pulls the line down but never up.

    However, even with several I2C slaves, 1k pull-up is quite strong already. Usually, 4,7k or even 10k are good enough.

    1µs rise time on 1k means some nF line capacitance, which is quite much. Or a significant pulldown current and a bit less line capacitance. Sure you have no caps on the lines? (note: fingers are adding capacitance and resistance too)

  • Hello,

    I further reduced pull-up resistors to 470 Ohms as proposed by Brian Boorman and now it works. I will ask the hardware engineering to check this more in depth because I agree with Jens-Michael Gross that 1k is already a strong pullup and there may be some unwanted parasistic capacitance in the PCB.

    Thanks all for your answers !

    Thierry

  • Hello,

    470 Ohms as proposed by Brian solves my problem but I found that there is a low limit for the pull up resistor value for I2C which is calculated by Rp = (Vcc - 0.4)/3mA. In my case with a Vcc of 3V, 867 Ohms.

    What is the risk if I use a value below this limit?

    Regards,

    Thierry

  • Thierry said:
    What is the risk if I use a value below this limit?

    I would not bother much :) Only risk is that not all I2C slaves possibly can pull data line strong enough. You shall check pull capabilities (datasheets) of every I2C slave IC you use and ensure that they are capable of pulling data line low with good margin. Verify it with scope too.

  • 1K is very strong pull-up, so it must being something wrong the pcb design if you need 470 Ohm

    http://www.edn.com/design/analog/4371297/Design-calculations-for-robust-I2C-communications

  • Tony Philipsson said:
    1K is very strong pull-up, so it must being something wrong the pcb design if you need 470 Ohm

    Yes, it seems wrong indeed. Especially if we take in account initial info: "SDA and SCL output in this mode are very weak (raise time of about 1us). If I toggle the output in GPIO mode it seems much stronger (raise time 20ns and 5ns with PxDS activated).". Any chance to try another msp430 chip? Maybe clock output driver is blown somehow.

  • To be honest, if just anything could drive an I2C bus, then why make parts like this,PCA9515A. Driving off the PCB to cable greatly increases the capacitance of the bus. Direct drive if the I2C from most uprocessors is pretty limited,.

  • >The device contains two identical bidirectional open-drain buffer circuits

    I don't see that it drives anything, you still need pull-up resistors on both sides.
    The mcu job is to sink, and I don't see OP complaining that falling edge slope is being to long.

    Sure for very long distances it helps to have repeater-ic as to divide up the trace capacitance in to smaller sections.

    If OP post the schematic and gerber of the pcb, I'm pretty sure we will find the problem there.
    What the 4 sensors part number on the bus are is also helpful

  • Tony Philipsson said:
    If OP post the schematic and gerber of the pcb

    Including cable layout.

  • BTW max rise time for 100 kHz mode is 1 usec, so you might not be out of spec (fall time is 300 nsec) . The 400 kHz mode is 300 nsec rise and fall. Also, depending on the bus topology, where you actually place the pull-up may be important.

  • Unfortunately I cannot post the layout as it belongs to my company. I've tried to remove sensors one by one and no change, very probably it's a cable issue so I will either try to work at 100kHz or live with the out-of-specs 470 Ohm resistor.

    Thank you all for you replies!

    Thierry

  • One other thought. Where are the pull ups located? On the processor side of the cable or the sensor side? If they are on the processor side of the cable, try putting them on the sensor side so the  pull ups are on the opposite end of the cable from the driving pin. Or split the pull up and put 1k-2k on either end of the cable for bidirectional data .

**Attention** This is a public forum