microphone-library-for-pico icon indicating copy to clipboard operation
microphone-library-for-pico copied to clipboard

PDM clock not generated

Open viktorkesler opened this issue 6 months ago • 1 comments

I haven't connected a PDM Mic yet (waiting for it to arrive) but have noticed that the Serial output example does not generate a clock on GPIO3 but the USB example does.

I'm a beginner with RP2040 so have no hope of finding the difference in the two examples, I just need one example to work with RP2040 and a PDM mic.

The USB example causes Audacity to hang when the Pico is attached (without a PDM mic).

viktorkesler avatar Jun 12 '25 09:06 viktorkesler

Just to add that I've found that if I move the pdm_init, pdm_microphone_set_samples and pdm_start functions BEFORE the serial port initialisation i.e. before this bit:

stdio_init_all(); while (!tud_cdc_connected()) { tight_loop_contents(); } printf("hello PDM microphone\n");

I do get a clock on GPIO3 and (since I still haven't got a MIC) connecting GPIO2 (DATA) to 3V3 gives a 0 output and leaving it open or connecting to GND gives a -512 output.

viktorkesler avatar Jun 13 '25 07:06 viktorkesler

Hi @viktorkesler,

tud_cdc_connected() wait for the USB serial port to be open, so in the original example code the microphone will be initialized after this.

sandeepmistry avatar Jun 23 '25 15:06 sandeepmistry

Thanks for your reply but I'm not quite sure what you are saying.

I realise the microphone is initialised after

tud_cdc_connected()

in the original code.

But that doesn't generate a clock on GPIO3. Hence my previous message.

viktorkesler avatar Jun 24 '25 11:06 viktorkesler

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 23 '25 11:08 stale[bot]