Safety ISR for Microprocessing System

Thread Starter

jegues

Joined Sep 13, 2010
733
Hello all,

I'm trying to think about how to implement a safety feature in my microprocessing system if somehow an interrupt occurs.

My design is currently functional using only polling. However if an interrupt were to somehow occur, my microprocessing system should be able to handle this scenario in a safe and correct manner.

I plan on tieing the IRQ and NMI lines to 5V(they are active low) as a precaution, but as an engineer we must ensure that the design is able to handle the worst case scenarion that an interrupt occurs.

One of the two manners suggested to me for handling this interrupt in a safe manner was to have the microprocessor continually branch to itself if it is interrupted.

Another suggestion was made to that I could have it branch to another device and subesquently recieve have the microprocessor power itself down, powering down the device it branched to as well.

Does anyone else have any other suggestions for a suitable ISR routine? Any suggestions of the design of this routine?

Thanks again!
 

Georacer

Joined Nov 25, 2009
5,182
What do you mean by branching?

I don't think there is a universal answer to your question. In every system the critical parts differ.

For example, in an elevator, in case of a standard failure, you should always lower the cabin to the nearest floor and then maybe shut it down.

But in a ship computer, in case of a haul breach, you don't want the systems to shut down. Instead you might want to keep the lights on and the radio to continuously transmit the SOS signal.

Wanting to pass the control to a secondary microcontroller might be a superficial idea. If you can communicate with another device then your controller works and you don't really have a reason the send the system control elsewhere. If however you can diagnose internal problems, then you probably know your microcontrollers too good to ask these kind of questions.
 

Thread Starter

jegues

Joined Sep 13, 2010
733
What do you mean by branching?

I don't think there is a universal answer to your question. In every system the critical parts differ.

For example, in an elevator, in case of a standard failure, you should always lower the cabin to the nearest floor and then maybe shut it down.

But in a ship computer, in case of a haul breach, you don't want the systems to shut down. Instead you might want to keep the lights on and the radio to continuously transmit the SOS signal.

Wanting to pass the control to a secondary microcontroller might be a superficial idea. If you can communicate with another device then your controller works and you don't really have a reason the send the system control elsewhere. If however you can diagnose internal problems, then you probably know your microcontrollers too good to ask these kind of questions.
By branching I mean executing a branch instruction. I can't think how to temporarily hand over control to another device and have the microprocessor shut down, so I might just have the processor branch to itself in an infinite loop waiting for a RESET.
 

hgmjr

Joined Jan 28, 2005
9,027
One technique would involve creating a simple interrupt service routine that contains only the instruction IRET (Return from Interrupt) or whatever instruction is equivalent for your processor. Then you arrange for all of the interrupt vectors to point to this routine.

hgmjr
 
Top