cancel
Showing results for 
Search instead for 
Did you mean: 

Externe interrupt

ezanen9
Associate II
Posted on September 01, 2005 at 04:43

Externe interrupt

3 REPLIES 3
ezanen9
Associate II
Posted on August 31, 2005 at 06:06

Hello, I want to use the external interrupts INT2, INT3, INT4 and INT5 of the STR710 uC.(as inetrrupt only no wake-up)

But for some reason I can not configure the XTI_ registers. I added the following to my STR710.h file:

/* ****************************************** */

/* External interrupt definitions */

/* ****************************************** */

#define XTI_BASE 0xE0001000

#define XTI_SR (*(REG32 IOPORT2_BASE+7))

#define XTI_CTRL (*(REG32 IOPORT2_BASE+9))

#define XTI_MRH (*(REG32 IOPORT2_BASE+10))

#define XTI_MRL (*(REG32 IOPORT2_BASE+11))

#define XTI_TRH (*(REG32 IOPORT2_BASE+12))

#define XTI_TRL (*(REG32 IOPORT2_BASE+13))

#define XTI_PRH (*(REG32 IOPORT2_BASE+14))

#define XTI_PRL (*(REG32 IOPORT2_BASE+15))

In the initialisation of my main.c I wrote the following:

XTI_MRH = 0; // wake-ups 7-15 disabled

XTI_MRL = 0; // wake-ups 0-6 disabled

XTI_PRL = 0; // clear all interrupt flags

XTI_TRH = 0; // wake-up on falling edge

XTI_TRL = 0; // wake-up on falling edge

XTI_CTRL &= 0xFFFE; // wake-up disabled

XTI_CTRL |= 0x0002; //External interrupts enabled

XTI_SR = 0; // no software interrupts

(I also enabled channel 5 of the EIC.)

However, external interrupts of my eval board are not working. If I look in the memory during XTI initilisation nothing happens.

Is this why the external interrupts don't work. My ISR() look like:

void XTI_IRQ_isr ( void )

{

SWITCH_IRQ_TO_SYS;

/* BEGIN USER CODE XTI_IRQ */

IOPORT2_PD ^= 0x8000; //toggle led

XTI_PRH = 0; // resets perhiperal interrupts

XTI_PRL = 0; // resets external interrupts 2 till 5

/* END USER CODE XTI_IRQ */

SWITCH_SYS_TO_IRQ;

// clear IRQ Pending bit

EIC_IPR0 = CHANNEL(5);

}

Has somebody any suggestions?

Regards,

Jimmey

ben2
Associate II
Posted on August 31, 2005 at 06:29

you still need to set the XTI-MRx registers to enable the interrupts and the XTI_TRx registers to set the edge

ezanen9
Associate II
Posted on September 01, 2005 at 04:43

Thanks, it works now.

Regards,

Jimmey