Page 1 of 1

Interrupt routines

Posted: 18 Jun 2019 11:00
by marke
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?

Re: Interrupt routines

Posted: 08 Jul 2019 10:27
by rajkovic
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.

Re: Interrupt routines

Posted: 10 Jul 2019 09:45
by marke
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.

Re: Interrupt routines

Posted: 10 Jul 2019 11:44
by filip.grujcic
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,