Interrupts - MC9S12XDT512MAA

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Interrupts - MC9S12XDT512MAA

2,711件の閲覧回数
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
ラベル(1)
0 件の賞賛
4 返答(返信)

451件の閲覧回数
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 件の賞賛

451件の閲覧回数
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 件の賞賛

451件の閲覧回数
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 件の賞賛

451件の閲覧回数
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 件の賞賛