This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Missing interrupts and their 'pending' status

Hi,

I'm having some difficulties in determining when and how (external) interrupts remain pending.

In the users manual for the XC167ci it states that hardware arbitration leaves interrupts pending if they cannot be handled at that moment (i.e. the ILVL of the PSW is too high). I use a few macros to raise or lower the ILVL temporarily. This works great, I never miss interrupts. I figure that if an interrupt occurs when the ILVL is too high, the interrupt is buffered (pending) and it is handled the moment I lower the ILVL again.

But I now would like to turn of ONE specific interrupt. I do that by clearing and setting of the CC10IE bit.

It seems that interrupts that occur during the time that the CC10IE bit is of are completely gone. I.e. they do not stay 'pending', they are not buffered and handled whenever I enable the CC10IE bit again.

Can anyone tell me how and when the XC167 keeps interrupts pending?
Did anyone else run into this same problem?
Should I enable/disable one specific interrupt in another way?

Thanks for your help

Parents
  • @Mike
    Yes you are right, there must one instruction after clearing the interrupt enable bit. I checked this in the disassembler that the next instruction doesent need protection. But my tests got also the same problem with a nop after clearing the enable bit and I dont know why?

    Reagarding the usage of the atomic instructions, _atomic(0); ...; _endatomic_(); supports only 4 instructions and the compiler will not stack them. Ok, if I need more than one atomic instruction, than I can also disable the global interrupt flag.

    Still strange why it was not working disabling the SOTIE interrupt enable flag.

    Bert

Reply
  • @Mike
    Yes you are right, there must one instruction after clearing the interrupt enable bit. I checked this in the disassembler that the next instruction doesent need protection. But my tests got also the same problem with a nop after clearing the enable bit and I dont know why?

    Reagarding the usage of the atomic instructions, _atomic(0); ...; _endatomic_(); supports only 4 instructions and the compiler will not stack them. Ok, if I need more than one atomic instruction, than I can also disable the global interrupt flag.

    Still strange why it was not working disabling the SOTIE interrupt enable flag.

    Bert

Children