library for driving leds with stm32f103

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

Re: library for driving leds with stm32f103

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


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)

Posts: 44
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona

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


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.

Posts: 5
Joined: Thu Apr 30, 2015 12:41 am

Re: library for driving leds with stm32f103

Post by hackstage » Tue Feb 05, 2019 4:08 pm

I have been trying to modify the library to run 8 parallel outputs for RGBW leds for a couple of weeks now - but little luck so far. Can you give some advice on how it can be done? The previous comments on this forum have been very helpful!

Post Reply