Setting up interrupts

Started by Leighton Rowe April 15, 2005

Hey All,

I basically just started learning to program the mc9s12 family (with
Codewarrior). Luckily, I have an idea how to config the peripherals
because I previously worked extensively with ARM7 mcus (like lpc2000).
However I need a little help with setting up interrupts, as I'm not
yet used to the 9s12 interrupt vector mapping system...it's new to me.

In any event, what are the main things that I need to do?

It seems that "void __interrupt 0 _Startup(void)" defines the reset
handler. Should all handlers be defined this way? If yes, how will I
know which slot number to use (SCI1 THRE for example)?

thanks in advance,

Leighton




Hi Leighton,

I am also fairly new to programming micro's in C++, so I am sure
whether this is exactly how you're supposed to do it, but this is
what I am doing in my current project...

In the header I declare the interrupt like this:

static void interrupt ADCInt (void); // Handle ADC Interrupts

then in the cpp file, like this:

static void interrupt 22 ADC::ADCInt (void)
{
}

22 is the number of the interrupt vector for the ADC on my chip. You
can find a list of the vectors in the datasheet for your chip.

Hope this helps
Nicholas

Make sure you put the declarations and implementation of these into
non-banked memory. --- In 68HC12@68HC..., "Leighton Rowe" <leightonsrowe@y...>
wrote:
>
> Hey All,
>
> I basically just started learning to program the mc9s12 family
(with
> Codewarrior). Luckily, I have an idea how to config the peripherals
> because I previously worked extensively with ARM7 mcus (like
lpc2000).
> However I need a little help with setting up interrupts, as I'm not
> yet used to the 9s12 interrupt vector mapping system...it's new to
me.
>
> In any event, what are the main things that I need to do?
>
> It seems that "void __interrupt 0 _Startup(void)" defines the reset
> handler. Should all handlers be defined this way? If yes, how will
I
> know which slot number to use (SCI1 THRE for example)?
>
> thanks in advance,
>
> Leighton