Oren V

MCF52235EVB - Help with Interrupts

Discussion created by Oren V on Jul 11, 2007
Latest reply on Jul 12, 2007 by Mark Butcher
Hi guys,
 
I know I've already asked it, but this is driving me crazy - I can't make it  the INTERRUPT (using SW3 - IRQ1 on the EVB) works.
I'm newbie, but I did everthing by the book, and with your help (THANKS again Kremer and MARK) - and I'm sure it is something stupid, basic thing that I miss.
 
I really need your help. Please take a look:
 
This is the main.c:
Code:
/* * File:  main.c * Purpose:  sample program * */#include <stdio.h>//#include "include\m52235evb.h"#include "common.h" unsigned char stop=0;void delay(int t_end){ int i,j; for (i=0;i<t_end;i++) {  for(j=0;j<10000;j++);  }}int main(){ unsigned char i;    MCF_GPIO_PNQPAR = (0 | MCF_GPIO_PNQPAR_IRQ1_IRQ1);     // set interrupt function on port NQ MCF_EPORT_EPPAR0 = (0 | MCF_EPORT_EPPAR_EPPA1_RISING); // IRQ1 interrupt - I TRIED RISING, FALLING, LEVEL, BOTH MCF_EPORT_EPIER0 = (0 | MCF_EPORT_EPIER_EPIE1);        // enable IRQ1 MCF_INTC0_ICR1 =  (MCF_INTC_ICR_IL(4) | MCF_INTC_ICR_IP(4));  // set interrupt level and priority MCF_INTC0_IMRL &= ~(0 | MCF_INTC_IMRL_MASK1                       | MCF_INTC_IMRL_MASKALL); // Unmask all interrupts Leds_Init();  while(1)   // LOOP that display running LEDs on the board {  for (i=0; i<0x10; i++)  {   board_led_display(i);   delay(100);   if (stop==1)  // SHOULD STOP THE PROGRAM when I press SW3    {    return;   }  }   }  return 0;}__interrupt__ void irq_1_isr(void){ while (!(MCF_EPORT_EPPDR0 & MCF_EPORT_EPPDR_EPPD1)) {}; // SHOULD STOP THE PROGRAM when I press SW3  stop=1; MCF_EPORT_EPFR0 = (uint8)(MCF_EPORT_EPFR0 | MCF_EPORT_EPFR_EPF1);}

 
and this is what I've added/Changed it the mcf52235_vectors.s :
 
Code:
  .  .  .#define _irq_handler      irq_handler#define _irq_1_isr      irq_1_isr // added this line  .  .  ..extern _irq_handler.extern _irq_1_isr   // added this line  .  .  .//vector41: .long _irq1_handler // Changed this linevector41: .long _irq_1_isr  // added this line  .  .  .

 


Message Edited by ornini on 2007-07-11 03:40 PM

Outcomes