2016-09-29 03:14 PM
Hi.
I'm generating a stereo sinewave with the BSP_AUDIO routines and notice that the frequency of the generated waveform changes randomly with a couple of cents in either direction. How stable is the word clock from the SAI unit? Is it possible to get data on this and how can this problem be addressed?2016-09-29 06:06 PM
You'd have to look at the BOM to figure the ppm rating of the crystal used, and then look at the PLL/VCO performance. You should be able to export internal clocks via MCO/MCO2 pins. Would probably look at those wrt a precise reference both for accuracy and jitter. You could play with the PLL comparison frequency, which as I recall should be in the 1-2MHz range, and the VCO frequency >192MHz (at least in earlier F4 specs).
A TCXO source for HSE would be significantly more stable. If you are using HSI that is very variable, and not suitable for CAN/USB applications.2016-09-30 06:29 AM
Thanks for your reply. There were four candidates of oscillators in the bill of materials. Three of them were +-50ppm and the other +-20ppm. I can say for sure that the word clock in the BSP_AUDIO library is way off those specifications. I thought most clocks were derived from a main clock with prescalers but I may be wrong of course. From an audio viewpoint one musical cent is about 578ppm if I have calculated correctly. 50ppm would be very hard to detect by ear since it is less than one tenth of a musical cent. The drift of the word clock is slightly audible and apparent if played alongside a straight waveform or another recording of it.
2016-10-07 06:35 AM
It seems the internal RC oscillator (HSI) was activated by default and the HSE alternative was greymarked and couldn't be chosen since one had to enable it in the pin configuration for some reason. The HSI alternative was totally unsuitable for audio as you said. Thank you for your help.