libraries/PDM/src/rp2040/pdm.pio.h: pio_gpio_init data in pin. #2432
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.