library for driving leds with stm32f103

Working libraries, libraries being ported and related hardware
User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: library for driving leds with stm32f103

Post by RogerClark » Thu Sep 14, 2017 12:05 am

Thanks...

Sounds like a good system.

Encoding on the fly means that you don't need to hold a large "encoded" buffer, which is extra important if you need to double buffer the whole "pixel" string RGB data.

For multiple strings the ISR latency is something worth putting up with.... There have been several interesting threads about external trigger ISR latency, which varies depending if the ISR vector is shared across multiple pins or not.
I suspect in your case, the ISR vector will not be shared, otherwise the code would be less efficient.
In fact, I'm not sure about latency of ISR's when triggered by a timer, and whether this is as slow as external GPIO triggering, or how much call overhead there is.

We briefly investigated trying to optimise the shared ISR latency, but can only shave about 10 % off the speed. (but this won't apply to your usage)

octavio
Posts: 42
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona
Contact:

Re: library for driving leds with stm32f103

Post by octavio » Thu Sep 14, 2017 1:49 pm

To avoid latency problems the irq priority is set higher than default

Code: Select all

 nvic_irq_set_priority(NVIC_DMA_CH1,14);

so the ISR will run even if there is another ISR with low priority active.The timer controls dma transfer and dma calls the ISR when half buffer is written,so there is some time until the other half buffer is send.Dma and vector is not shared else would not work because i don't reprogram dma on every transfer,my code just start or stops the timer.

Post Reply