0

RuntimeError: SDA or SCL needs a pull up
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RuntimeError: SDA or SCL needs a pull up

by geekguy on Fri Jan 31, 2020 3:25 pm

Hi,

What exactly is the above error message telling me? I can get it just by trying to initialize the I2C bus when there is nothing connected to it. Sometimes, all I have to do is jiggle a sensor on a breadboard and it goes away.

Does this indicate I need to zap the filesystem on the express board?

I really hate this error!

8-Dale

geekguy
 
Posts: 271
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: RuntimeError: SDA or SCL needs a pull up

by V2man on Fri Jan 31, 2020 4:53 pm

Are you using a CPX + Crickit board?

V2man
 
Posts: 703
Joined: Mon Dec 03, 2018 12:38 am

Re: RuntimeError: SDA or SCL needs a pull up

by geekguy on Fri Jan 31, 2020 5:07 pm

V2man wrote:Are you using a CPX + Crickit board?
No. A Feather M0 Express Board with two I2C sensors.

8-Dale

geekguy
 
Posts: 271
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: RuntimeError: SDA or SCL needs a pull up

by V2man on Fri Jan 31, 2020 5:16 pm

That is the error I got when I did not power up the Crickit board. CPX gots its power from my PC USB port.

From https://forums.adafruit.com/viewtopic.php?f=60&t=161235
Under New Features, Updates, and Fixes since 5.0.0 Beta 3
Requiring I2C pullups can now be turned off for a build.

I don't know if you are running into that or you should just add some pullups to the I2C_SCK and I2C_SDA lines.

From https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython/adafruit2-pinouts
SDA - the I2C (Wire) data pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup.
SCL - the I2C (Wire) clock pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup.

V2man
 
Posts: 703
Joined: Mon Dec 03, 2018 12:38 am

Re: RuntimeError: SDA or SCL needs a pull up

by V2man on Fri Jan 31, 2020 6:23 pm

From https://learn.adafruit.com/adafruit-feather/feather-specification
SDA & SCL - this should be your main I2C bus. I2C pullups are put on the Wings, not on the mainboard. These are 3.3V logic, we strongly recommend avoiding clock-stretch I2C on Featherwings. Repeated start is OK! This is our recommended interface for sensors and Wings, try to stick to it.

V2man
 
Posts: 703
Joined: Mon Dec 03, 2018 12:38 am

Re: RuntimeError: SDA or SCL needs a pull up

by siddacious on Fri Jan 31, 2020 8:54 pm

hi geekguy,

That message means that there needs to be a pull up resistor between your SDA and/or SCL lines and your voltage level (3.3V or 5V, depending on your board). I2C requires this to function and if you don't have a sensor attached you'll see this error, as well as if there is a connection issue or something else preventing the SCL or SDA lines from being pulled up

What sensor board are you trying to use? Adafruit breakouts have the SDA and SCL lines pulled up and level shifted and should work when connected to your microcontroller's I2C bus and V+/GND

If this does not solve your problem, please post a clear, well lit, high-resolution picture that shows your wiring and we can take a closer look.

siddacious
 
Posts: 202
Joined: Fri Apr 21, 2017 3:09 pm

Re: RuntimeError: SDA or SCL needs a pull up

by geekguy on Sat Feb 01, 2020 6:18 pm

siddacious wrote:If this does not solve your problem, please post a clear, well lit, high-resolution picture that shows your wiring and we can take a closer look.

I know what it is supposed to mean. I am using only Adafruit breakout boards, so this should not be a problem. This has been a very frustrating problem for me. It may even just be a contact problem within my breadboards, but I can never really tell. I have much larger circuits that I do not get this on. I only have three breadboardable Express boards now, and one is deep in a large stack. I have been through all this before and I guess I am the only one who is experiencing this so I will just keep fiddling with it.

8-Dale

geekguy
 
Posts: 271
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: RuntimeError: SDA or SCL needs a pull up

by V2man on Sat Feb 01, 2020 8:10 pm

What are the two sensors you are using?
What are the two breakout boards?

V2man
 
Posts: 703
Joined: Mon Dec 03, 2018 12:38 am

Re: RuntimeError: SDA or SCL needs a pull up

by geekguy on Sat Feb 01, 2020 11:55 pm

Hi,

I had a bad breadboard, which I replaced. Things started behaving after I did that and now the whole circuit is working the way it should.

8-Dale

geekguy
 
Posts: 271
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: RuntimeError: SDA or SCL needs a pull up

by V2man on Sun Feb 02, 2020 1:01 am

Thanks for letting us know.

V2man
 
Posts: 703
Joined: Mon Dec 03, 2018 12:38 am

Please be positive and constructive with your questions and comments.