Hello
I have EK-TM4C123GLX Launchpad and trying to write a program for led driver application. The program doing what is intended, but it is too slow. I’m newbie with Tiva controllers, so please don’t ignore my questions even they could look dumb.
I using ccs.v6 and tivaware 2.1.0.12573. Let me explain where I’m struggling. To be more precise, I attached few scope captures and whole project.
The pic.1 is whole frame, it consist of 8 burst, with changing timing between the bursts. But this frame is too long for my application. It is 10.7ms. And I need it reduce to about 1ms. As all frames dependent on shortest duration between bursts, I must reduce this shortest duration.
Now lets see the first burst. (Pic.2) It last 6us, including delay time, to toggle latch. Its good enough, just this delay time could be reduced.
1) Question, how can I reduce this delay time. It consist of recognizing the SSI not busy, and toggling signal by itself (see procedure toggle_latch) I also experimented with interrupt from SSI module, but it was even bigger delay, and also more latch signals than I need, so I dropped it.
Then lets see at first and second bursts. (pic3) The time between them, is 51us (time between latch signals). I want to reduce it down to 10us It will give me correct time for whole frame. So I must adjust timer 0 delay.
After adjusting timer 0 delay, frame length now acceptable. (pic4) The problem is, it is affecting whole frame length, but not affecting the shortest delays. (pict5) Looks like controller cant service Timer0IntHandler during short time. Only 4’th burst has correct delay.
2) Question, how to optimize isr routine, to work faster. Guess dma restart function is time consuming (618 cycles). Do I really need to run this function on every DMA restart? Does it not enough to set some bits in registers to restart DMA
3) Question Does my aproatch to this problem is wrong. Does it possible to generate whole frame as DMA tasks? Scatter gather mode, any examples?