No I2S support in Raspberry Pi Pico builds?

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
danr
Posts: 2
Joined: Fri Aug 27, 2021 2:16 am

No I2S support in Raspberry Pi Pico builds?

Post by danr » Fri Aug 27, 2021 2:37 am

I'd like to use a MAX98357A board with my Pico output sounds. These boards have an I2S interface, and I've found some example code that I think I can adapt to run on the Pico. But, even though the author says, "I2S has been available in the nightly builds since July 5, 2021," I'm not finding the I2S class in the latest Pico build - rp2-pico-20210827-unstable-v1.16-242-g145fedef8.uf2. When I install that build, and try to import the I2S class, I get the following:

>>> from machine import I2S
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: can't import name I2S

Was it left out on purpose? Is there any way that I can still use that class even if it's not part of the build?

Thanks, Dan

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: No I2S support in Raspberry Pi Pico builds?

Post by Roberthh » Fri Aug 27, 2021 7:05 am

The I2s class was added to the ESP32 port, not the rp2 port. The rp2040 chip has no I2S hardware, so it cannot support it directly. It is possible to use a software implementation using the PIO. Examples exist: https://arduino-pico.readthedocs.io/en/latest/i2s.html

danr
Posts: 2
Joined: Fri Aug 27, 2021 2:16 am

Re: No I2S support in Raspberry Pi Pico builds?

Post by danr » Fri Aug 27, 2021 12:14 pm

Thanks for that link!

User avatar
Mike Teachman
Posts: 155
Joined: Mon Jun 13, 2016 3:19 pm
Location: Victoria, BC, Canada

Re: No I2S support in Raspberry Pi Pico builds?

Post by Mike Teachman » Sat Aug 28, 2021 2:50 am

I just started working on rPi Pico I2S support yesterday. The I2S support on the rPi Pico will be the same as the Pyboards and ESP32. Look for a new PR sometime in the next month.

In the meantime, you can get familiar with I2S on one of the supported platforms.

I have a repo of examples that might be helpful:
https://github.com/miketeachman/micropy ... s-examples

Post Reply