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

libraries/PDM/src/rp2040/pdm.pio.h: pio_gpio_init data in pin. #2432

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

dpwe
Copy link
Contributor

@dpwe dpwe commented Sep 9, 2024

tl;dr: I had to uncomment the pio_gpio_init for the PDM mic data in pin in the PDM library to make code which previously worked on an RP2040 also work on an RP2350. The modified library also still works with the RP2040 in my project.

Details:

I am using the PDM library to read a PDM microphone. I developed my code on a RP2040 Pico. It is working correctly.

I recently obtained my first RP2350 board, which is intended to be pin-compatible with the Pico. I plugged it in and my circuit worked, but the PDM mic was reading as a steady -128. With a scope, I verified that the PDM clock was still being emitted at the right frequency, and the PDM data in pin was being driven by the mic.

It looked as if the input pin was reading a steady 0. I saw that in the PIO initialization in the PDM library, there was a command to initialize the data in pin, but it was commented out. The pico-sdk documentation claims that it is not necessary to use pio_gpio_init for input pins. However, uncommenting this command made my code work correctly on the RP2350. It also still works correctly on the RP2040.

Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Thanks! I don't have any PDM mikes to test so user patched like this are appreciated!

@earlephilhower earlephilhower merged commit 3e24400 into earlephilhower:master Sep 9, 2024
20 checks passed
This pull request was closed.
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.

2 participants