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.

What can cause an ADC interrupt to stop running after being called twice? No clue where to start.

This is a very strange problem, I don't even know what to test.

I had an ADC interrupt working well, and the interrupt called a function. When I removed the function the ADC interrupts stopped working. The interrupt is invoked twice and stops.  What can cause an ADC interrupt to stop calling? If I make the function empty it works (interrupts continue to be received), but if I totally remove the function it does not work. Any ideas?

Thanks,

Yona

  • Yona,

    Yes, very strange indeed.  Let's forget about the function call or not call thing for now.  Focus on the fact that you are expecting to get an ADC interrupt, and you don't get it.  Run your code, and you're not getting the interrupt (I assume you put a breakpoint in the ISR, and you don't hit the breakpoint anymore).  Halt the code.  The first thing to check is whether the interrupt is still enabled.  Check the INTM bit and IER register, and also check the PIEIERx register and any bits in the ADC control registers that need to be enabled for the interrupt to occur (depends on the device).  If the interrupt is enabled, then check to see if the interrupt is flagged.  Check the IFR register, and also the PIEIFRx and ADC control register flag.  If the interrupt is flagged everywhere it is supposed to be, then it HAS TO BE TAKEN.  Then check the interrupt vector in the PIE table.  Is it correct?  Is the PIE still enabled?

    Regards,

    - David

  • Thanks for the answer, I've been out of the office and did not yet get round to check this. I checked on my home station, and the all works well (the interrupt does not stop). The only difference between both stations is that at home I use CC 3.3 and at work it is CC5.1 (I think, will check when I am there)

    I'll update, thanks for your time!

    Yona

  • Hi there, 

    I am dealing with this issue now instead of Yona. 

    I am still facing the same issue where removing the filter code  ( a FIR filter from TI library) stops the ADC interrupt from running: 

    The registers values (the differences are highlighted):

    Register   With Filter   Without filter 

    IER            0x0101        0x0101

    IFR            0x0001         0x0001

    PIECTRL 0x0D41         0x0D4D

    PIEIER1  0x0041          0x0041

    PIEIFR     0x0061         0x0060    -I understand that interrupt is not flagged and therefore will not occur - the question is why?

    ADCTRL1 0x1410       0x1410

    ADCTRL2 0x0800       0x0800

    ADCTRL3 0x00E9       0x00E9

    ADCST     0x0001       0x0000


    Do you have any idea what might be the problem? 

    Thanks

    Yosefa