Rasperry Pi Pico W I2S interface probelm

Thread Starter

LayZ

Joined Dec 27, 2022
8
Hi, I have a question: is it possible to use the I2S interface on the Raspberry Pi Pico W? The Raspberry Pi Pico W doesn't have an I2S interface, but I found online that it's possible to simulate an I2S interface on the Raspberry Pi Pico W, but I'm not able to do it myself. The problem is that I have a digital microphone (I2S interface) and I want to obtain the acoustic pressure value (in dB) from it. I write a code in micropython.
Any ideas guys?
 

Ya’akov

Joined Jan 27, 2019
9,165
Thanks for the answer.
Really useful link, but it's written in c++ and I need to code in python
Many times important libraries are in a language other than the one that is being used for the main program. Different languages make using these libraries usable in different ways. For example, there in inline C in Perl that allows C code to be used in Perl programs, or they can be incorporated into an XS module which is a way to use a compiled library in Perl.

For Python, so far as I know, there is no inline language support, but there is the cffi library to do something more like the XS module. If you search for “RPi PIO Python I2S” you might find something already working. If not, you could learn to use the facility of Python that would allow you to use the C++ library’s API.
 

Thread Starter

LayZ

Joined Dec 27, 2022
8
Ok, but will this work on raspberry pi pico and micropython? Because so far I have had many problems with micropython, e.g. due to the lack of many functions.
 

Ya’akov

Joined Jan 27, 2019
9,165
Ok, but will this work on raspberry pi pico and micropython? Because so far I have had many problems with micropython, e.g. due to the lack of many functions.
I don’t use Python, but here is the relevant documentation. I haven’t read it, so I don’t know if there is something that will stop you from using it.

On the other hand, the C++ code contains the appropriate PIO program, so you could port it. Read up on PIO, maybe that’s the best idea—I really don’t know.
 
Top