- Thu Nov 26, 2020 9:24 pm
#89571
Thanks for that - at the moment I have been assuming that all bits on will give me 32 but was still unsure, and that gives me the same rate as you if I use 4 and 13 as my scaler values.
I'll definitely try your settings as well - if it is truly only 31 bits then my values are out, but from the documentation on my I2S device, I am confused as to whether the bits even have an effect on the rate, and that all they do is affect the word clock. My I2S device data sheet says there must be 64 SCK cycles in each WS stereo frame (despite it being a 24 bit mic), which I think means I have to set my bits to 32 and my bit clock will need to be based on this.
I don't suppose you've done a trace of your bit/word clock to see what the behaviour is?
Also I remember seeing in documentation that there were minimum values for the divider and prescaler:
Code: Select allCLK_I2S = 160MHz / I2S_CLKM_DIV_NUM
BCLK = CLK_I2S / I2S_BCK_DIV_NUM
WS = BCLK/ 2 / (16 + I2S_BITS_MOD)
Note that I2S_CLKM_DIV_NUM must be >5 for I2S data
I2S_CLKM_DIV_NUM - 5-127
I2S_BCK_DIV_NUM - 2-127
Have you found this?