PCA9555 i2c Expander not triggering Interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PCA9555 i2c Expander not triggering Interrupt

726 Views
DanS_35
Contributor II

Hello everyone,

I have a problem with the PCA9555 i2c expanders - the Interrupt Pin will just never change state even though the Inputs change and I can read them out just fine.

This is my initialisation:

 

void configurePCA9555(int address) {
  uint8_t config[2] = {0x06, 0xFF}; // set configuration register for inputs with pull-up
  ret = HAL_FMPI2C_Master_Transmit(&hfmpi2c1, address, config, 2, HAL_MAX_DELAY);
  if (ret != HAL_OK){
  	  printf("Error setting Config\r\n");
  }
}

 

 

And this is how I read it out:

 

void readPCA9555Inputs(uint8_t* portreadout, int address) {
	uint8_t buf[2];
    buf[0] = 0x00; // input register address
    ret = HAL_FMPI2C_Master_Transmit(&hfmpi2c1, address, buf, 1, HAL_MAX_DELAY);
    if (ret != HAL_OK){
	  printf("Error accessing port.\r\n");
    }
    else{
	  ret = HAL_FMPI2C_Master_Receive(&hfmpi2c1, address, buf, 2, HAL_MAX_DELAY);
	  if (ret != HAL_OK){
		  printf("Error reading port.\r\n");
	  }
    }
    portreadout[0] = buf[0];
    portreadout[1] = buf[1];
}

 

 

 

The interrupt pin however will remain high (pull-up) and it will remain there, confirmed with a scope.

I'm sure it's a very simple thing, but I can't figure it out right now.

I also use a PCAL6524 expander in the same design and that INT pin is working just fine.

 

Regards
Dan

Tags (2)
0 Kudos
Reply
4 Replies

708 Views
DanS_35
Contributor II

Ok here are the scope shots.

Yellow = Input, a simple switch that pulls pin 6 low.

Blue = i2c Data line in normal "read always" mode

Pink = Interrupt pin. It will always stay high.

SDS00002.pngSDS00001.png

0 Kudos
Reply

700 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Daniel,

I am not really sure what could be the root cause.

Could you try to add some delay between the periodic reads of the Input Port 0 register?

Could you double check the configuration of your MCU pin the INT output is connected to?

If you have more PCA9555 ICs, do you experience this issue on all of them?

Best regards,

Tomas

0 Kudos
Reply

713 Views
DanS_35
Contributor II

Hey Tomas,

I'm currently just polling in my main loop if the Pin goes low to then read the port.

It obviously, right now, will never be read like this though so I uncommented it and just read every loop, not ideal, but works.
I'm doing the very same thing with the PCAL6524 where it works like this.

I use the internal pull-up of my MCU which is specified with 40k typ (30k min, 50k max).

I'll try to get the requested scope shots.

0 Kudos
Reply

719 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Daniel,

I have not heard of such a problem before.

It seems like IO0 pins are correctly configured as inputs.

When do you read the Input Port 0 register? In your ISR? Note that the interrupt is deactivated when the Input Port register is read.

Could you please share here a scope shot (input signal, INT output, Input Port 0 register read) illustrating this behavior?

What is the value of your INT pull-up resistor and how many PCA9555 ICs have you tested so far?

Best regards,

Tomas

0 Kudos
Reply