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.

PCA9534A[Port expander] interfaced with TMS320F28335 -- Issue

Other Parts Discussed in Thread: PCA9534A, TMS320F28335

hi Folkz,

We are using the PCA9534A port expander interfaced with the TMS320F28335 . We could write to the port expander and test it (writing values to the Output Port Register. and checking the status of the port in CRO)

But we are unable to read the data from the PCA9534A[:(] .

Is their  any one who had interface the PCA9534A before ? It will be help if some one can share the code with us .

Thanks in advance ,


 

  • I don't have any sample code to share, unfortunately, but I think we can get this figured out fairly quickly.

    Would you describe the I2C transaction that you are implementing when writing to the output port register of the PCA9534A?

    I suspect it is just one large series of consecutive writes of bytes, correct?  When I say large, I mean that you don't generate a STOP, or a RESTART condition from the command byte to the actual data bytes.
    This would look something like the following (non bold type means F28335 driving SDA, bold type means PCA9534A driving SDA) :

    START BIT -> PCA9534A address + Write bit -> ACK -> Command Byte -> ACK -> Output Port register data -> ACK -> STOP BIT

    The above is described in Figure 6 on page 9 of the PCA5434A datasheet found on the Product Folder.

     

    A read of the Input Port register requires an I2C Write sequence to address the PCA9534A and send the command byte to the device which indicates which register to access, in this case the Input Port register.
    THEN, you need to generate a RESTART condition and perform an I2C Read sequence as below (non bold type means F28335 driving SDA, bold type means PCA9534A driving SDA) :

    START BIT -> PCA9534A address + Write bit -> ACK -> Command Byte -> ACK -> RESTART BIT -> PCA9534A address + Read bit -> ACK -> Command Byte -> ACK -> Input Port register data -> ACK -> STOP BIT

    The above is described in Figure 8 on page 10 of the PCA5434A datasheet found on the Product Folder.

     

  • Dear Mr. Brandon ,

    Thanks For your reply,

    Yes , you are correct about the writing Sequence . It is exactly as you told .

    But regarding the reading we are bit confused . Because we found  Data Sheet Errata for thePCA9534A in the Product Folder of the Device,

    At the moment we are writing to the control register (0x03) and trying read it back. Unfortunately we are unable read the data back from the port expander .

    Regards,

    SAP

     

  • SAP said:

    But regarding the reading we are bit confused . Because we found  Data Sheet Errata for thePCA9534A in the Product Folder of the Device,

    Looking at the corrected diagram in the datasheet errata and the actual datasheet posted on the Product Folder, I don't see a difference in Figure 9.  They both have a 1 in the R/W bit.  The errata indicates it used to have a 0 in the R/W bit.

    Regardless, I believe Figure 8 still applies when performing a read.

     

    SAP said:

    At the moment we are writing to the control register (0x03) and trying read it back. Unfortunately we are unable read the data back from the port expander .

    If we use Figure 8 as our guide, are you generating a STOP condtion after the ACK bit from the slave after the command byte is sent, or a RESTART condition?