raspberry pi – Trying to drive a I2S MEMS microhpone (SPH0645LM4H) using RP2040 PIO but timing seems bad and I dont get any audio back

So I want to connecte an i2s MEMS microhpone to a RP2040.
I have made a PIO program that looks like this:

.wrap_target
    set pins, 1
    set pins, 0
.wrap

% c-sdk {
// this is a raw helper function for use by the user which sets up the GPIO output, and configures the SM to output on a particular pin

void blink_program_init(PIO pio, uint sm, uint offset, uint pin) {
   pio_gpio_init(pio, pin);
   pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, true);
   pio_sm_config c = blink_program_get_default_config(offset);
   float divider = 20;
   sm_config_set_clkdiv(&c, divider);
   sm_config_set_set_pins(&c, pin, 1);
   pio_sm_init(pio, sm, offset, &c);
}
%}

So very simple. I also adjusted the clock speed so that one cycle would be 333 nS

My problem is that

  1. It seem like the timing is wrong quite frequently. Why could this be?
    Timing is off at times

  2. I dont get any audio data back from the MEMS microphone, There are something happening but I do not think it should look like this
    No audio data coming back

Here is my breadboard, note that the colors of the cables corresponds to the logic analyser channel colors
My breadboard

These are the cable colors:

Yellow -> I2S, Clock

Green -> LRCL / WS / Frame Select

Blue -> DATA OUT

Any idea where I can start troubleshooting?

Read more here: Source link