Skip to main content
joecarlhr
Associate II
March 24, 2014
Question

Timer interrupts are not running on time.

  • March 24, 2014
  • 2 replies
  • 675 views
Posted on March 24, 2014 at 01:09

Hello, I'm programing a VGA signal with the STM32 discovery board. I'm using a timer to generate sync pulses and everything seems to work fine since the image shows static in the monitor. But there are some glitches, the image is not static 100%  some rows are shifted to the right. I've tried every possible thing to fix this... and nothing worked.

POSSIBLE REASON:

(might not be the real reason)

I've discovered it's due to calling functions in my main program. It seems that if a function is called just before an interrupt then the interrupt is called some microseconds after, and this is why some rows are shifted to the right in my monitor. If I just run plain instructions in my main loop then this bug doesn't happen, but I need to call some functions in my main loop, so this is not a solution...

Is there any way to configure this processor to run interrupts right when they should run.

Thanks in advance.
    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    March 24, 2014
    Posted on March 24, 2014 at 01:47

    What if you run code in RAM vs FLASH, and without PUSH/POP instructions? ie Load/Store Multiple

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    joecarlhr
    joecarlhrAuthor
    Associate II
    March 24, 2014
    Posted on March 24, 2014 at 12:54

    Thanks for your answer. I'm sorry but I'm new to stm32 and don't know what you mean with ''run code in ram vs flash''. Don't know what ''load/store multiple'' is nor how to use it. I googled it but really couldnt understand how this could solve my problem. Could you please explain?

    Thanks so much in advance.