Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raspberrypi: support PIO on high pins #9901

Merged
merged 12 commits into from
Jan 9, 2025
Merged

Conversation

jepler
Copy link
Member

@jepler jepler commented Dec 20, 2024

Testing performed: on a Metro RP2350 prototype, used neopixel_write on pin A0 (GPIO41) & scoped it.

Also, the built in neopixel still works.

Note that this does not enable USB Host on the 4-pin header, see sekigon-gonnoc/Pico-PIO-USB#133

This also fixes USB Host, though it depends on an additional pull request: adafruit/Pico-PIO-USB#1 (us) or sekigon-gonnoc/Pico-PIO-USB#157 (upstream)

Closes: #9897

@jepler jepler requested a review from dhalbert December 20, 2024 16:09
@jepler
Copy link
Member Author

jepler commented Dec 20, 2024

ping @ladyada

ladyada
ladyada previously approved these changes Dec 20, 2024
Copy link
Member

@ladyada ladyada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe you! but maybe @dhalbert can do a more 👁️ review

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing all this work! The macros to manipulate bitmasks are a nice addition. At first I thought they were pre-existing, but I saw that you added them.

  1. I merged the Pico-PIO-USB update. Could you update to the merge commit? Thanks.
  2. I tested I2SOut on Feather RP2040. I happened to have a test program that played a tone. No sound comes out with this build. Feather RP2040 PropMaker would also be an easy test board.

test program: this was adapted from a test program someone else had supplied for testing something else entirely

import array
import audiocore
import audiobusio
import board
import math
import time


# I2S audio out
audio = audiobusio.I2SOut(board.D9, board.D10, board.D11)

# Generate one period of sine wave.
length = 8000 // 440
sine_wave = array.array("H", [0] * length)
for i in range(length):
    val = int(math.sin(math.pi * 2 * i / length) * (2 ** 15 - 1) + 2 ** 15)
    sine_wave[i] = val

sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)

while True:
    audio.play(sine_wave, loop=True)

    time.sleep(2)
    audio.stop()

@jepler
Copy link
Member Author

jepler commented Jan 8, 2025

OK I think this is right now. There were a variety of problems but all caused by just a couple of bits of wrong thinking.

testing performed:

  • qtpy rp2040 : rotaryio
  • metro rp2350:
    • built in (low) neopixel
    • high neopixel
    • low, high i2sout
    • high usb host
    • medium (built in) neopixel after high i2sout
    • low neopixel after high i2sout

@jepler jepler requested a review from dhalbert January 8, 2025 19:56
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough testing. I retested I2SOut on an RP2040 and and RP2040 Prop-Maker.

@tannewt tannewt merged commit 848243c into adafruit:main Jan 9, 2025
154 checks passed
@RetiredWizard
Copy link

I'm skeptical about this, but I just put this artifact on a Solder Party 2350 Stamp XL in the RP2xxx carrier board and it's resulting in a boot straight to safe mode.

@dhalbert
Copy link
Collaborator

dhalbert commented Jan 9, 2025

@RetiredWizard I tried artifacts from https://github.com/adafruit/circuitpython/actions/runs/12678008250 on my proto Metro RP2350 (RP2350B). The board UF2 works with no safe mode, and so does the Solder Party 2350 Stamp XL UF2. There is no interesting code.py.

@RetiredWizard
Copy link

Okay, well I'm getting the safe mode boot with stable as well so I'll do some more digging to see if it's just my board.

I deleted code.py/main.py just to be sure 😁

@RetiredWizard
Copy link

Definitely something on my end, I just had good boots from 9.2.0, then 9.2.1 and now the firmware you linked is working fine. Sorry for the false alarm....

@dhalbert
Copy link
Collaborator

dhalbert commented Jan 9, 2025

@RetiredWizard np - thank you for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PIO pins >31
5 participants