Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Feather m4 SDA or SCL pullup problem
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Feather m4 SDA or SCL pullup problem

by chrissygonzalez on Tue Jan 18, 2022 3:51 pm

Screen Shot 2022-01-18 at 3.30.14 PM.png
My sad little friend
Screen Shot 2022-01-18 at 3.30.14 PM.png (544.66 KiB) Viewed 54 times


Hello! I made a little light that turns on slowly in the morning out of 1) a Feather M4 Express, 2) the DS3231 Precision Real Time Clock featherwing, and 3) the NeoPixel featherwing. It's been working pretty reliably for about a week, but when I reset it this morning, the red light started flashing. I plugged it in and saw: 'RuntimeError: No pull up found on SDA or SCL; check your wiring'.

Looking at page 18 of https://cdn-learn.adafruit.com/download ... samd51.pdf, I see that there aren't pullups on SDA or SCL.

Questions:
- I'd never heard of a pullup until today. Should I try to add them to SDA and SCL? Can anyone point me to a resource for learning how to add one, or a product page for something that would work?
- I'm not great at soldering. Do you think this could be caused by a bad connection somewhere, or do those show up differently? I was frankly surprised that it worked at all, heh.
- Any other suggestions welcome! I'm more on the software side of things, so I really only know the bare minimum it took to get things working.

chrissygonzalez
 
Posts: 5
Joined: Mon Oct 09, 2017 3:39 pm

Re: Feather m4 SDA or SCL pullup problem

by dastels on Tue Jan 18, 2022 9:43 pm

There's nothing wrong. The Feathers never have I2C pullups... the I2C wings and breakouts do.

The software has gotten into a state. I've seen this happen at times.

What else gets output? Especially when you enter the REPL.

What version of CircuitPython are you running?

Dave

dastels
 
Posts: 9734
Joined: Tue Oct 20, 2015 3:22 pm

Re: Feather m4 SDA or SCL pullup problem

by chrissygonzalez on Wed Jan 19, 2022 10:00 am

Thank you! Exciting that it might be salvageable. It's running: Adafruit CircuitPython 7.1.0 on 2021-12-28; Adafruit Feather M4 Express with samd51j19

I've been using it with a battery, so it probably hasn't been fully shut down for awhile -- I just click the Reset button to turn off the light in the morning and let it continue on its way. However, I left it sitting on my desk with no power overnight, and now it runs again (yesterday, the error was the only thing it showed in the REPL, and then it quit the program).

Here's my code, in case you can spot where it goes wrong? I'm new to Python, so I cobbled it together using NeoPixel examples and https://learn.adafruit.com/circuitpython-oled-watch/overview for the RTC part:

Code: Select all | TOGGLE FULL SIZE
import random
import time
import board
from analogio import AnalogIn
import neopixel
import adafruit_ds3231

i2c = board.I2C()
rtc = adafruit_ds3231.DS3231(i2c)
vbat_voltage = AnalogIn(board.VOLTAGE_MONITOR)

#set_time = time.struct_time((2022, 1, 9, 18, 14, 00, 6, 9, 0))
#print("Setting time to:", set_time)
#rtc.datetime = set_time

RED = (100, 0, 0)
BRIGHT_RED = (255, 0, 0)
ORANGE = (225, 100, 0)
YELLOW = (255, 150, 0)
WHITE = (255, 200, 150)
BLACK = (0, 0, 0)

pixels = neopixel.NeoPixel(board.D6, 32, brightness=0.02)    # Feather wiring!
boardPixel = neopixel.NeoPixel(board.NEOPIXEL, 1)

def get_voltage(pin):
    return (pin.value * 3.3) / 65536 * 2


def showColor(led, color, delay):
    pixels[led] = color
    pixels.show()
    time.sleep(delay)

def showLights(color, delay):
    #pixels.brightness = 0.2
    leds = [x for x in range(32)]
    #print(leds)

    while len(leds) > 0:
        num = random.randrange(0, len(leds))
        showColor(leds[num], color, delay)
        del leds[num]

def sunrise():
    showLights(RED, 3)
    time.sleep(60)
    pixels.brightness = 0.03
    time.sleep(60)
    showLights(ORANGE, 2)
    showLights(YELLOW, 0.5)
    showLights(WHITE, 2)
    time.sleep(60)
    pixels.brightness = 0.05
    time.sleep(60)
    pixels.brightness = 0.1
    time.sleep(60)
    pixels.brightness = 0.2
    time.sleep(60)
    pixels.brightness = 0.3

while True:
    battery_voltage = get_voltage(vbat_voltage)
    current = rtc.datetime
    pixels.show()
    if battery_voltage < 3.2:
        print("battery voltage is", battery_voltage)
        boardPixel.fill(RED)
        boardPixel.show()
    else:
        boardPixel.fill(BLACK)
        boardPixel.show()
    if current.tm_hour == 6 and current.tm_min == 0:
        print('starting the sunrise')
        sunrise()

chrissygonzalez
 
Posts: 5
Joined: Mon Oct 09, 2017 3:39 pm

Re: Feather m4 SDA or SCL pullup problem

by dastels on Wed Jan 19, 2022 12:34 pm

A full shutdown will often bring it back.

The code looks fine... and a neat idea.

I don't see anything wrong. In my experience this just happens very occasionally.

Dave

dastels
 
Posts: 9734
Joined: Tue Oct 20, 2015 3:22 pm

Re: Feather m4 SDA or SCL pullup problem

by chrissygonzalez on Wed Jan 19, 2022 12:46 pm

Ahh, thank so much for your help, Dave! I appreciate you looking it over for me. Don't mind unplugging it once in awhile.

chrissygonzalez
 
Posts: 5
Joined: Mon Oct 09, 2017 3:39 pm

Please be positive and constructive with your questions and comments.