Hey guys,
I want to create an accurate timer without interrupts. My timer has to be very accurate because I have to send HIGH and LOW signals for 1us. I have read this post to know that I need high-frequency clock source (HFCLK, 16 MHz), which means better resolution (62.5 ns) and higher power consumption (typ. 5 or 70 uA depending on HFCLK source). But I don't know how to program my code so I followed this post and this post. But I have still some problems with it. I post my code below.
My timer should only replace the unaccurate nrf_delay_us.
In line 19: (Init) Why should I use 32 bits and not 16 bits? where is the difference?
In lines 35 - 37: (time function) I hope you can help me here. I don't know how I can hand over my timeout value to my function and to my timer, so that the timer can work with it...
I hope, you can help me.
Thanks in advance,
Christoph