This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

micro second timer handler

Hi,
I am using nRF51822. I need to create a timer interrupt handler, which can trigger at 1us (microsecond). I am using Keil. Now i am using the 1 ms (microsecond) timer interrupt handler. In this case i am using APP_TIMER_TICKS to get the number of ticks. I think the 32Khz crystal is used by the timer. In this case the minimum timer tick period will be approximately 30us. How can i implement a timer handler for 1 microsecond time out. I need both 1ms and i us timer handler in the same project.

Thanks in advance,
Shiju C G

  • What do you want to do with 1us interrupt? You won't be able to do anything with this frequent interrupts.

    Well, in any case, you can use one of the timers that can be run with 16/32MHz HFCLK clock source.

  • Hi Nikita,

    What i am looking for is exact delay in microsecond.In my project i have used delay nrf_delay_us. It is using repeated NOP to create 1 microsecond delay. It may change the delay if another interrupts are triggered while using the nrf_delay_us loop.Is there any sample project which uses the this 1us timer delay implementation.

    thanks in advance,
    Shiju C G

  • You can use this example project as reference:

    \Nordic Semiconductor\nRF51 SDK_v6.0.0.43681\Nordic\nrf51822\Board\nrf6310\timer_example
    
  • Hi Nikita,

    Thank you for the reply. I have tried to execute the code and its working fine. I could create a delay of 1us using the example project. Will it make any problem if i include this timer function to the ble_app_uart project? Which timer can i used if the code is to be included in to ble_app_uart project Timer0,1or2?

    Thanks in advance, Shiju

  • You can use it with softdevice without any changes. You can use TIMER1 or TIMER2. TIMER0 is used by softdevice and you can't use it.

Related