Identifying Interrupts

Started by Shayne C. Rich November 12, 2004
I have an operating system running on a 9S12DP256. I seem to be getting
spurious interrupts. I have directed all interrupts that I am not using
for my application to a sort of trap ISR. I was wondering though, is
there a way to tell which interrupt fired without writing a different
ISR for each interrupt?

I am using the ImageCraft C compiler. The operating system is one of my
own design.

Thanks,

Shayne C. Rich
Spectre Engineering Support, Inc.





If you had a full-emulator, the trace would show you which interrupt vector
took place, and the entire execution history that led to the situation.

Otherwise, I think there is no easy way. You need to write a separate ISR
for every interrupt, or it least to ones you suspect.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 07:09 12/11/2004 -0700, you wrote:

>I have an operating system running on a 9S12DP256. I seem to be getting
>spurious interrupts. I have directed all interrupts that I am not using
>for my application to a sort of trap ISR. I was wondering though, is
>there a way to tell which interrupt fired without writing a different
>ISR for each interrupt?
>
>I am using the ImageCraft C compiler. The operating system is one of my
>own design.
>
>Thanks,
>
>Shayne C. Rich
>Spectre Engineering Support, Inc. >
>
>Yahoo! Groups Links >
>






In a message dated 11/12/04 9:13:40 A.M. Eastern Standard Time,
writes:

I was wondering though, is
there a way to tell which interrupt fired without writing a different
ISR for each interrupt?
=========================
I think having a handler for each interrupt is an excellent idea. Specially
for debug. Too much typing? Cut n paste.


Doron Fael <> wrote:

> If you had a full-emulator, the trace would show you which interrupt vector
> took place, and the entire execution history that led to the situation.
>
> Otherwise, I think there is no easy way. You need to write a separate ISR
> for every interrupt, or it least to ones you suspect.

That's the way to do it, and IMHO it _is_ easy.

Since spurious interrupts can occur also when the device is shipped,
but I can't deliver a full emulator with each <g>, I have in most
devices a trap for each ISR, either logging (e.g. to EEPROM) or
displaying an error.

In assembler, that's rather compact since it consists of

ldd #vector_ID
jmp trap_handler

line pairs or a list of "jsr trap" statements (pop the return address
from the stack => you know where it came from).

Oliver
--
Oliver Betz, Muenchen