Re: hc12,can i return from interrupt and jump elsewhere?



On Sat, 29 Sep 2007 14:55:09 +0200, "blisca"
<bliscachiocciolinatiscali.it> wrote:

Hello from Milan ,Italy,
i'm programming a 9s12 uC in C language,with occasional assembly inserts;

the question is:

a function myfunc() is runnin,and an external events calls an interrupt
service routine,is it possible,once the interrupt did its job,to avoid to
continue with my func()
from the point where it was interruptd,and going back to main() instead?It
is not important if i have to run another couple of line in
myfunc().Important is that i can go out from it soon;

Can anyone suggest me the most elegant way?
Once more forgive my English.

If all you want is to restart your code, i.e. re-enter main from the
start, then you can use a watchdog reset. Just stop toggleing your
watchdog when you get your event. The watchdog will trigger, and
restart your micro. If you want to resume a sepcific function on
reception of an interrupt event, then this is less trivial. Unless you
want to write your own RTOS, the simplest is to use either one of the
many open source ones, or a commercial one.
http://www.freertos.org/ seem to have a port for your micro.

Regards
Anton Erasmus

.



Relevant Pages

  • Re: hc12,can i return from interrupt and jump elsewhere?
    ... a function myfunc() is runnin,and an external events calls an interrupt ... service routine,is it possible,once the interrupt did its job,to avoid to ... then you can use a watchdog reset. ... interrupt routine and checking it in the routine you are interrupting is ...
    (comp.arch.embedded)
  • Re: AT91SAM7X256 watchdog interrupt
    ... WDFIEN: Watchdog Fault Interrupt Enable ... A Watchdog fault has no effect on interrupt. ... WDRSTEN: Watchdog Reset Enable ...
    (comp.arch.embedded)
  • Re: AT91SAM7X256 watchdog interrupt
    ... watchdog, in order to set the correct handle for the interrupt. ... A Watchdog fault has no effect on interrupt. ... WDRSTEN: Watchdog Reset Enable ...
    (comp.arch.embedded)
  • Re: R: hc12,can i return from interrupt and jump elsewhere?
    ... then you can use a watchdog reset. ... reception of an interrupt event, ... .I'm trying to implement an USB protocol using a 9s12 microcontroller,that i ... It is raccomended that anytime an USB device receives a bus reset it has to ...
    (comp.arch.embedded)
  • Re: Whats the modern way to dim AC lights?
    ... When the timer timed down it generated another interrupt ... which then turned on a triac for the remainder of that half-cycle. ... what would be the modern way to do this via micro? ...
    (comp.arch.embedded)