Interrupts - MC9S12XDT512MAA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupts - MC9S12XDT512MAA

3,408 Views
Gerald1
Contributor I
are there software interrupts (!= hardware interrupts like, signal rises to high on a port) existing on a MC9S12XDT512MAA?

cu
 
 
 
 
 
 
 
 
 
 
 
Added p/n to subject.


Message Edited by NLFSJ on 2008-02-11 01:55 PM
Labels (1)
0 Kudos
Reply
4 Replies

1,148 Views
Gerald1
Contributor I
i am using the codewarrior c-compiler.

in the headerfile (mc9s12xdt512.h) i saw:
/**************** interrupt vector table ****************/
#define Vswi                    0x0000FFF6

//---------------------------------------------------------------
//my code:

#pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module.

interrupt void Vswi(void)
{
        // ...code...
}

#pragma CODE_SEG DEFAULT

how should i enable swi interrupt by using -> EnableInterrupts?
and how could i set and clear the swi interrupt?

bye
0 Kudos
Reply

1,148 Views
Steve
NXP Employee
NXP Employee
SWI does not need to be enabled or disabled and there is no flag clearing required - see the SWI instruction in the CPU glossary for more info.
If you need more control or more software interrupts you can use the XGATE software triggers (there are 8 in the XGSWT register) but remember to direct them to the CPU. In that case you will need to enable interrupts (CLI) and clear the relevant flag on completion.
0 Kudos
Reply

1,148 Views
JimDon
Senior Contributor III

Also be aware that some Freescale debuggers use SWI for code running in ram and that some RTK's use it to switch task (UCOS for sure).

You may wish to find another mechanism to accomplish this.
0 Kudos
Reply

1,148 Views
DPB
NXP Employee
NXP Employee
Hello

There is indeed a software interrupt available on this device in the form of the SWI instruction.
This is a non-maskable interrupt and is listed in the interrupt vector table on page 73 of the S12XD-Family reference manual.
It is described in more detail on page 351 of the associated CPU reference manual at.....
http://www.freescale.com/files/microcontrollers/doc/ref_manual/S12XCPUV1.pdf?fpsp=1

DPB
0 Kudos
Reply