Tool/software:
Hello,
I have systick running with period of 80000000 / 1024 to get 1024 ticks per second and my SysTickIntHandler does:
void SysTickIntHandler(void) { g_ui32SysTickCount++; if(g_ui32SysTickCount % 1024 == 0) { g_ui32PosixTime++; g_ui32SysTickCount = 0; } }
So posix_time is seconds, and sys tick count is between 0 and 1023
I am also using usb serial to send posix time packets with nanoseconds, and I would like to syncronize the time with the microcontroller.
Is there any way to reset the systick counter remeaning time, or even better to set it to a given value?
In page 536 of the peripheral reference it says:
"Calling this function does not cause the SysTick counter to reload immediately. If an immediate
reload is required, the NVIC_ST_CURRENT register must be written. Any write to this register
clears the SysTick counter to 0 and causes a reload with the ui32Period supplied here on the
next clock after SysTick is enabled."
So I wonder if there is any way to set the timer to given value.
Best Regards,
Can