AnsweredAssumed Answered


Question asked by Kellen DeVuyst on Aug 16, 2011
Latest reply on Aug 28, 2011 by Steven Kaiser

Hello All,


I am attempting to start a GPT interrupt and am having some trouble. I start the interrupt in Main() however after the interrupt occurs once MQX reports an unhandled interrupt for my main task. Here is my code, my understanding of GPT and running interrupts in MQX is poor at best, I have been looking at various posts attempting to make sense of it all. Any help is appreciated.


#define GPT_GPTIOS_IOS2   0x04#define GPT_DISCONNECT_PIN_LOGIC  0x00 #define GPT_ENABLE    0x80 #define GPT_ENABLE_INTERRUPT_2    0x04 #define GPT_PRESCALAR     0x02 #define GPT_CHANNEL2_LATCH_SETTING 2083 #define GPT_CLEAR_CHAN2_FLAG   0x04 #define GPT_INT_LEVEL         (6)#define GPT_INT_SUBLEVEL     (4) void Install_ISR(void) {  reg_ptr->GPT.GPTSCR1 |= GPT_ENABLE;  reg_ptr->GPT.GPTIOS |= GPT_GPTIOS_IOS2;  reg_ptr->GPT.GPTCTL1 |= GPT_DISCONNECT_PIN_LOGIC; reg_ptr->GPT.GPTC2 = GPT_CHANNEL2_LATCH_SETTING; reg_ptr->GPT.GPTSCR2 |= GPT_PRESCALAR;  _int_install_isr(MCF5225_INT_TIMA_C2F, MyFunction_ISR,0);    reg_ptr->GPT.GPTFLG1 |= GPT_CLEAR_CHAN2_FLAG;  //clear flag   reg_ptr->GPT.GPTIE |= GPT_ENABLE_INTERRUPT_2;  _mcf5225_int_init(MCF5225_INT_TIMA_C2F, GPT_INT_LEVEL, GPT_INT_SUBLEVEL, 1); } __declspec(interrupt:0) void MyFunction_ISR(pointer notUsed) {   simcount++;  reg_ptr->GPT.GPTFLG1 |= GPT_CLEAR_CHAN2_FLAG; }


I am setting the GPT as output compare and attempting to latch on a compare value, in my ISR I increment a global counter for testing purposes and clear the flag. There must be something I'm missing...