Clock configuration for I2S audio for STM32H7A3
Can someone help me with a clock configuration for STM32H7 with 8mhz crystal (I can change it if need) so I can get 0% drift for 44100Hz Audio?
Can someone help me with a clock configuration for STM32H7 with 8mhz crystal (I can change it if need) so I can get 0% drift for 44100Hz Audio?
I think, you want not "drift", but just exactly 44k1 I2S frequency.
With a 8M source, it might be difficult to get it...i just tried, but no 100% match possible.
So other way:
But the 100% "simple, but clean" way is to use a crystal with an audio frequency, typical 16.9344 M or 11.2896 M. (384 or 256 x Fs 44k1)
If you can "live" with this (all clocks in cpu clock tree then "wrong", no clean 400MHz master clock, no easy 19200 serial connection possible....but "clean" 44k1 for I2S .
3rd way is to use the standard master clock and connect the I2S DAC as master, with its own 16.9344 M clock, i do it this way. But only possible, if the DAC or codec can be I2S master.
4rd way : the H743 ,( i use this), has an dedicated I2S clock input . (guess why ? standard problem for audio, to get the exact frequencies; so most "hi-end" devices go this way, just have 2 crystal oscillators , to switch between all 44k1 and 48k based frequencies)
So you could use a 16.9344 M or 11.2896 M oscillator, your "new master clock for audio" and connect it to the I2S clock-in :

The core, cpu, still on its standard 8M as it is...clock tree as you like it - just the SAI can run now on the audio master clock.
btw for I2S , use the SAI blocks, setting on I2S mode : they work perfect , better than the "I2S" on SPI .
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.