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

recommendation for interrupt priority between SPI and GPIOTE

Hi All,

Just want to ask if there is a better or recommended way to manage priority interrupt.

My application uses 3 interfaces:

  1. SPI as master to interact with ADC(codes from SPI example SDK 12.2.0).
  2. 2x GPIOTE pins as interrupt from the ADC(codes from pin_change_interrupt example).
  3. 1x PWM channel generating 32 KHz clock.

From the example, both SPI and GPIOTE use priority interrupt 7; and my GPIOTE interrupt handler routine does make use of SPI access to the ADC(so after GPIOTE interrupt, the SPI to ADC won't work anymore).

It seems, the easiest solution would be to change the SPI interrupt priority from 7 to 6 ?

Just wondering if there is a better/prefer way to handle the above situation.

The 2nd. issue is related to the 2x GPIOTE pins; both can generate interrupt; what is the best way to handle this assuming both can generate interrupt "at the same time"; at the moment, I wire both interrupts to go to the same interrupt handler; will this interrupt handler be called twice if both interrupts are occurring not exactly at the same time ?

I set the 2x GPIOTE pins to generate interrupt with "high to low" signal transition.

Thanks for the help.

Lee

Parents
  • Given that the SDK(12.2.0) provides a varied and lot of options, I was looking to see if there is a built in features to the driver/libraries in these 2 scenarios:

    1. Handling SPI and GPIOTE interrupt(other than adjusting the priority).
    2. Handling 2x GPIOTE interrupt going to the same interrupt handler.

    I guess, I am looking for a recommendation for the "best way" or "best practice" of doing this using the SDK.

    At the moment, I am just adjusting the interrupt priority between the SPI and GPIOTE and also managing the 2 interrupt internal to the handler; I will be testing this soon; it should work.

    Thanks, Lee

Reply
  • Given that the SDK(12.2.0) provides a varied and lot of options, I was looking to see if there is a built in features to the driver/libraries in these 2 scenarios:

    1. Handling SPI and GPIOTE interrupt(other than adjusting the priority).
    2. Handling 2x GPIOTE interrupt going to the same interrupt handler.

    I guess, I am looking for a recommendation for the "best way" or "best practice" of doing this using the SDK.

    At the moment, I am just adjusting the interrupt priority between the SPI and GPIOTE and also managing the 2 interrupt internal to the handler; I will be testing this soon; it should work.

    Thanks, Lee

Children
No Data
Related