[quote:5422ff1920="Flyby123"]Till now I tested all the routines and nothing running beside that.
I will test the various codes & options in larger programs with other time & interrupt critical routines and give some feedback on performance.[/quote:5422ff1920]
The ASM-version should work well and don't disturb other code that much, included interrupt code.
But sure, I'm interested to hear about your results.
[quote:5422ff1920]The color sequence vs array pos. I stated are for those interested in coding/addressing the ledarr() in such way that only led position and color is needed (maybe with overlays and such).[/quote:5422ff1920]
You don't need an overlay, the led-array is already one linear array. For setting the color, only the desired led has to be multiplied by 3 and an offset added for each colour, you can do that in a sub().
[quote:5422ff1920]For that matter, it is the same sequence in both the "ASM NOP snake" and the DMA based code.[/quote:5422ff1920]
Also the NOP-snake can do the job, it depends on the desired update-rate, convenience of use and whether other interrupts are active.
For example: the snake doesn't like to be interrupted, it would destroy the timing.
For using it with interrupts, you need to disable interrupts before executing and re-enable them after.
My self-propelling DMA-code doesn't care, you only need to set other interrupts to a lower priority level.
So if you use it with other interrupts, make this change:
[code:1:5422ff1920]Config Dmach0 = ..., Tci = Hi ,... ' change interrupt priority for bot channels to Hi
Config Dmach1 = ..., Tci = Hi ,...
...
Config Priority = Static , Vector = Application , Lo = Enabled , Med = Enabled , Hi = Enabled[/code:1:5422ff1920]
and use Lo/Med for other interrupts. Also make sure that HW-stack is big enough.
↧