cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use an internal RC oscillator to achieve an I2S master clock for a 48kHz sample rate ?

freeflyer
Senior II

I am trying to develop I2S master using the NUCLEO-L433RC-P, but struggling to achieve a master clock speed for 48kHz playback.

The I2S audio is working (using a MAX98357A I2S amplifier) and the master clock speed needs to be 12.88MHz (i.e. 48kHz x 256).  But with my current clock configuration it is 18.285MHz, so the playback speed is too fast.

freeflyer_0-1764186894800.png

 

 

I tried entering 12.888MHz as the SAI clock speed to resolve the configuration and it came up with the configuration below, but with this configuration my code does not run....

 

freeflyer_1-1764187135622.png

 

Is it possible to achieve 48kHz playback using the internal RC oscillators, or do I have to use the HSE ?

2 REPLIES 2
TDK
Super User

Sure it's possible. Here is one such clock configuration using MSI as the base.

TDK_1-1764259657250.png

 

No error, exact frequency. 12.288 Mhz (not 12.88 or 12.888).

TDK_2-1764259684913.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Thanks TDK

Your configuration does indeed generate the 12.888MHz, but the knock on effect is that the overall processor clock is drastically reduced.

I usually run the processor at 80MHz, but with you configuration it drops to 38.4MHz so the processor runs much slower for other tasks.

The best I could do was to set MSI to 8MHz to achieve 12.571Mhz for the I2S clock (I was trying to do this with the 8MHz HSE, but got it working with 8MHz MSI)....

freeflyer_0-1764262127953.png