XIRQ problem

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

XIRQ problem

2,997 Views
khumphri
NXP Employee
NXP Employee

This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.

 

Posted: Wed Dec 14, 2005  5:03 pm

 

Hi,

 

I'm using 9S12DP256DGV2 processor.

I would like to use XIRQ for power failed feature.

In PRM file, I declare Vectore 6 on my XIRQ callback like that:

 

VECTOR 6 FIP_isr

 

I see by scope that the hardware signal is OK. But my callback isn't called.

 

Have you got an idea about my problem???

Have I forgotten to do something???

 

Thanks in advance for your help.

 


 

Posted: Wed Dec 14, 2005  5:08 pm

 

Sorry I make a mistake in my previous message. I write that:

 

VECTOR 5 SURV_xirqISR

 

Thanks.

 


 

Posted: Wed Dec 14, 2005  5:12 pm

 

Make sure you clear the X bit on the CCR register to allow the XIRQ interrupt to be recognized by the 9S12DP256. This is done by the "ANDCC #$BF" instruction.

 

Hope this helps,

 


 

Posted: Wed Dec 14, 2005  5:11 pm

 

> Hi,

>

 

> I'm using 9S12DP256DGV2 processor.

> I would like to use XIRQ for power failed feature.

> In PRM file, I declare Vectore 6 on my XIRQ callback like that :

> VECTOR 6 FIP_isr

 

How did you enable the XIRQ in your code?

 


 

Posted: Wed Dec 14, 2005  8:50 pm

 

XIRQ is non-maskable, provided it was enabled first.

If you don't enable by clearing the CCR register X bit, it is masked.

 


 

Posted: Wed Dec 14, 2005  9:04 pm

 

> This irq is non maskable, so I suppose there no thing to do.

> Could you confirm me ???

> if not, could you tell me what I have to do.

> Thanks.

 

On an HC12, the X bit in the CCR is set to one (inhibited) during reset (and during the XIRQ interrupt service routine). XIRQ is only "non-maskable" after your software clears the X bit to enable it. In assembly, ANDCC #$BF would work. Also, on a HC12B32 you can poll Port E and monitor the level of XIRQ/PE0.

 

On an S12 and whatever software uses a PRM file, YMMV, but I suspect you need to do something similar since XIRQ had to also be enabled in a similar way on the HC11. Read your S12 documentation for the details.

 


 

Posted: Thu Dec 15, 2005  1:07 pm

 

Many thanks for your help.

 

I try to insert the instruction in my "C" code like that:

 

asm ANDCC #$BF;

or asm("andcc #$BF");

 

And I have this error when I'm compiling:

 

ERROR C12099: Label addressing mode not supported

ERROR C10013: Label '$BF' undefined

 

Why???

 

Any way, I try to set X bit of register by writting in memory where the register is located, but the register value doesn't change. Is it normal and must this method work??? Because the callback function on ISR isn't called, although the port value is changed.

 

Thanks a lot

 


 

Posted: Thu Dec 15, 2005  1:34 pm

 

Sorry but it's working with:

 

#define xint_enable() {asm andcc #0xBF;}

 

But, There os an error on my board. Because when the power is too low, the input is set to 5V and when it's OK, the input is set to 0V. And normally , it is the opposite. Is it any way to solve this problem.

 

Thanks in advance.

Labels (1)
0 Kudos
0 Replies