AnsweredAssumed Answered

stm32f051 discovery systick inaccurate

Question asked by Jo-Jo Smith on Sep 16, 2017
Latest reply on Sep 18, 2017 by Jo-Jo Smith

I need a timer that is accurate to 1us for a project I am working on. I bought some stm32f051 discovery boards to get going. I noticed all the timers seemed to be slow by about 0.75% (I checked them with a scope). That means I lose 7.5ms every second, which is huge for a real-time system. I tried to set-up a 1ms systick, and that is slow also.


I got the systick timer example working from the STM32F0-Discovery peripheral examples and changed the main loop as follows:

while (1)
    /* Toggle LED4 */


    /* Insert 50 ms delay */


    /* Toggle LED3 */


    /* Insert 100 ms delay */


The LED is blinking slow by the same amount, so I don't think it's my firmware.


I thought something might be wrong with my board, so I tried the same project on a different board, and that one is even slower. It is off by about 0.85%, so I don't think it's the board either.


Can anyone tell me why the boards all run so slow even when I use STMicro's systick example?