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

Interrupt Control Register

Hello,

We are trying to disable two fast interruptions as we get another one.

We are using XC167CI.

We have managed to do it but when we enable them again, the associated function executes once if there is a request pending.

We have seen in the manual that it may be because the IR bit in the Interrupt Control Register so we have tried to put 0 in this bit but it is not possible as it supports bit-protection.

Is ther any possibility to change this bit? Any other way to avoid this problem without using auxiliary variable?

Thanks,

Willow

  • Hello,

    As nobody has answered to my doubt, I will ask it again in a simpler way:

    Does anybody know how to change a bit that supports bit-protection? Is it possible?

    Thanks,
    Willow

  • Bit protection only protects bits from unintended change. If you explicitly clear a bit, it will be cleared.

    The User manual says:
    If a conflict occurs between a bit manipulation generated by hardware and an intended software access, the software access has priority and determines the final value of the respective bit.

    Sauli

  • From the manual...

    Protected bits are not changed during the read-modify-write sequence, that is, when hardware sets something like an interrupt request flag between the read and the write of the read-modify-write sequence. The hardware protection logic guarantees that only the intended bit(s) is/are effected by the write-back operation.

    The Interrupt Request Flag is set by hardware whenever a service request from its respective source occurs. It is cleared automatically upon entry into the interrupt service routine or upon a PEC service.

    Note: Modifying the Interrupt Request flag via software causes the same effects as if it had been set or cleared by hardware.

    As you are explicitly changing it, it is not protected.

  • Thank you very much for your answers.

    Willow