AnsweredAssumed Answered

Stm32f429 GPS PPS measuring

Question asked by malenko.maxim on Apr 20, 2016
Latest reply on May 4, 2016 by malenko.maxim
Hi! I try to measure GPS PPS (pulse per second) duration by TIM2. Setting code:
TIM_TimeBaseInitTypeDef TimeBaseInitStruct;
TIM_ICInitTypeDef ICInitStruct;
TimeBaseInitStruct.TIM_Prescaler = 0;
TimeBaseInitStruct.TIM_ClockDivision = TIM_CKD_DIV1;
TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;
TimeBaseInitStruct.TIM_Period = 0xFFFFFFFF;
TimeBaseInitStruct.TIM_RepetitionCounter = 0;
TIM_TimeBaseInit(PPS_IN_TIM, &TimeBaseInitStruct);
 
TIM_SelectInputTrigger(PPS_IN_TIM, TIM_TS_TI1FP1);
TIM_SelectMasterSlaveMode(PPS_IN_TIM, TIM_MasterSlaveMode_Enable);
TIM_SelectSlaveMode(PPS_IN_TIM, TIM_SlaveMode_Reset);
 
ICInitStruct.TIM_Channel = TIM_Channel_1;
ICInitStruct.TIM_ICPolarity = TIM_ICPolarity_Rising;
ICInitStruct.TIM_ICSelection = TIM_ICSelection_DirectTI;
ICInitStruct.TIM_ICPrescaler = TIM_ICPSC_DIV1;
ICInitStruct.TIM_ICFilter = 0;
TIM_ICInit(PPS_IN_TIM, &ICInitStruct);
TIM2 clk:180Mhz. In  interrupt value of CCR1 stored in array. Result:meas.jpg
What caused this behavior? I apologize for not being word-perfect in English)

Outcomes