Associate
April 2, 2014
Question
STM32 clock Jitter on TIM4
- April 2, 2014
- 8 replies
- 2778 views
Posted on April 02, 2014 at 08:56
Hello everyone, I'm using STM32F100V8 and I configured TIM4 to generate a square wave (for uart sw). The TIM4 is so configured and should have the highest priority:
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); TIM_TimeBaseStructure.TIM_Period = 1; TIM_TimeBaseStructure.TIM_Prescaler = 405; TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(TIM4, &TIM_TimeBaseStructure); TIM_ITConfig(TIM4, TIM_IT_Update , ENABLE); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); NVIC_InitStructure.NVIC_IRQChannel = TIM4_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); Inside the ISR of TIM4 i toggle a MCU line and my scope show me that the clock has a very high jitter; Could someone give me some suggestion to make te clock more stable ? Here attached an image from my scope acquired on a long time with infinite persistence time #stm32-clock-jitter-tim4