2003-07-08 03:32 AM
2003-07-07 05:19 AM
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 ]2003-07-07 10:33 PM
Sorry for the smiley in the code...
You must understand ''for ( ; ; )'' instead of ''for(;'' ''2003-07-08 01:37 AM
I want to understand that what does _startupData.main() do?
Can you provide your interrupt vector table?2003-07-08 03:32 AM
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.