I2C Pullup Issues? [Semi-Solved]

Looked over the documents and didn’t see anything mentioned. I’m having a very hard time getting the I2C lines pulled up! I’ve got a Bus Pirate (v3.6) connected with VPU enabled and 470 Ohm resistors connected from 3V3 to SDA/SCL on the core, but it’s still being pulled low.

Should I be enabling internal pullups or something?

And after doing a factory restore and re-flashing my firmware the bus is working fine!

There must have been a register stuck or either the firmware wasn’t actually updating successfully. Weird. Now I can work on dealing with the next set of I2C issues.

While looking through the I2C code to fix the addressing issue, it seems that the internal pull-up resistors aren’t being enabled on D0 and D1 like they should be. This would explain why I need such low value resistors for the bus to work correctly.

@zachary I’ll be working on some big changes to the I2C sub-system over the next few days. However, before I do a lot of work for nothing, is anyone else inside the Spark Team currently working on this?

Hi @timb,

Thank you for posting your findings, that sounds like a really good catch. I’m not aware of anyone working on this at the moment so I think your efforts would not be wasted. I’d want to double check with those guys to be sure though.

Thanks,
David

@Dave Okay, cool. Let me know. I also asked @zachary in reply to a PM he sent me about my previous I2C pull request. :smiley:

In the meantime, I’ll go ahead and start working.

1 Like

Yup, go right ahead Tim—nobody else mucking with I2C ATM. I appreciate you checking. :smiley:

@zach Are there similar problems with TX/RX ? I experience severe problems on receiving data from my UARTs (Receiver , Transmitter ) powered by 3V3 from core at USB supply. Sending data is no problem, but received data is chopped somehow.

Hi @timb, just curious, but why should they be enabled? Aren’t external pull-up resistors always recommended? I have been advised in the past never to rely on internal pull-ups to make i2c work.

@timb I think you must have some other problem. What do you mean by you “can’t pull it up with 470 ohms, it’s still being pulled low” … how low is it? Better yet, can you share scope plot of your I2C waveforms?

When the bus is released, it’s open drain outputs from the Core… so any resistor value should technically be able to pull the line high.

I was using the DS1307 RTC on the :spark: Core with 10k external pull ups and the levels were going all of the way to 5V.

I noticed with NO I2C device attached, the SCL line would not stay high, but rather stay low. When a device was connected, it would stay high after clocking. I haven’t looked into this further, but I seem to remember I2C should stay high when idle. Not sure why it’s not when there is no device attached (no ACK seen by master?)… but this would have nothing to do with the internal pull ups… just sounds like the bus is being held active low by the open drain outputs.