GPT Interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

GPT Interrupt

897 次查看
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.

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

663 次查看
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 项奖励
回复