cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set the internal timer (not in accordance with reality) of the STM32 board (NUCLEO-F401-RE)?

OVACH.1
Associate II

Hello, I am using an STM32 board (NUCLEO-F401-RE) and a ToF sensor for a project of measuring a passing vehicle flow. My system must be autonomous, I use a timer in my program to know the flow of passage. Only the timer does not conform to reality. When I let 1 minute pass (with my cell phone) my card tells me that 55 seconds have passed. And the more time I leave, the greater the difference. Do you know if it is possible to adjust the timer on the board? Or a simple update?

3 REPLIES 3
TDK
Guru

It depends on what you're using as a clock source. If you're using the HSI clock, you can use the HSITRIM values to alter it slightly. There is no such setting for HSE.

However, an error of almost 10% (5/60) is way outside of specifications, so maybe there's a software bug here causing the issue.

If you feel a post has answered your question, please click "Accept as Solution".
OVACH.1
Associate II

Sorry I'm a beginner in programming ...

I don't know if I used HSI or HSE clock but I defined and used it like this (in Arduino IDE):

unsigned long temps_ms;

temps_ms=millis();

 EEPROM.put(address+4, temps_ms);

Then resort to the documentation to Arduino, or any Arduino forum, to find out, whether the primary clock source is HSI or HSE.

JW