You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# SPDX-FileCopyrightText: 2022 Jeff Epler, written for Adafruit Industries## SPDX-License-Identifier: MITimportarrayimportboardimportsupervisorfromrp2pioimportStateMachinefromadafruit_pioasmimportProgram# Pixel stream is very similar to NeoPixel WS2812B, but inverted.## Pixel time is 1.25us (800kHz)## Datasheet low times for a "0" bit are 310 (min) 360 (typ) 410 (max) ns# Datasheet high times for a "1" bit are 650 (min) 720 (typ) 1000 (max) ns## Operating PIO at 14x the bit clock lets us achieve nominal 357ns and 714nsDEBUG=1# Set to 1 to output OPPOSITE signal on the next higher pin_program=Program(
f""".side_set 2 nop side 2 [7].wrap_target pull ifempty side 0 out pins 1 side 1.wrap """
)
data=array.array('L', range(64))
sm=StateMachine(
_program.assembled,
auto_pull=False,
first_sideset_pin=board.A1,
first_out_pin=board.A0,
out_shift_right=False,
pull_threshold=32,
frequency=800_000*14,
**_program.pio_kwargs,
)
sm.background_write(loop=data)
whileTrue:
pass
Behavior
This program should write 32-bit SPI data 0x0 ... 0x3f, forever.
It seems like this is what it does on RP2350 (with recent-ish main branch build; though I could test more closely)
On RP2040, the first repetition of the data is truncated.
This causes problems with PIO programs like the "background writing neopixel" because when the data organization is wrong, the wrong parts of the DMA data stream can be used for a bit count or a delay count.
Description
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
CircuitPython version
Code/REPL
Behavior
This program should write 32-bit SPI data 0x0 ... 0x3f, forever.
It seems like this is what it does on RP2350 (with recent-ish main branch build; though I could test more closely)
On RP2040, the first repetition of the data is truncated.
This causes problems with PIO programs like the "background writing neopixel" because when the data organization is wrong, the wrong parts of the DMA data stream can be used for a bit count or a delay count.
Description
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: