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.

EXTERNAL INTERRUPT priority VS TIMER INTERRUPT priority

Other Parts Discussed in Thread: MSP430F6779

hi,

i am using msp430f6779 controller. in which i am displaying a block of seven segment using timer interrupt per 4 milli second.

i am also using an external adc to read data. when adc completes the conversion it give a high to low signal i am taking that signal as an external interrupt.

i just want to know is there any chance i can miss adc data due to interrupt clashing.????

  • No, the interrupts will not "clash" with each other. However, you may run out of CPU cycles to handle all the interrupts all the time. This depends on how often the interrupts are generated, how many CPU clocks (MCLK cycles) do you need to handle each interrupt, and what is the frequency of MCLK.
  • hi ,
    thanks for replying sir,
    i have two main doubts sir.
    1) suppose adc has finished the conversion and external interrupt ISR execution is in process meanwhile my timer interrupt comes what will happen did it jump to timer ISR or first it will complete finish interrupt ISR then goes to timer ISR.

    2) suppose execution of timer ISR is in process and my adc finished the conversion and generate external interrupt. DID it jump to external interrupt ISR?? [because i want that] or first it will finish timer ISR.
  • By default, interrupts are disabled while another interrupt handler is running – the CPU automatically clears GIE when starting an interrupt handler. (See section 1.3.4 of the User's Guide.)

    It would be possible to enable GIE explicitly in your interrupt handler, but this would enable all possible interrupts, including the same one that you're currently handling, if your device raises another interrupt. (See section 1.3.5.)

  • sasuke uchiha said:
    1) suppose adc has finished the conversion and external interrupt ISR execution is in process meanwhile my timer interrupt comes what will happen did it jump to timer ISR or first it will complete finish interrupt ISR then goes to timer ISR.

    Assume that you do not enable interrupt inside your external ADC ISR, the CPU will first finish the current external ADC ISR and then goes to Timer ISR.

    However, if the (external) ADC ISR takes too long to finish, and another ADC interrupt is generated, (a) the ADC reading in the current ADC ISR may be incorrect, (b) and/or the second ADC interrupt may be ignored (c) and/or the ADC ISR will be executed after that of the first ADC ISR is finished and before the pending Timer ISR is executed. Whether (a), (b), or (c) actually happens depend on how the ADC ISR is written.

    sasuke uchiha said:
    2) suppose execution of timer ISR is in process and my adc finished the conversion and generate external interrupt. DID it jump to external interrupt ISR?? [because i want that] or first it will finish timer ISR.

    In order to be able to execute the (external) ADC ISR before the Timer ISR is finished, you need to enable interrupt inside your Timer ISR. Assume you have enough time to handle both ISRs, there is no problem. otherwise, you end up with the same situation as in (1) above plus similar problems in Timer ISR and inverting the order of Timer ISRs.

  • thanks for clearing up the things, i think forum is great source of help for student like us.

**Attention** This is a public forum