I am trying to get a PCMD3140 working with two PDM mics connected to PDMDIN1_GPI1 (one mic has the select high and one has select low) and both getting their clocks from PDMCLK_GPO1. The output is configured as I2S. I am able to get get audio from CH1 (the mic with select low), but CH2 is always just 0's. I believe that I have followed the initialization sequence shown in the data sheet's Detailed Design Procedure, but I still get nothing from CH2. Pseudocode for my initialization is:
Reg Name | Reg Addr | Data | Description |
// Delay 1ms | |||
SLEEP_CFG | P0_R2 | 0x81 | // Wake-up device by write into SLEEP_CFG register using internal AREG |
// Delay 1ms | |||
ASI_CFG0 | P0_R7 | 0x70 | // Set 32-bit I2S mode |
ASI_CH1 | P0_R11 | 0x00 | // Ch1 -> left slot 0 for I2S |
ASI_CH2 | P0_R12 | 0x20 | // Ch2 -> right slot 0 for I2S |
CH2_CFG0 | P0_R65 | 0x40 | // ch2 mic input is enabled |
BIAS_CFG | P0_R59 | 0x00 | // Configure MICBIAS_GPI2 pin as MIC_BIAS = Vref (2.750 V, 2.500 V, or 1.375 V) |
GPO_CFG0 | P0_R34 | 0x41 | // Configure GPO1 as PDMCLK, driven active-low and active-high |
GPI_CFG0 | P0_R43 | 0x40 | // Configure GPI1 as PDMDIN1 and GPI2 as disabled |
IN_CH_EN | P0_R115 | 0xC0 | // Enable Input Ch-1 and Ch-2. Disable Input Ch-3 and Ch-4 |
ASI_OUT_CH_EN | P0_R116 | 0xC0 | // Enable ASI Output Ch-1 and Ch-2. Disable ASI Output Ch-3 and Ch-4 |
PWR_CFG | P0_R117 | 0x60 | // Power-up ADC and PLL |
// Start I2S clocks |
Note that after the I2S clocks are started, if I read the DEV_STS0 register, I get 0xC0, which indicates that CH1 and CH2 are powered up. The left I2S slot has the Ch1 audio, while the right I2S slot has all 0's.
I've tried swapping the initialization of ASI_CH1 and ASI_CH2 so that CH1 goes to the right slot 0 and CH2 goes to left slot 0. This causes the Ch1 to come out in the right slot, but nothing comes out on the left slot.
I tried looking at the data on the PDMDIN_GPI1 pin and I see that there is data on both the rising and falling edges, so it appears that both mics are functioning.
Is there something obvious that I'm missing in my initialization?