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



In article <46febcb4$0$37205$4fafbaef@xxxxxxxxxxxxxxxxxxx>, says...

<attributes stripped by previous poster>
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.

And if he is simple seeking to abort an operation setting a flag in the
interrupt routine and checking it in the routine you are interrupting is
fairly straightforward.

It seems an odd requirement. To the original poster, what is the effect
you are trying to achieve? Tell us what you are trying to do rather
than how you are proposing to do it. We might be able to suggest better
approaches.


Ok,thanks again.
I kept my question generic just because i thought that what i'm doing
specifically is less interesting.
.I'm trying to implement an USB protocol using a 9s12 microcontroller,that i
call uC
http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=0162468636bJwn

and a PDIUSBD12,a parallel to USB chip
http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=0162468636bJwn

It is raccomended that anytime an USB device receives a bus reset it has to
accomplish it,signalling by an interrupt to the uC,even at the price of
letting loose what is remaining of the current function.then it should stay
in an idle loop waiting for another request.

OK, that makes sense but don't take interrupt too literally in this
case. The key is that you want to stop the current function when a bus
reset occurs. How you accomplish that is a design decision.

One way is I suggested and set a flag in the interrupt and watch it in
your routine. Actually this sounds like a good place for a statechart
implementation.

A second approach would be to use an RTOS and 'kill' the thread
performing the function.

The biggest problem I see with the second approach and your originally
proposed solution is that you could leave the hardware in an unknown
state.


Hoping that what i wrote about USB is correct and not
misleading(please,correct me in this likely case) i wish you a nice Saturday
night.

I have no idea if you have the USB requirement correct, but there will
be others here who do.

Robert

--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • 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: AT91SAM7X256 watchdog interrupt
    ... WDFIEN: Watchdog Fault Interrupt Enable ... A Watchdog fault has no effect on interrupt. ... WDRSTEN: Watchdog Reset Enable ...
    (comp.arch.embedded)
  • Re: R: 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 ... It is raccomended that anytime an USB device receives a bus reset it ...
    (comp.arch.embedded)
  • USB Host controller on Davici TMS320DM6446
    ... Iam writing a standalone code for USB Host controller .... ... reset the HC ... Is anything else required to be initialized to get the interrupt?. ...
    (microsoft.public.windowsce.platbuilder)
  • R: R: hc12,can i return from interrupt and jump elsewhere?
    ... Tim Wescott wrote in message ... reception of an interrupt event, ... .I'm trying to implement an USB protocol using a 9s12 ... It is raccomended that anytime an USB device receives a bus reset it ...
    (comp.arch.embedded)