Hi,
I would like to know if there is a PDM support for my Micropython Board ?
It's for MEMS Microphone.
Someone can help me ?
PDM support on Micropython
Re: PDM support on Micropython
I took a quick look out of curiosity.
On STM32, some of the newer families (L4, H7, possibly others) have a DFSDM peripheral -- so you do the whole thing in hardware and just get a PCM stream out of it. (This peripheral is not currently supported in MicroPython... you could try and poke the registers directly, but it involves setting up DMA etc...not easy)
But PDM is synchronous serial, so if you're prepared to do the delta-sigma demodulation (i.e. pulse density) yourself, then you can read data from it directly using SPI (or I2S). It's just not going to be possible to get continuous audio without again doing DMA etc as you'll be alternating between requesting SPI data then processing it. DMA is definitely on the TODO list for MicroPython's SPI driver but not currently supported.
On STM32, some of the newer families (L4, H7, possibly others) have a DFSDM peripheral -- so you do the whole thing in hardware and just get a PCM stream out of it. (This peripheral is not currently supported in MicroPython... you could try and poke the registers directly, but it involves setting up DMA etc...not easy)
But PDM is synchronous serial, so if you're prepared to do the delta-sigma demodulation (i.e. pulse density) yourself, then you can read data from it directly using SPI (or I2S). It's just not going to be possible to get continuous audio without again doing DMA etc as you'll be alternating between requesting SPI data then processing it. DMA is definitely on the TODO list for MicroPython's SPI driver but not currently supported.
Re: PDM support on Micropython
is there any support for this yet?
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: PDM support on Micropython
If you would consider an I2S MEMS microphone you could look at integrating this PR into a custom build. It supports the PyBoard.
https://github.com/micropython/micropython/pull/7183
Or, try out the I2S feature with a pre-built binary, available here:
https://github.com/miketeachman/micropy ... s-examples
https://github.com/micropython/micropython/pull/7183
Or, try out the I2S feature with a pre-built binary, available here:
https://github.com/miketeachman/micropy ... s-examples
Re: PDM support on Micropython
Thanks for your reply Mike.
neil
neil
Re: PDM support on Micropython
FYI Mike's PR was merged and the I2S functionality is now available in the nightly builds (and will be in 1.17)