2016-10-30 08:19 PM
I use CubeMX 4.17, F4xx firmware 1.13.1, created an automatically generated timer based hal tick funtion. I tested timer 6 and timer 10. BOTH results in tick running at 2000Hz(0.5ms per tick), but I think the correct state should be 1000Hz(1ms per tick)?
#timer #cubemx #f4072016-11-18 05:32 AM
Dear User,
Please note that your feedback is reported internally for checking. We apologize for any inconvenience this may cause and thank you for your understanding. Best Regards STM32.forum2016-11-21 05:28 AM
Hello lee.kiilii,
The measuring os the Systick is done by toggling an IO in the timer IT.
When doing this, the signal period obtained in the scope is twice the systick frequency as a tick corresponds to a logical state (1 or 0) then to a half period.Please place the scope cursors on a half period and then read the frequency and tell me if it is OK.
On my side, the Systick is equal to 1 ms on the scope.BREric Dampierre.2024-03-19 07:43 AM
Hello
I have the same problem mentioned in the original post. I'm generating code for a NUCLEO-F429ZI board with the CubeIDE version 1.14.1. I've selected TIM6 for the timebase and I also see a tick every 0.5ms (should be 1ms).
In HAL_TIM_PeriodElapsedCallback I toggle a LED and watch the voltage on a scope. Each half cycle is 0.5ms - so 2000 events per second.
Do we have an answer yet? The original question was in 2016.
Thanks,
Beep.
2024-03-20 03:58 AM
I'm now suspecting the HAL lib code doesn't take the setting of TIMPRESCALE into account and thus gets the output frequency of the timer wrong.