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: interrupt inquiry

Part Number: TCA9539
Other Parts Discussed in Thread: TCA8418E, TCA8418

Hi, I have several questions :

1. Do the input port register always reflect the latest voltage level of the input port? Or it will only update until I read the register?

Let's say the initial voltage level of port 0.7-0.0(configured as input) are all 0, and the register of BIT I0.7-0.0 is also 0x00.

Then port 0.7 is driven high. INT/ should be driven low, right?

And then I read the register of BIT I0.7-0.0, will I get 0x00 or 0x80? If it's 0x00, then I have to read it again to get the latest value 0x80, right?

2. If 3 input ports voltage level changes and initiate INT, I only read after the 3rd INT, then I can't know the which port level is the 3rd change, I can only know that there are 3 input ports voltage level changes, right?

3. In the WRITE and READ example of the datasheet from page 23 to 25, Input Port Registers and (Output Port Registers) are always in pair, if CPU sends the command with Register Address 0x00, the device will always send back both Input Port 0 and Input Port 1 value, right? If I send the command with register Address 0x01, the device will only send back Input Port 1 value, right? So it's impossible for me to read only Input Port 0 value?

My customer would like to ask for a device similar to TCA9539 

which

1. have 2 input registers, one reflects last time, one reflects current time

2. be able to mask some input port. For example, P07-00 are all input, but only the voltage level change on P07-06 will initiate INT,

do we have such devices?

  • Hey Howard,

    "1. Do the input port register always reflect the latest voltage level of the input port? Or it will only update until I read the register?"

    The input port will see the voltage level and will reflect the current value of the pin during the read transaction.

    "Then port 0.7 is driven high. INT/ should be driven low, right?

    And then I read the register of BIT I0.7-0.0, will I get 0x00 or 0x80? If it's 0x00, then I have to read it again to get the latest value 0x80, right?"

    Yes the bit flips the INT will trigger as stay low as long as port 0.7 stays high. When you read the register you will see 0x80h. Please note though that after reading the INT will deassert and the comparator in our device will treat the "previous value of the pin" as high. This means if the pin goes low, the INT will assert again but if it goes back HIGH then the INT will deassert.

    "2. If 3 input ports voltage level changes and initiate INT, I only read after the 3rd INT, then I can't know the which port level is the 3rd change, I can only know that there are 3 input ports voltage level changes, right?"

    If 3 input ports changed and you read the input register, you will see all 3 inputs that changed assuming they all remain changed during that time. If 2 inputs go back to their original state and one remain changed then you would only see 1 input change because you didn't read it fast enough. Essentially if you read the inputs fast enough then you can catch all the input changes.

    "3. In the WRITE and READ example of the datasheet from page 23 to 25, Input Port Registers and (Output Port Registers) are always in pair, if CPU sends the command with Register Address 0x00, the device will always send back both Input Port 0 and Input Port 1 value, right? If I send the command with register Address 0x01, the device will only send back Input Port 1 value, right? So it's impossible for me to read only Input Port 0 value?"

    Not true. You can just send the command byte 0x00 to read the input register and clock 9 cycles to get input port 0 then NACK. If you wanted to read only port 1 you send command byte 0x01h and just send 9 clock cycles and NACK, if you send 18 clock cycles and ACK'd at the 9th you would read port 1 and then port 0. If you continuously sent clock cycles, you would just rotate reading between port 0 and port 1 continuously until you stopped. The device is hardwired to auto increment between the shared registers.

    "1. have 2 input registers, one reflects last time, one reflects current time"

    All of our IO expanders show only the current value of the pin. If you want to know the last value and current value, you would need a device with a FIFO like TCA8418/TCA8418E. It will tell you when a pin changes state and when it changes back by reading the event FIFO.

    "2. be able to mask some input port. For example, P07-00 are all input, but only the voltage level change on P07-06 will initiate INT,"

    You can configure TCA8418/TCA8418E to have only certain inputs go to the event FIFO by setting the GPI event mode register.

    -Bobby