Hi
I am would like to know how to setup *.overlay file for timer and find code for a simple timer interrupt using the nrf54l15.
Best Regards
David
Hi
I am would like to know how to setup *.overlay file for timer and find code for a simple timer interrupt using the nrf54l15.
Best Regards
David
Hello,
There are several options here, you can for instance use Zehyr kernel timers, this will then execute any code at given intervals:
https://docs.nordicsemi.com/bundle/ncs-1.9.2-dev1/page/zephyr/reference/kernel/timing/timers.html
(used by: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-1-zephyr-rtos-advanced/)
(example: https://github.com/NordicDeveloperAcademy/ncs-inter/blob/main/v2.9.0-v2.7.0/l1/l1_e1_sol/src/main.c)
Another option, use the low level nrfx drivers:
https://github.com/NordicSemiconductor/nrfx
(an old example for timer in specific using nrfx: https://github.com/too1/ncs-nrfx-timer-example/tree/master)
Kenneth
Hi Kenneth
Using the K_timer will there not be a problem with interrupts etc, as I want very accurate timings for an ADC sampling.
Best Regards
David
Hello,
Maybe you can try:
https://github.com/kemegard/nrfx_timer_nrf54l15/tree/main/src/nrfx_timer/timer
Kenneth
Hi
Can you tell me what file has the peripheral declarations ie timer20
BRs
David
Hi David,
I skipped using the devicetree in this case, and simply updated:
https://github.com/kemegard/nrfx_timer_nrf54l15/blob/main/src/nrfx_timer/timer/main.c#L54
Which is then used in:
https://github.com/kemegard/nrfx_timer_nrf54l15/blob/main/src/nrfx_timer/timer/main.c#L97
Kenneth
Hi Kenneth
Where do find out what 20 is, where its allocated can it 320, I am very new to nordic so what is 20 referring too do you have 20 different timers in the peripherals.
Also this line is incorrect nrfx_timer_init(&timer_inst, &config, timer_handler); and does not compile should be nrfx_timer_init(&timer_inst, &config, timer_event_handler);
BRs
David