GPT Interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPT Interrupt

793 Views
salman83
Contributor II

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.

Labels (1)
Tags (2)
0 Kudos
1 Reply

559 Views
TomE
Specialist II

In stages...

0 - What CPU are you using? It helps to provide details. What OS is it running? Compiling with CodeWarrior or something else?

1 - If you read the GPIO pin, can you see the signal (that you are using to cause the Capture) changing?

2 - Is the Timer performing the Capture? Is it setting the flag to say this has happened?

3 - Is the request showing up in the Interrupt Controller? Run your test with CPU interrupts disabled to see if the request is making it this far.

4 - Are you programming a Vector in the Interrupt Table?

Tom

0 Kudos