I am toggling a gpio inside the timer ISR . the timer ISR triggers for every 1 sec.
Actually i am not able to see perfect 1 sec of gpio toggling . it also differs at different AHB frequency . i have included 2 cases with snapshot. please help me understand why i can not get perfect 1 sec gpio toggling and why it is different at 2 different ahb frequencies .
In the ISR i am just doing GPIOC->ODR ^= 0x2000U;
case 1 : AHB = 16Mhz HSI, Prescaler of timer = 999, period = 15999 ( in the image there is a difference of 10ms)
case 2 : AHB= 50Mhz, Timer clock = 50Mhz, Prescaler of timer = 999, period = 49999 ( in the image there is a difference of 25ms)
In both case it is showing different output .