Re: Timer using FRDM-K64F

Andy Ross

Changing the k_timer API to work in some other unit than milliseconds is doable, though a little messy from a compatibility standpoint.

The underlying unit of ticks is configurable, and except for the tiny handful of remaining non-tickless targets, can now be arbitrary small (it's just the "unit of timekeeping" and doesn't correspond to interrupt frequency).  The limits are the precision of the underlying timer and the overflow potential of 32 bit timeout API.  Setting it to microseconds (and expecting it to be accurate at that level) should be possible on fast boards like K64F.

The suggestion to use a driver for external hardware (and not the system timer) is a good one though, especially if you have tight requirements.  IIRC the K64 has a bunch of timer devices instanced in addition to the ARM SysTick that Zephyr is using.


From: Cufi, Carles <carles.cufi@...>
Sent: Thursday, January 10, 2019 9:25AM
To: Nicholas Yameen, Devel
Subject: Re: [Zephyr-devel] Timer using FRDM-K64F

Hi there,


This has been requested several times, but as far as I know has not been completely solved yet.

There is an issue here:, please read through it and comment on your specific requirements so we try to gather all of them there in order to provide an implementation.

In the meantime you can use the HAL’s APIs directly (this is mcux for the Freedom board I believe), which is what other users have done with nRF-based platforms.






From: devel@... <devel@...> On Behalf Of Nicholas Yameen
Sent: 10 January 2019 17:42
To: devel@...
Subject: [Zephyr-devel] Timer using FRDM-K64F




My team and I are developing an application that will need the use of timers using the FRDM-K64F board.  The application requires a timer to be set using microseconds as the unit. Looking through the Zephyr and FRDM board documentation, I found that it supports millisecond resolution. Is it possible for Zephyr and the FRDM board to have a microsecond resolution? If so, are there examples of microsecond resolution? Thank you.



Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail



Join to automatically receive all group messages.