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