Other Parts Discussed in Thread: TMS320C5515
Tool/software: TI C/C++ Compiler
Hallo,
I work for a project and I have to use GPIO REGISTERS, in order to generate INTERRUPT on the pin -PIO10 or GPIO11. When the interrupt is active, must blink a led.
I use the board ezdsp5535 and for code I use CCSv4.
But I have a problem. I wrote the code in C and I had not errors, but the interrupt doesn`t active. I don`t know, why or what is the problem??!! Maybe, I set wrong a register??
In attachement, it is the program. Please, I need a suggestion, a advice.
Thank you!
Cristina
#include "ezdsp5535.h" #include <stdio.h> #include <csl_general.h> #include "ezdsp5535_led.h" #include "registers.h" #include "interrupts.h" Uint16 led = FALSE; void GPIO_IntrTest(void); interrupt void INT_GPIO(void); void gpio_output_pin_toggle(void); void main(void) { EZDSP5535_LED_init( ); EZDSP5535_XF_toggle(); /*CALL THE FUNCTION!!!!!*/ GPIO_IntrTest(); gpio_output_pin_toggle(); printf("test....\n"); while(1) {} }//ENDMAIN /*THE FUNCTION FOR BLINKING THE LED*/ void gpio_output_pin_toggle(void) { if (led) { EZDSP5535_LED_off(1); led=~led; } else { EZDSP5535_LED_on(1); led=~led; } //printf("TOGGLE PIN!\n"); } /*THE FUNCTION FOR SETTING THE INTERRUPT REGISTERS*/ void GPIO_IntrTest(void) { IODIR1|=(0<<GPIO11); /*SET THE GPIO10 AS INPUT PIN*/ IOINTEDGE1|=(1<<GPIO10);/*FOR CONFIGURING INTERRUPT TO TRIGGER ON THE FALLING EDGE*/ IOINTEN1|=(1<<GPIO10);/*FOR ENABLING INTERRUPT ON THE GPIO10 PIN*/ //IOINTFLG1|=(1<<GPIO10); IRQ_hook_func(INT_GPIO, ISR_GPIO); // hook interrupt function in vector table IRQ_enable(ISR_GPIO); // enable GPIO interrupt in IERx register // globally enable interrupts (INTM) IRQ_globalEnable(); /* ENABLE CPU Interrupts */ }//END GPIO_IntrTest /*THE FUNCTION FOR INTERRUPT*/ interrupt void INT_GPIO(void) { IOINTFLG1|=(1<<GPIO10); IODATAIN1^=(1<<GPIO10); /*BLINKING LED*/ gpio_output_pin_toggle(); printf("END ..... ISR\n"); }//END INTGPIO