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.

TCA6418E: TCA6418E register configuration

Part Number: TCA6418E

Dear Team,

This is my configuration.

GPIO 0 - 5 want to use as keypad inputs which have a pull up connected of 10K on the outside, pin goes low when keypad input is pressed and when released high, GPIO 6 - 7 directly connected to ground.

Below is the sequence of the register setting

On Init

 

IO_Write(0x1A,0xFF) // GPIO 0-7 INT ENABLE

 

IO_Write(0x2C,0x00) // GPIO 0-7 PULLDOWN

 

IO_Write(0x17,0x00) // GPIO 0-7 OUTPUTS ALL LOW

 

IO_Write(0x23,0x00) // GPIO 0-7 DIRECTION

 

IO_Write(0x29,0x00) // GPIO 0-7 DEBOUNCE

 

IO_Write(0x26,0x03) // GPIO 0-7 INTERRUPT WHEN HIGH TO LOW TRANSITION

 

During operation

 

When INT is received, to detect which GPIO goes from high to low

 

IO_Write(0x14) // read twice to clear INT

 We are not getting correct value also system hangs sometimes after keypad press. Do you see something wrong from our side. 

  • yaseer zakaria said:

    Part Number: TCA6418E

    Dear Team,

    This is my configuration.

    GPIO 0 - 5 want to use as keypad inputs which have a pull up connected of 10K on the outside, pin goes low when keypad input is pressed and when released high, GPIO 6 - 7 directly connected to ground.

    Below is the sequence of the register setting

    On Init

     

    IO_Write(0x1A,0xFF) // GPIO 0-7 INT ENABLE

     

    IO_Write(0x2C,0x00) // GPIO 0-7 PULLDOWN

     

    IO_Write(0x17,0x00) // GPIO 0-7 OUTPUTS ALL LOW

     

    IO_Write(0x23,0x00) // GPIO 0-7 DIRECTION

     

    IO_Write(0x29,0x00) // GPIO 0-7 DEBOUNCE

     

    IO_Write(0x26,0x03) // GPIO 0-7 INTERRUPT WHEN HIGH TO LOW TRANSITION

     

    [Bobby] I don't see anything wrong with this. Some of the writes are unnecessary since they should power up/reset to the written values but in the case where there is a bad reset, this is nice to have.

     

    During operation

     

    When INT is received, to detect which GPIO goes from high to low

     

    IO_Write(0x14) // read twice to clear INT

    [Bobby] I assume instead of IO_Write, you mean IO_READ(0x14) and I assume you do it twice.

    Instead of reading 0x14, can you read reg 0x11 to clear the INT?

     We are not getting correct value also system hangs sometimes after keypad press. Do you see something wrong from our side. 

    [Bobby] What do you mean when you say the system hangs? (The processor stops detecting INTs thus code never steps anywhere?)
    How many button presses does this take to glitch/break the system?
    Can you verify Vcc doesn't ever dip below PoR?
    Is there a decent pull up resistor/cap on RESET?
    Are you able to read the registers after the 'system hangs'?

    Thanks,

    -Bobby

  • Dear Bobby,

    Many thanks, slight misunderstanding from our side regards to 0x26 register, now it is sorted.

    One query we are operating the chip on VCC=3.3V, but we have pulled up #INT on 1.8V externally through 10k because #INT is connected to 1.8V bank of FPGA.

    Currently we are getting interrupt on FPGA. Do you see any issue in long term or any chances of failure.

  • "Many thanks, slight misunderstanding from our side regards to 0x26 register, now it is sorted."

    Glad to hear you were able to resolve the problem.

    "Currently we are getting interrupt on FPGA. Do you see any issue in long term or any chances of failure."

    Thats fine, the INT pin is an open drain output so it doesn't know/care what it is connected to and there isn't any concern for contention. This means you can connect to a 1.8V through a resistor without any worries to failures related to this or life time reliability concerns.

    thanks,

    -Bobby