cancel
Showing results for 
Search instead for 
Did you mean: 

Input Capture TIM1

martinhillier9
Associate II
Posted on February 03, 2009 at 10:24

Input Capture TIM1

1 REPLY 1
martinhillier9
Associate II
Posted on May 17, 2011 at 09:57

I have TIM 1 setup as an input capture, can see the pin toggling on GPIO4 Pin 2, interrupts are being generated by OC1 which is also set up on TIM1 and these work ok, but no interrupts or flags for input capture 1 is being set..

Any Ideas??

Thanks,

Martin

Pin Setup:

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Init(GPIO4,&GPIO_InitStructure);

Debug:

GPIO4 Bit 2 Toggles

SCU->GPIOIN4 0x00000004 bit 2 high

TIM1->CR1 0x8144

IEDG1 Rising Egde

OC1E OC1 Enabled

OLVL1 High

EN Counter Enabled

TIM1->CR2 0xC000

IC1IE IRQ Enabled

OC1IE IRQ Enabled

TIM1->SR 0x6800

OCF2 OC2 Match

TOF Timer overflow

OCF1 OC1 Match

TIM1->CNTR is incressing (running)