Hello, we are capturing sound with a PDM mic, and sending it to a codec through I2S. We have tested the I2S with software generated pure tones, and it is working properly. When we send the mic sound to the coded it is distorted so we think the problem is related to the microphone missconfiguration.
There are two interrupts, one for I2S, another for the PDM. We are using nordic drivers for both. The PDM buffer is copied in a "for loop" into the I2S when both interrup handlers mark the buffer release event.
The microphone is configured for data capture on clk rise, mono. Desired sampling is 16KHz.
Thanks in advance for reviewing the code.
this is the main code: