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.

PCA9554A: PCA9554A code

Part Number: PCA9554A

Dear Expert ,

Good day ,

Could you provide some sample code of PCA9554A , our customer find that , the PCA9554A works fine when they write the data(address 70), but it is not work when read the data(address 71) , So they want to confirm whether their code have error .

BR,

Leon .liu

  • This is MicroPython code to read the input port of a PCA9554A:

      byte = i2c.readfrom_mem(addr=0x38, memaddr=0, nbytes=1)

    I doubt that this is helpful for the customer.

  • Hi Leon,

    What are the address pins of the device set to? I assume they are are all grounded.

    When you preform a read on this device you have to follow this pattern:

    Notice how the first byte sent is actually a write command (the LSB is 0). So you first send 0x70, then you send the register address you want to access. Then you send a read command (LSB is 1) directly after. So you send a 0x71. This will let the device know that you want to preform a read. After this the I2C device should send it's register contents.

    Let me know if this makes sense and if it worked.

    Best,

    Chris

  • Hi Chris and Clemens

    Thanks for your reply ,

    I couldn't agree with you more , actually , I had told these to the customer , I think provide the example code to the customer and let them to check the code will be better , I am a hardware engineer , review the code is not my forte.

    I also ask the customer to upload their code , but there is no reply yet .

    However , Thanks for your help . I will wait the customer reply , I think you may set this query to "TI Thinks Resolved "

    Best regards

    Leon.liu

  • No worries Leon,

    In case you have a response it will ping me. I will leave the thread open for now.

    Best,

    Chris