Shop OBEX P1 Docs P2 Docs Learn Events
Software Interrupt — Parallax Forums

Software Interrupt

pjvpjv Posts: 1,903
edited 2005-03-03 18:04 in General Discussion
Hi All;

Does anyone know of a method to invoke an interrupt from software?

Preferably some trick that does not use a write to an I/O pin or messing with the RTCC?

Peter (pjv)
·

Comments

  • Jim PalmerJim Palmer Posts: 23
    edited 2005-03-03 17:41
    Sorry Peter, but I don't know the answer. However, you did get me curious. In the end is your goal to execute the code in your Interrupt from another place in your program? Or to execute the code in your Interrupt with the processor pushing state onto the stack and then poping it upon return?

    Jim
  • pjvpjv Posts: 1,903
    edited 2005-03-03 18:04
    Hi Jim;

    My use for it is in my RTOS; its's nice to get a copy of the state of the processor without affecting that state of the very registers that need saving.

    My current approach is somewhat unelegant, and I would like to improve and shorten it.

    I know that in both the SX28 and SX52 and interrupt can be forced if one has an RB bit enabled for MULTI-WAKEUP, and then in software setting (or as the case may be, clearing) that bit. But this gives new complications with interrupt determinism if one also still requires response to the RTCC roll-over interrupt.

    Oh well....will have to write some code on iterrupt entry to take care of that. I just hate these work-arounds.

    As far as pushing stuff onto the stacks, and popping them on return, this can also be done while NOT in interrupt. In fact, that is the basis of my RTOS. Just push the state you want onto the stacks, and then execute an RETI to cause the processor to assume that state. Works great, but has some potential conflicts with SXSKey debugging.

    Peter
Sign In or Register to comment.