cancel
Showing results for 
Search instead for 
Did you mean: 

Problem of management of interrupts

vianney
Associate II
Posted on July 08, 2003 at 12:32

Problem of management of interrupts

4 REPLIES 4
vianney
Associate II
Posted on July 07, 2003 at 14:19

Hi!

I'm working on a ST72F521R9T3 and the indart demo board of Softec.

I want to manage interrupts on port A of my micrcontroller.

When I change the value on port A with a DIPswitch, the program does not go to the interrupt function defined.

When I look the value of PADR, it doesn't change.

I'm sure that Port A is working.

Here is my code, can you help me please?

include ''ST72F5h''

include ''starth''

void main (void) {

//enable interrupts

asm RIM;

// configures port A as input

PADDR = 0x00;

PAOR = 0xFF;

// Configures port D as output

PDDDR = 0xFF;

PDOR = 0xFF;

PDDR = 0x00;

ISPR0 = 0x00;

ISPR1 = 0x00;

ISPR2 = 0x00;

ISPR3 = 0x00;

EICR = 0x00;

// Enables the A/D peripheral on PC5

ADCCSR = 0x2D;

for(;

{

// Waits for the end of the conversion

while(!(ADCCSR & 0x80))

;

// Reads the A/D value and writes it on the LEDs

PDDR = ADCDRH;

}

}

pragma TRAP_PROC SAVE_REGS

void interrupt 4 main_ei0(void) {

while(PCDR!=0x20)

PDDR=!PDDR;

_startupData.main();

}

[ This message was edited by: Junior on 07-07-2003 17:50 ]

[ This message was edited by: Junior on 07-07-2003 17:51 ]

[ This message was edited by: Junior on 08-07-2003 11:04 ]

vianney
Associate II
Posted on July 08, 2003 at 07:33

Sorry for the smiley in the code...

You must understand

''for ( ; ; )'' instead of ''for(;''

''

itsmejatinus
Associate II
Posted on July 08, 2003 at 10:37

I want to understand that what does _startupData.main() do?

Can you provide your interrupt vector table?

vianney
Associate II
Posted on July 08, 2003 at 12:32

Ok No problem, Thanks it works now...

I had not seen the addendum who said that the inDART does not manage interrupts in Debug mode...

Now it works perfectly, when I program the microcontroller.