QT PY STEMMA pull up resistor RunTime error

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

Hey all, playing around with some of the new hardware for the first time in a while. I've got a QT PY SAMD21 setup with circuitpython 6.x and a few STEMMA I^2C peripherals ( AHT20 -temp+humidity, BH1750-light sensor, and PCF8523-RTC) and every one of them gives the following error:

Code: Select all

RuntimeError: No pull up found on SDA or SCL; check your wiring 


I've tried swapping the 4pin stemma cables and using the solder-on pads. I've tried using SDA/SCL, SDA1/SCL1, and board.I2C for pin designation. I'm using the following example code:

Code: Select all

import busio
import adafruit_pcf8523
import time
import board

rtc = adafruit_pcf8523.PCF8523(board.I2C())

days = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")

if False:   # change to True if you want to write the time!
    #                     year, mon, date, hour, min, sec, wday, yday, isdst
    t = time.struct_time((2017,  10,   29,   15,  14,  15,    0,   -1,    -1))
    # you must set year, mon, date, hour, min, sec and weekday
    # yearday is not supported, isdst can be set but we don't do anything with it at this time

    print("Setting time to:", t)     # uncomment for debugging
    rtc.datetime = t
    print()

while True:
    t = rtc.datetime
    #print(t)     # uncomment for debugging

    print("The date is %s %d/%d/%d" % (days[t.tm_wday], t.tm_mday, t.tm_mon, t.tm_year))
    print("The time is %d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec))

    time.sleep(1) # wait a second
Nothing I can think of is resolving my error. I know the qt py doesn't have internal pull-up resistors, but I thought all adafruit I^2C breakouts had them built in. I don't have any external resistors on hand to test, so I'd love to figure out whats gone wrong without, if possible. Thanks!

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by dastels »

There's no hardware problem. You're correct: the sensor boards have pullups on them and the QTPY doesn't.

This seems to happen at times. Try reinstalling CircutPython to give the QTPY a deep restart.

On the remote off-chance that there was a fab glitch on those sensors, you could post a clear photo of them so we can confirm that the pullups are in place.

Dave

User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

By reinstalling you mean just double tap reset and put in the .uf2? I've tried that a few times. my lib folder and code.py remain so I don't know if thats a deep enough reset.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by dastels »

Yes, that's what I meant. Huh.

OK, let's see those photos :)

Dave

User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

Alright, here they are. They don't seem to be obviously missing any components, although I can't find a reference to the two pads on the RTC, its got a trace I could cut, but I'm not going to do that on a whim.

https://photos.app.goo.gl/f3U6BMM8wGgZQ9xs8

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by dastels »

That cuttable trace disconnects the power LED.

Everything looks good. I'm looking into it with support.

Dave

User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

Thank you very much, I appreciate you digging into it for me.

User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

UPDATE:
I've reinstalled with 7.0.0 circuitpython and rebuilt my lib with 7.x libraries. I'm still getting the same pull up resistor error.

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by adafruit_support_carter »

Weird issue. With the STEMMA connector and cables, should just work.

Let's go back and use the AHT20 for troubleshooting. Can you connect just the AHT20 breakout to the Qt Py with a STEMMA cable and post a photo of that showing everything. (in some of your photos the cables go off screen, so can't follow everything end to end).

With the AHT20 connected to the Qt Py, try running an I2C scan and see what happens:
https://learn.adafruit.com/circuitpytho ... 2985153-11

User avatar
blakebr
 
Posts: 956
Joined: Tue Apr 17, 2012 6:23 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by blakebr »

I had a similar problem with 6.3.0. It went away when I started using 7.0.0. Good luck.

User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

I've set up again and am getting some really weird results. I ran the I2C scan as asked on just the AHT20, and it popped up just fine. I connected the other two as well and got some strange output:

Code: Select all

code.py output:
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x38', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x23', '0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
I2C addresses found: ['0x68']
Traceback (most recent call last):
  File "code.py", line 19, in <module>
KeyboardInterrupt: 

Code done running.
I left the code hung for about 20m while I went about my work, and when I came back I did nothing but press [ctrl]-d and once again got:

Code: Select all

code.py output:
Traceback (most recent call last):
  File "code.py", line 10, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring

Code done running.
The photos, to make sure I'm not crazy:
https://photos.app.goo.gl/9of7UR27rEWnFnvf8

User avatar
blakebr
 
Posts: 956
Joined: Tue Apr 17, 2012 6:23 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by blakebr »

I just looked again at mine. I also have a 5.1k resistor on each line. I put them on during early testing when I had the problem, and have forgotten that they were there. I will probably just leave them there. I assume any supplemental resistors 3k to 6K would help isolate the issue.

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by adafruit_support_carter »

Your initial results are good and expected:
I ran the I2C scan as asked on just the AHT20, and it popped up just fine.
Sounds good.
I connected the other two as well and got some strange output:
This also looks good. What you are seeing in the output is all three addresses, '0x23', '0x38', '0x68', of the attached devices. The leading 0x just means the values are in hex notation.

Your photos also look fine.

Not sure why you got the pull up warning after letting it run for a while and doing a soft reset with <CTRL><D>. That might be a red herring. Let's ignore that for now.

Next, go back to having *just* the AHT20 connected like this:
aht20.jpg
aht20.jpg (81.38 KiB) Viewed 122 times
and then try running the simpletest example from the AHT20 library:
https://github.com/adafruit/Adafruit_Ci ... pletest.py

User avatar
RoseNose
 
Posts: 17
Joined: Thu Jan 25, 2018 2:50 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by RoseNose »

The reason I found the hex address output strange is that the I2C addresses seemed to drop and reappear at random.
Additionally the board has seemingly lost pull up resistors again. I am back to just the AHT20 and neither the I2C search code nor the AHT20 example code can find pull ups.

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: QT PY STEMMA pull up resistor RunTime error

Post by adafruit_support_carter »

Let's send you another Qt Py and see if that helps. If we get this same behavior on two separate Qt Py's, that will be useful information.

Send an email to [email protected] with a link to this thread and your order number and they can send you another Qt Py (PID 4600).

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”