Timer using FRDM-K64F


Nicholas Yameen <Nicholas.Yameen@...>
 

Hello,

 

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.

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  
Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 


Carles Cufi
 

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: https://github.com/zephyrproject-rtos/zephyr/issues/6498, 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.

 

Regards,

 

Carles

 

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

 

Hello,

 

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.

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  
Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 


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.

Andy


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: https://github.com/zephyrproject-rtos/zephyr/issues/6498, 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.

 

Regards,

 

Carles

 

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

 

Hello,

 

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.

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  
Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 



Nicholas Yameen <Nicholas.Yameen@...>
 

Hi,

 

Thank you for the replies.

 

I will look into the suggested API’s as well as the other suggestions.

 

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 

From: Andy Ross [mailto:andrew.j.ross@...]
Sent: Thursday, January 10, 2019 2:04 PM
To: Cufi, Carles <carles.cufi@...>; Nicholas Yameen <Nicholas.Yameen@...>; devel@...
Subject: Re: [Zephyr-devel] Timer using FRDM-K64F

 

[External email: Use caution with links and attachments]


 

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.

Andy

 

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: https://github.com/zephyrproject-rtos/zephyr/issues/6498, 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.

 

Regards,

 

Carles

 

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

 

Hello,

 

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.

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  
Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail