This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Jumping to function after timer interrupt

In my program, I have a periodic timer interrupt written in C.

What I need to achieve is to have the interrupt service routine jump to another function after the interrupt service routine is executed.

However, the catch is that the address of the function (which the program is suppose to jump) is stored as a variable (which is not fixed each time the interrupt occurs).

Im looking for advice on how can this possibly be done. Thank you.

  • It is working fine but I would appreciate any more opinions on the idea of implementing pre-emptive multitasking on the '51.
    Let me give you "opinions on not implementing PEM (pre-emptive multitasking) on the '51."

    1) The '51 is a microcontroller and microcontrollers are not made for number crunching, but for rapid response to external events. This ability, which is the only one i know for selecting a microcontroller over a microprocessor will be totally lost if PEM is implemented.

    2) If more than one task is to be performed, the correct way to do so with microcontrollers is to make a "uC farm" e.g. one processor handling operator I/O, another handling the actual process and a third communication with the outside world.
    In such a scenario you could use say 3 LPC932 chips at $1 each, so why screw around with killing the performance in order to use a $10 processor instead of 3 $1 processors.

    If you want to implement PEM, do it on a processor suited for it. You take your car, not your riding lawnmower when you go to the grocery store I presume.

    Erik