2014-11-12 09:54 PM
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.2014-11-13 03:23 AM
2014-11-13 08:08 AM
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 ofhttp://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