ESP32 PDMin

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mrburns42
 
Posts: 29
Joined: Tue Jan 01, 2013 11:31 pm

ESP32 PDMin

Post by mrburns42 »

I am trying to use I2S audio on an ESP32. The module is an M5 Stamp Pico. A MEMs microphone is attached and it worked under C++. I built circuitpython from the main branch yesterday. When I run the example code from the web page, it always returns

NotImplementedError: PDMIn not available

If I list the classes in the module audiobusio, then PDMIn is listed. If I run the code for "Where is my PDMIn?", then is seems to map together any of the pins in the ESP32. However, I don't really understand why this code is returning TRUE on a RunTime Error.

def is_hardware_PDM(clock, data):
try:
p = audiobusio.PDMIn(clock, data)
p.deinit()
return True
except ValueError:
return False
except RuntimeError:
return True

If I change the RuntimeError exception to return False, then there are no found PDMIn pins.

The ESP32 is supposed to have two I2S ports. One of the ports is mapped to the pins on the Grove port that I am using.

How do I determine if this NotImplementedError is real or if it is due to some other error in my code?

Thanks.

User avatar
danhalbert
 
Posts: 4682
Joined: Tue Aug 08, 2017 12:37 pm

Re: ESP32 PDMin

Post by danhalbert »

audiobusio.PDMIn has not been implemented on Espressif chips yet, sorry. So it's just not going work, no matter what. That is what the "Not Implemented" means.

User avatar
mrburns42
 
Posts: 29
Joined: Tue Jan 01, 2013 11:31 pm

Re: ESP32 PDMin

Post by mrburns42 »

Thank you for confirming that I should not keep trying to get this to work. I wish the descriptions on the downloads and the repo had more information on exactly the state of the software. It warned of possible critical bugs. However, there was nothing about specifically what was not implemented. PDM is a critical part of what I am trying to do.

For anyone else attempting to use these MEM microphones on the ESP32, my advice is to use C++ only. Micropython has I2S support, but that also is a dead-end as their I2S support does not include PDM inputs.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”