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.

TCA9539: Registers and Interrupt

Part Number: TCA9539

HI,

Can anyone explain how interrupt works? Do I have to set any register? If the interrupt is triggered will i know which ports data has been changed or read the input port register and compare with previous value?

Also how does input ports work? I am confused with polarity questions?

Thanks

  • Hi Sagar,

    The only configuration needed for the interrupts to be generated is to have a port configures as an input (which means the bit corresponding to the port in the configuration register should be a 1). If this is the case, the INT signal is automatically asserted when a change of state is detected on the input port. Any port can generate an interrupt, though, so in order to figure out which one has changed you would need to poll the input port registers before and after the interrupt and then compare the values.

    If a port is configured as an input, the logic level at the port will be reflected via the input port registers. The polarity is determined by the polarity inversion register settings (one bit per port). If the polarity inversion is set to 0, then a high level and an input port will correspond to a 1 in that port's input register bit and a low level will correspond to a 0. If polarity inversion is set to 1, then a high level will correspond to an input register bit value of 0 and a low input level will correspond to a value of 1.

    I hope this makes sense - please let me know if you have any questions.

    Regards,
    Max
  • Thanks for the reply.
    So one quick question. As you have mentioned that I dont have to configure interrupt.
    I have P00 to P07 as Input. When I change voltage register 00 shows a change value but Interrupt signal does not change.

    So could let me know how this interrupt signal goes high or low and when does it reset. I am not clear from the data sheet what it does.

    Thanks.
  • Sagar,

    The interrupt line should assert (go low) when the change of state occurs on your input. Are you seeing it stuck at a low level or a high level? One thing to note is that it is an open-drain output and so it needs to have an external resistor pulling it up to VCC in order to achieve high levels. (The chip would then pull the line low whenever it needs to indicate the interrupt event.)

    Max