cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f4 Standard library equivalent to Arduino millis() function

jamsoft
Associate II
Posted on May 27, 2013 at 02:08

Hi all,

I need to meassure duration in milliseconds of some process during my program execution.

For Arduino the millis() function exists in library but I've found nothing simillar in the STM32 Standard library.

How can I (by the simplest way) derive the ms count from any of the system clock?

Or do I need to use one of the timers to get duration of the process?

Provide me with an example, please, if possible...

Thank you in advance 🙂
1 REPLY 1
Posted on May 27, 2013 at 03:12

Look at using DWT_CYCCNT to read ticks of the processor core.

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/compensating%20latencies%20on%20STM32F4%20interrupts&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=800]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2Fcompensating%20latencies%20on%20STM32F4%20interrupts&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=800
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..