PDM clock not generated
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).
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.
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.
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.
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.