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.

pca9548a interfacing

Other Parts Discussed in Thread: PCA9548A

Hi all,

I just want to make sure I am interpreting the data sheet for this device correctly as I am having trouble talking to its attached devices.  I wish to talk to devices attached to the chip that also require a start condition and acks (like any i2c device) 

I am able to communicate with the chip and set the channel but I need to make sure my procedure after that point is correct.

I have:

Start  Condition

pca9548a address

wait for ack

control register address

wait for ack

Stop Condition

Start Condition

Attached device address

wait for ack from the attached device

device data points

wait for ack from the attached device

stop condition

 

and that whole sequence is repeated.  Is this the correct way to address a device attached to the i2c multiplexer?

Thanks much.

  • Good morning.

    I've got a similar issue: I’m trying to acquire data from 8 digital 3-axis magnetometers HMC4853 (datasheet at: http://www.honeywell.com/sites/servlet/com.merx.npoint.servlets.DocumentServlet?docid=D9F58D4D3-43D1-12BF-514A-FB1491510709), having an I2C digital interface. I’m using the 8-channel I2C-bus switch PCA9548A from Texas Instruments and the NATIONAL INSTRUMENTS USB-8451 data acquisition card.

    I use 10k pull-up resistor, connected between Vdd and SDA, SCL, RESET pins of the PCA9548A.

    Actually, the problem is that I’m not sure about how to address the magnetometer when the PCA9848 has already been addressed.

    In the PCA9548A's datasheet it is explained, for instance, how to use it in write mode:

    S - 1-1-1-0-A2-A1-A0-0 - A - B7-B6-B5-B4-B3-B2-B1-B0 - A - P

    After the {B7..B0} bits, I guess I can write as much data bytes as I want, but how can I address the slave device connected to one of the channels of the PCA9548A?

    The magnetometers that I'm using have the 7-bit address 1E.

    I would expect to have something like:

    S - 1-1-1-0-A2-A1-A0-0 - A - B7-B6-B5-B4-B3-B2-B1-B0 - A - HMC4853 Address (1E) - A - Data bytes - A - P

    Unfortunately, I can't acquire data from the sensors. The reason seems to be an address conflict on the bus.


    Note that I previously designed a small pcb with a single magnetometer and it works fine.

    Any suggestion is welcome.

    Best regards.
    Matteo Simoncini

  • Hi Matteo,

    Have you tried issuing a stop and start before communicating with the HMC4853? 

    S - 1-1-1-0-A2-A1-A0-0 - A - B7-B6-B5-B4-B3-B2-B1-B0 - A - P

    S-HMC4853 Address (1E) - A - Data bytes - A - P

    Regards,

    Prasad Dhond

  • Hi Prasad Dhond,

    I also have the same problem with Matteo, I use the NI USB-8451 to read the information from smart battery(smbus) through PCA9548APW, my code is like that:

    S - 1-1-1-0-A2-A1-A0-0 - A - B7-B6-B5-B4-B3-B2-B1-B0 - A - P

    S-HMC4853 Address (write) - A - Command code(1 byte) - A -S- battery Address (read) - A- get the data from battery-NAC-P

    when I run this code, there is no ack from  PCA9548APW, I have tried many many times, but still failed. can you help me to check where is wrong with my code. I use 1k ohm resister as pullup resistor.

    By the way can you tell me what is standard syntax of code to select the device and channel of PCA9548APW, then the master can read the information from the slave device through PCA9548APW.

    It is very urgent to me. Look forward your reply!!

    Thanks very much!

    Zhenyi

  • Hi Prasad Dhond,

    I also have the same problem with Matteo, I use the NI USB-8451 to read the information from smart battery(smbus) through PCA9548APW, my code is like that:

    S - 1-1-1-0-A2-A1-A0-0 - A - B7-B6-B5-B4-B3-B2-B1-B0 - A - P

    S-battery Address (write) - A - Command code(1 byte) - A -S- battery Address (read) - A- get the data from battery-NAC-P

    when I run this code, there is no ack from  PCA9548APW, I have tried many many times, but still failed. can you help me to check where is wrong with my code. I use 1k ohm resister as pullup resistor.

    By the way can you tell me what is standard syntax of code to select the device and channel of PCA9548APW, then the master can read the information from the slave device through PCA9548APW.

    It is very urgent to me. Look forward your reply!!

    Thanks very much!

    Zhenyi