Trying to connect a WCMCU-5102 (PCM-5102) to STM32H503CBU6
I successfully configured the I2S2 interface to a sample rate of 48KHz. The attached WCMCU-5102 is connected to these three wires.
I2S2_WS = PA3
I2S2_CK = PA5
I2S2_SDO = PB1
FLT = GND
DMP = GND
SCL = GND
FMT = GND
XMT = Vdd (3.3V)
static void MX_I2S2_Init(void)
{
/* USER CODE BEGIN I2S2_Init 0 */
/* USER CODE END I2S2_Init 0 */
/* USER CODE BEGIN I2S2_Init 1 */
/* USER CODE END I2S2_Init 1 */
hi2s2.Instance = SPI2;
hi2s2.Init.Mode = I2S_MODE_MASTER_TX;
hi2s2.Init.Standard = I2S_STANDARD_PHILIPS;
hi2s2.Init.DataFormat = I2S_DATAFORMAT_16B;
hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_48K;
hi2s2.Init.CPOL = I2S_CPOL_LOW;
hi2s2.Init.FirstBit = I2S_FIRSTBIT_MSB;
hi2s2.Init.WSInversion = I2S_WS_INVERSION_DISABLE;
hi2s2.Init.Data24BitAlignment = I2S_DATA_24BIT_ALIGNMENT_RIGHT;
hi2s2.Init.MasterKeepIOState = I2S_MASTER_KEEP_IO_STATE_DISABLE;
if (HAL_I2S_Init(&hi2s2) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN I2S2_Init 2 */
/* USER CODE END I2S2_Init 2 */
}
main.c has:
uint16_t test_amplitudes[] = {0,0,65535,65535};
while (1)
{
HAL_I2S_Transmit(&hi2s2, test_amplitudes, 4 ,5000);
}
My questions:
why don't I see any analog signal? I tested two devices to no avail.
The protocol sends two signals in one sample (L and R, during the I2S2_WS signal high/low phase).
How are the values organized in storage (RAM)? I'm assuming in sequence L,R,L,R ...
I'd be glad someone could enlighten me.
