2009-03-25 05:40 AM
Problem with I2S in 24 bits mode
2011-05-17 04:07 AM
I am trying to use a STM32F103ZE to get data from a CODEC via the I2S interface with 24 bits data.
This is the init sequence :Code:
I2S_InitStructure.I2S_Mode = I2S_Mode_MasterRx; I2S_InitStructure.I2S_Standard = I2S_Standard_Phillips; I2S_InitStructure.I2S_DataFormat = I2S_DataFormat_24b; I2S_InitStructure.I2S_MCLKOutput = I2S_MCLKOutput_Enable; I2S_InitStructure.I2S_AudioFreq = I2S_AudioFreq_16k; I2S_InitStructure.I2S_CPOL = SPI_CPOL_Low; I2S_Init(SPI2, &I2S_InitStructure); and the read sequence :Code:
for (i=0; i<sizeof(buffer)/sizeof(u32); i++) { while(SPI_I2S_GetFlagStatus(SPI2,SPI_I2S_FLAG_RXNE)==RESET) ; buffer[i] = SPI_I2S_ReceiveData(SPI2) << 16; while(SPI_I2S_GetFlagStatus(SPI2,SPI_I2S_FLAG_RXNE)==RESET) ; buffer[i] |= SPI_I2S_ReceiveData(SPI2); } This is an example of the data I get : 0xFFFCA9FF 0xFFC1A200 0x0006E9FF 0xFEB01A00 0xFFF6D000 ... According to the STM32 Ref Manual, page 549 (Figure 213), the 8 LSB should be cleared. They are not ... Am I doing something wrong, or is it a bug in the STM32 I2S implementation ?2016-03-31 11:54 PM
hi,
I got the same problem. Have you found the solution to this?2016-04-01 01:05 AM
This is a five year old zombie thread. Please just open a new thread that fully decribes your own problem