2019-10-04 09:23 AM
Hi,
I would like to know if I can use STM32F446 and generate 192k I2s output. consider I need to use USB_OTG_HS.
I am trying to setup pins and clock configuration in STMCube, but for the I2S_APB1 it gives me range of 172MHZ to 192. and even with 192 in the configuration for I2S2(Master) it says the error between selected and real value is 2.8% how can I get 0%
Thanks
Neda
2019-10-05 02:16 AM
Are you talking about CubeMX?
What is your input clock source?
Do you intend to use USB_OTG_HS with internal or external PHY?
What is I2S_APB1?
What about reading the RCC chapter and calculating the needed values for PLL yourself?
JW
2019-10-07 08:58 AM
Hi JW,
thanks for your respond.
Are you talking about CubeMX?
Yes I am using CubeMX.
What is your input clock source?
I am trying to use 12MHZ, or 18.432MHZ.(haven't pick one. but this is for Audio device)
Do you intend to use USB_OTG_HS with internal or external PHY?
I want use USB_OTG_HS with external PHY.
What is I2S_APB1?
I2S_APB1 clock is the clock for I2S.
What about reading the RCC chapter and calculating the needed values for PLL yourself?
I gonna review that.
2019-10-07 03:05 PM
Hi JW,
I did more research and read previous post regarding same issues with other STM families.
I still have the issue and based on the STM32F446 Reference manual fS = I2SxCLK / [(32*2)*((2*I2SDIV)+ODD)*4)] when the channel frame is 32-bit wide and we know I2SDIV can't be 0 or 1. so for I2SDIV=2, ODD=0,fs=192khz, I2SCLK is 196.6 but in the STCUBMX there is limit for I2S_APB1 CLK with the max value of 192Mhz.
2019-10-07 03:05 PM
2019-10-07 03:06 PM
if I disable master clock output on I2S2 it will not give me the above error.
2019-10-08 09:47 AM
SAI is a dedicated peripheral for I2S and other audio protocols. I recommend using that. With 18,432 MHz crystal...
M = 10
N = 147 / 160
Q = 2
QDiv = 12 / 6 / 3
And you've got perfect 44,1/48 kHz and respective double and quadruple frequencies. Multiplied with 256 of course, which is what you typically need for I2S master clock.
Use this to find ideal multipliers/dividers:
http://www.alcula.com/calculators/math/simplify-fractions/
And for example take a look at my message there:
P.S. Yes, there is a message from me with two images... In this parody of a forum you'll have to press "Show previous answers" to show the last (my) message at... beginning!
2019-10-08 02:15 PM
Hi Piranha,
since I am using USB HS with internal PHY i can't use SAI.
2019-10-08 02:22 PM
sorry, I meant external Phy.
2019-10-09 01:39 AM