Announcement

Collapse
No announcement yet.

Are Interrupts possible in designer environment

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Are Interrupts possible in designer environment

    Hello forum,

    I am using the gen4 uLCD 70-DCT-CLB and the designer environment.

    Is it possible to interrrupt my main function with another shorter functionroutine every 20 ms?
    In the internal functions i only found sys_SetTimerEvent(TIMER,FUNCTION);
    I think this function only starts if the active function is finished. (This is not quick enough for my program)

    Can you please explain me how the Timer- and Event-functions work and how they can be used.
    Do you know if it is possible to make interrupts in another way?

    Best regards
    Padd
    Last edited by Padd; 16 August 2021, 05:40 PM.

  • #2
    Hi,

    Can you please explain me how the Timer- and Event-functions work and how they can be used.
    The Timer functions are discussed in the manual. You can find their descriptions of how they work and how they can be used in the program. Also, the sys_SetTimerEvent(TIMER, FUNCTION) calls a function after the timer reaches zero.

    To achieve running a function routine every 20ms, you can try and modify the example project attached for your reference.

    Best Regards
    Attached Files

    Comment


    • #3
      Hi Ivan,

      Thank you for your answer and the example project.

      It will be helpful if you answer me still one question:
      My main-program works in a repeat forever loop.
      Is it possible that the Timerevent function will stop the repeat loop, work the interrupt and then continue the main program?
      In my project i tried this Timer event function and my main program always worked till the end and then started the interrupt routine.
      My fastest run of the program without the interrupt is ~120 loops/1 second. With the Timer event function i always reach max. the same velocity.
      I only can slow the speed down.

      Did i do something wrong or isnt it possible to achive that?

      Best regards
      Padd

      Comment


      • #4
        Interrupts occur at the end of the current instruction, so if you use a pause of 2 seconds, you interrupt will effectively pause for that 2 seconds.

        If you display an image that takes 250ms then your interrupt will effectively pause for 250ms.

        Other than that it will fire every 20ms as expected.

        You are not describing what you think is happening very well, if it isn't covered as described above please either describe it more concisely, or, better still, provide a small example.
        Mark

        Comment

        Working...
        X