cancel
Showing results for 
Search instead for 
Did you mean: 

how does one get time intervals on an stm32f10 using the standard libraries?

Fidk.1
Associate II
 
6 REPLIES 6

What do you mean by "get time intervals"?

Are you aware of the fact that SPL has been superseded by Cube years ago?

JW

Just enable the SysTick for 1ms (1000 Hz), and have a SysTick_Handler to increment a tick variable, perhaps also a local time/date clock

Or configure a TIM in maximal / free-run, say divided to 1 MHz, so you can delta time in micro-seconds, range about 65 ms via TIMx->CNT

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

save the current time, wait, then subtract it from the new current time to get the time of something

I am not using the cube ide since I'm editing code that has been written and is compiled without it, so I am not sure as to how to do this

I'm not using CubeIDE either..

I'm not in a position to know your level of technical skill, education or training. Perhaps provide some context to understand what other experience you have. I need something to pivot off.

Perhaps get a programming manual for the Cortex-M3 more generally, the SysTick works on all these types of MCU exactly the same. Joseph Yiu has a good series of books.

STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\SysTick\TimeBase

https://www.st.com/resource/en/programming_manual/pm0056-stm32f10xxx20xxx21xxxl1xxxx-cortexm3-programming-manual-stmicroelectronics.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

https://legacy.cs.indiana.edu/~geobrown/book.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..