This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What is the natural interrupt priority level in nrf52840 peripherals?

I would like to know the natural interrupt priority among different peripherals of nrf52840.

Specifically I am looking for default interrupt priority between RTC1 and TIMER1.

Consider a case both peripheral RTC1 and TIMER1 got the interrupt at the same time, which one will be given the first preference to service the interrupt.?

Please do reply at the earliest. 

Parents
  • Hi,

    default interrupt priority between RTC1 and TIMER1.

    If software does not configure any priorities, then all exceptions with a configurable priority have a priority of 0.

    If you using e.g. nRF5 SDK, then the software drivers will typically configure the priority to 6, snippet:

    #ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY
    #define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif
    
    #ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY
    #define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif

    Consider a case both peripheral RTC1 and TIMER1 got the interrupt at the same time, which one will be given the first preference to service the interrupt.?

    If multiple pending exceptions have the same priority, the pending exception with the lowest
    exception number takes precedence. For example, if both IRQ[0] and IRQ[1] are pending and
    have the same priority, then IRQ[0] is processed before IRQ[1].

    As per the table here, RTC1 have IRQ number 17, and TIMER1 have IRQ number 9, so the CPU would then process the TIMER1 interrupt first.

    More information can be found in Cortex -M4 Devices Generic User Guide from ARM: https://developer.arm.com/documentation/dui0553/b

    and in the nRF52840 PS: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fkeyfeatures_html5.html

Reply
  • Hi,

    default interrupt priority between RTC1 and TIMER1.

    If software does not configure any priorities, then all exceptions with a configurable priority have a priority of 0.

    If you using e.g. nRF5 SDK, then the software drivers will typically configure the priority to 6, snippet:

    #ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY
    #define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif
    
    #ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY
    #define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif

    Consider a case both peripheral RTC1 and TIMER1 got the interrupt at the same time, which one will be given the first preference to service the interrupt.?

    If multiple pending exceptions have the same priority, the pending exception with the lowest
    exception number takes precedence. For example, if both IRQ[0] and IRQ[1] are pending and
    have the same priority, then IRQ[0] is processed before IRQ[1].

    As per the table here, RTC1 have IRQ number 17, and TIMER1 have IRQ number 9, so the CPU would then process the TIMER1 interrupt first.

    More information can be found in Cortex -M4 Devices Generic User Guide from ARM: https://developer.arm.com/documentation/dui0553/b

    and in the nRF52840 PS: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fkeyfeatures_html5.html

Children
No Data
Related