Closed
Description
Port, board and/or hardware
rp2 port with RP2350B
MicroPython version
v1.24.0-preview.461.gb8227a3f7.dirty
Reproduction
import neopixel
import machine
pin = 32
p = machine.Pin(pin)
n = neopixel.NeoPixel(p, 1)
n[0] = (127, 0, 0)
n.write()
Expected behaviour
A NeoPixel connected to pin
should illuminate.
Observed behaviour
A NeoPixel connected to pin
only illuminates if pin
is <32. If pin
is >=32, the NeoPixel does not illuminate.
Additional Information
The root problem appears to be here:
micropython/ports/rp2/mphalport.h
Lines 184 to 190 in 5dfbd43
gpio_set_mask()
requires a 32-bit value, so the shifted bit gets truncated when using a pin >= 32. There is a gpio_set_mask64()
, however for some reason it didn't work when I tried it (I didn't dig into it). However changing to gpio_put()
works fine on my end.
Code of Conduct
Yes, I agree