Feather m4 SDA or SCL pullup problem
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- chrissygonzalez
- Posts: 5
- Joined: Mon Oct 09, 2017 3:39 pm
Feather m4 SDA or SCL pullup problem
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.
- dastels
- Posts: 15656
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Feather m4 SDA or SCL pullup problem
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
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
- chrissygonzalez
- Posts: 5
- Joined: Mon Oct 09, 2017 3:39 pm
Re: Feather m4 SDA or SCL pullup problem
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/circuitpytho ... h/overview for the RTC part:
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/circuitpytho ... h/overview for the RTC part:
Code: Select all
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()
- dastels
- Posts: 15656
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Feather m4 SDA or SCL pullup problem
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
The code looks fine... and a neat idea.
I don't see anything wrong. In my experience this just happens very occasionally.
Dave
- chrissygonzalez
- Posts: 5
- Joined: Mon Oct 09, 2017 3:39 pm
Re: Feather m4 SDA or SCL pullup problem
Ahh, thank so much for your help, Dave! I appreciate you looking it over for me. Don't mind unplugging it once in awhile.
Please be positive and constructive with your questions and comments.