Interrupt routines

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
marke
Posts: 32
Joined: 28 Jan 2014 05:59

Interrupt routines

#1 Post by marke » 18 Jun 2019 11:00

Hi

It appears that a weakness with the mikroC PRO for ARM, is a limitation on what you can do and call from within an interrupt.
My code is often very interrupt driven because I need realtime control and processing. Setting flags for routines to run outside of an interrupt leads to significant timing problems.

Is it possible to increase the Stack allocation to allow more stack intensive code on existing compilers?
Is this to be addressed in upcomming compilers?

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

Re: Interrupt routines

#2 Post by rajkovic » 08 Jul 2019 10:27

Hello marke

could you be more specific about problem you are having with using function from interrupt and stack allocation.

Are you receiving warning from compiler about possible stack problems with recursion and crosscalling
or you have real-run-time problem that app crashes.

marke
Posts: 32
Joined: 28 Jan 2014 05:59

Re: Interrupt routines

#3 Post by marke » 10 Jul 2019 09:45

Hello rajkovic

Yes, I have had problems where the code has not run, and got lost.
If I set up a system tick interrupt and use this to call other routines based on time slots, I have found that the code gets lost.
If I use the same routines and get the system tick interrupt to set flags based on time slots, then use are flag detection loop in the main loop and branch to these routines based on the flags set, everything works fine but I can not afford to have any "slow" code running either in, or branched from the main loop.
For real time operation, I need to run the routines under interrupt rather than the flag redirection.
The individual routines are quite short, but if I want to work with say an LCD output in the main loop, this will interfere with the real time operation due to the "waits" in the LCD code.

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: Interrupt routines

#4 Post by filip.grujcic » 10 Jul 2019 11:44

Hi Marke,

Would it be possible for you to zip and attach the project you've had issues with when calling functions straight from the interrupt itself?

Kind regards,
Filip Grujcic

Post Reply

Return to “mikroC PRO for ARM General”