NRF52840 Timer driver #nrf52840


Phil Hipp
 

Hey everybody,

I need to use the TIMER peripheral of the NRF52840 to produce an interrupt after a specific amount of microseconds. It seems there is no timer driver in zephyr, but I can found the HAL sources for that in /zephyr/ext/hal/nordic/nrfx/drivers/src/nrfx_timer.c.

What would be the best way to implement and use a timer?


Phil Hipp
 

Any suggestions on this topic?


Rodrigo Peixoto <rodrigopex@...>
 

Hi, Phil.
Have you tried to use the timer API (https://docs.zephyrproject.org/latest/kernel/timing/timers.html?highlight=timer)? Did you face issues? 
There is already an implementation for it (timer driver for NRF) as you can see at the link https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/timer/nrf_rtc_timer.c


Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex




Em seg, 19 de nov de 2018 às 07:56, Phil Hipp <finke@...> escreveu:

Any suggestions on this topic?


Phil Hipp
 

Hey,

I've checked out this API, but k_timers only got a resolution in milliseconds. What I need is a timer with a resolution in microseconds. That's why I thought of using a timer peripheral of the nrf52840. The RTC timer of the nrf is used for systick and cannot be used for other purposes.