I have a application where I need to time acurately the time between two enternal pin signals. I have this working using the
I have a application where I need to time acurately the time between two enternal pin signals. I have this working using the
Hi John,
There is no Zephyr API that makes use of the nrfx_timer driver at all, so I believe using the Timer peripheral's capture feature is not possible with Zephyr API. You will need to use nrfx driver directly.
Please also know that the SoftDevice Controller will reserve some highest priorities, so even if you use nrfx driver and direct Timer peripheral interrupt, the latency of recording the timing cannot be guaranteed to be constant.
Hieu
I'm aware of the IRQ latency issues which is why I want to use the timer capture function so when the ISR is eventuare called, the latency will not effect the actual pin event result on the timer capture value.
However, I'm struggling to find any consice information of using the nrfx timer function within the VS code nRF connect extention.
I guess I'm missing something as I can't find anything in the Nordic help which tells me how in use their drivers & e.g. how to add timers to my project. I did find this post which said to add CONFIG_NRFX_TIMER2=y to prj.conf, which helped, but this was just in a question asked on community site.
https://community.platformio.org/t/how-to-link-with-nordic-nrfx-library/27040
Are you able to fill in the blanks for me either specifically how to setup the GPIOTE pin to trigger a timer capture thru PPI or more generally with access to a more formal & conprehensive source of help/documentation on the nRF connect NRFX library useage within VS code
Many thanks in advance.
I'm aware of the IRQ latency issues which is why I want to use the timer capture function so when the ISR is eventuare called, the latency will not effect the actual pin event result on the timer capture value.
However, I'm struggling to find any consice information of using the nrfx timer function within the VS code nRF connect extention.
I guess I'm missing something as I can't find anything in the Nordic help which tells me how in use their drivers & e.g. how to add timers to my project. I did find this post which said to add CONFIG_NRFX_TIMER2=y to prj.conf, which helped, but this was just in a question asked on community site.
https://community.platformio.org/t/how-to-link-with-nordic-nrfx-library/27040
Are you able to fill in the blanks for me either specifically how to setup the GPIOTE pin to trigger a timer capture thru PPI or more generally with access to a more formal & conprehensive source of help/documentation on the nRF connect NRFX library useage within VS code
Many thanks in advance.
Ah, I see. Sorry, I misunderstood your approach previously, but this idea is indeed a good use case of the PPI peripheral.
Enabling the nrfx driver is indeed as simple as enabling the CONFIG_NRFX_<peripheral name> Kconfig. The Kconfigs are setup so that just enabling the peripheral would trigger the relevant driver to build.
See CONFIG_NRFX_TIMER2 for example, it selects CONFIG_NRFX_TIMER, which enable the nrfx_timer driver.
As for how to use the drivers, there are two sources of information:
Please let me know if you need any further elaboration.