Dear all,
I have an I/O expander with 8 inputs connected to ground through switches. So, I believe the I/O expander is receiving logic-low, when the switch is on.
I'm using this code to read the state of the switches connected to I2C I/O expander PCF8574A for testing (never mind the PCA5554A in the variable name):
Symbol I2CSpeed = i2cfast_8
Symbol PCA9554A_1 = %01110000
hi2csetup i2cmaster, PCA9554A_1, I2CSpeed, i2cbyte
hi2cin (Lane1State)
debug Lane1State
I have been struggling to figure out what is going on for a while and now I seem to at least understand something. For some reason, Lane1State returns whatever is the value of PCA9554A_1 i.e. address of the I/O expander. Any ideas?
Regards,
Edmunds
I have an I/O expander with 8 inputs connected to ground through switches. So, I believe the I/O expander is receiving logic-low, when the switch is on.
I'm using this code to read the state of the switches connected to I2C I/O expander PCF8574A for testing (never mind the PCA5554A in the variable name):
Symbol I2CSpeed = i2cfast_8
Symbol PCA9554A_1 = %01110000
hi2csetup i2cmaster, PCA9554A_1, I2CSpeed, i2cbyte
hi2cin (Lane1State)
debug Lane1State
I have been struggling to figure out what is going on for a while and now I seem to at least understand something. For some reason, Lane1State returns whatever is the value of PCA9554A_1 i.e. address of the I/O expander. Any ideas?
Regards,
Edmunds
Last edited: