AnsweredAssumed Answered

GPT Interrupt

Question asked by Salman Razzaq on May 20, 2013
Latest reply on May 20, 2013 by TomE

Hi,

 

I am trying to use General Purpose Timer Channel #3 for input capture only. I configured the registers according to the documentation but the interrupt is not happening.

 

Following are the register values I have setup.

 

// Set GPT Channel #3 as Primary

MCF_GPIO_PTAPAR |= MCF_GPIO_PTAPAR_ICOC3_ICOC3;

 

 

// Input capture enabled
MCF_GPT_GPTIOS &= ~(MCF_GPT_GPTIOS_IOS3);

 

 

// Enable GPT module
MCF_GPT_GPTSCR1 = MCF_GPT_GPTSCR1_GPTEN;

 

 

// Capture on Falling edge
MCF_GPT_GPTCTL2 = MCF_GPT_GPTCTL2_INPUT3_FALLING;

 

 

// Enable GPT interrupt
MCF_GPT_GPTIE = MCF_GPT_GPTIE_CI3;

 

 

// Enables pull-up resistors on the GPT ports
MCF_GPT_GPTSCR2 = MCF_GPT_GPTSCR2_PUPT;

 

 

// Set GPT Channel#3 interrupt level and priority.

MCF_INTC0_IMRH &= ~MCF_INTC_IMRH_INT_MASK47;

MCF_INTC0_ICR47 = MCF_INTC_ICR_IL(IL_GPT_CH3) | MCF_INTC_ICR_IP(IP_GPT_CH3);

 

 

Regards.

Outcomes