cancel
Showing results for 
Search instead for 
Did you mean: 

How did I miss this? 32KHz/64KHz DMA using LSE

gregstm
Senior III

Just in case others have missed this feature (like I did).

You can generate DMA at 32768Hz and even 65536Hz rates with the LSE if you use the "TIM15 input capture 1 is connected to LSE" option and set the timer to "input capture" mode and capture one/both high/low edges (I'm using the STM32L476).

This allows me to send out my audio at a higher rate than the 16KHz that I thought was the maximum, allowing me to filter out more of my "wavetable" noise easier.

I also mention this because I remember someone was trying to get a higher update rate from the LSE and thought that the only way that this could be done was to connect the MCO externally to one of the timer's inputs (they had already allocated the MCO pin to other hardware)

4 REPLIES 4
Peter BENSCH
ST Employee

Thank you very much, @Community member​ , for this interesting contribution!

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

No probs, I hope it helps someone. I was stunned I almost missed this feature. I've been concentrating on audio input for ages where a 16KHz input frequency is fine for music/voice frequency analysis, but I've now turned my attention to audio output/amplifiers, and the higher DAC frequency has made the sine/sound waves I output much cleaner using just a second order passive filter (plus using a 4096 size sine table helps too...).

Maybe this info can be included in one of the application notes in some form. For those who want to use the LSE as the sole high accuracy clock source for audio applications, this is something worth highlighting.

Nice trick.

However, note, that while accurate in long term, LSE may be jittery, due to ​small variations of LSE oscillator's DC level and exact decision point of the input "discriminator" (amplifier/comparator/whatever). We've seen reports of this here on forum.

JW​

Hi @Community member​ ,

I join @Peter BENSCH​  to thank you for your contribution.

A nice way to demonstrate this feature and share your expertise with other community members is to upload your project here. For sure this is just a proposal.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.