cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 High speed DAC interupt + USART interrupt misses characters

rinwinte
Associate II
Posted on November 13, 2014 at 06:54

To drive my application I use two DAC in a interrupt. The data sended to the DAC needs to count up and count down between two variable(bits) so that it creates a triangular wave. The maximum value is 4095. 

The frequency of the wave needs to be around 100Hz. To create the wave I use TIM2 interrupt.

Sysclk = 180Mhz, Tim2Clk = 90Mhz. Interrupt frequency = 100Hz*(4096*2) = 819200 Hz.

Problem is that because of the interrupt frquency is 820kHz (what is really high) the Usart interupt routine misses some characters.

How can I solve this? The only thing i can come up with is to use DMA for the USART receiving. But better should be to cut the DAC loose from the CPU somehow.
11 REPLIES 11
rinwinte
Associate II
Posted on November 13, 2014 at 12:23

yes it is too high. I try to find me a solution to put it down by changing te code.

Posted on November 13, 2014 at 17:08

You could decimate the interrupt loading by using a small pattern buffer, and updating alternate pairs in the HT an TC DMA interrupts.

In the spirit of

http://en.wikipedia.org/wiki/Decimation_%28Roman_army%29

, you could have a 20 sample buffer (2 x 10), and update 10 samples at each 80 KHz interrupt instead of 1 @ 800 KHz
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..