Close

Board bringup & full duplex I2S

A project log for Ultimate 4 channel audio recorder

Portable, 2 channel, balanced input, 24 bit 96khz recording

lion-mclionheadlion mclionhead 01/11/2018 at 09:270 Comments

Once the usual GPIO snafus were fixed, attention turned to using the AK4524's built in DAC for monitoring.  Banging on this discontinued chip isn't so bad when you consider guys are going around building computers out of 6502's.

C11 didn't work as I2S3ext_SD.  Only B4 did.  The datasheet had a buried nugget about aux function GPIO_AF_I2S3ext having to be selected for C11 while the aux function was GPIO_AF_SPI3 for B4.  No amount of register banging could send data out of C11.  What did help was printing the contents of SPI3->I2SCFGR & I2S3ext->I2SCFGR to verify the key registers were being set correctly.  Also review the I2S_FullDuplexConfig, I2S_Init functions.  Once full duplex is enabled, you have to use I2S3ext registers to send or receive data using the ext_SD pin & the I2S3 registers to access the SD pin.  Both pins can be inputs or outputs.  

The timing of when to send what 16 bits to the DR register to reconstruct 2 channel 24 bit samples is a bit tricky.  Similar to a state machine which uses the channel side bit & a counter to sort the 16 bit reads from the DR register, another state machine must use the same bits to sort 16 bit writes.  Not sure how people do it with DMA, but it definitely must be done with polling to downmix the 4 input channels & monitor audio without latency.  

Discussions