This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: Interrupt Priority (PRIx) register operation procedure

Part Number: TM4C123GH6PM


Hello,

Could you please advise a general, or right procedure of interrupt priority change by PRIx register operation?

For example, the following steps would be required at least: Interrupt disable, Priority change, Wait for the change effective, Interrupt enable.)

p.s.  This question looks close to Q1 in my previous thread. Ralph has responded it but I'm sorry, my question was not good. Please let me ask this revised question.

  • Hello Nambu-san,

    No problem, and feel free in the future just to clarify better in the other thread. If it's a related topic that's fine to do.

    In general the procedure I would recommend above all else would be to configure the priority of the interrupts are part of initial device configuration and before enabling interrupts.

    Such as:

    1. Configure System Clock

    2. Enable Peripheral

    3. Configure Peripheral

    4. Set Interrupt Priority

    5. Enable Interrupts

    This ensures that the right priority is given from the very first interrupt firing.

    If the priority needs to change after initial configuration, then it is a bit case specific and I am not sure I could give a good summary of pros and cons but the two options would be:

    1. As you described, disable interrupts first, then apply the priority change, and then enable interrupts. Should not need to wait for the change to be effective.

    2. Change the interrupt priority without stopping from having interrupt enabled.

    I would typically lean towards 2. for simplicity, but there may be merits to 1. I am not sure as I've not configured interrupt priorities after initial configuration.

    For changing the priority, the only real requirement is to execute the API that change priority. As long as that step is taken the NVIC will apply the proper priorities when the next interrupt arrives.

  • Ralph,

    Thank you very much. Very kind.

    I will talk to my customer.