01-20-2011 03:23 AM
Good morning.
I’m trying to acquire data from 8 digital 3-axis magnetometers HMC4848, having an I2C digital interface. I’m using the NI USB-8451 data acquisition card and the 8-channel I2C-bus switch PCA9548A from NXP.
The PCA9548A.vi file that I attached (in Eight_magnetometers.zip) gives no errors, but I acquire constantly 0 from each axis of the magnetic sensor. Note that at the moment I’m just trying to acquire data from a single channel (namely the channel 0).
I use 10k pull-up resistor, connected between Vdd and SDA, SCL, RESET pins of the PCA9548A.
I also attached Single_magnetometer.zip that contains the HMC5843.vi file that I previously used to acquire data from a single sensor and which works properly.
Any suggestion is welcome.
Thanks in advance.
Dr. Caligari
01-21-2011 09:52 AM
In the Eight_magnetometers example I don't see you changing the slave address when you want to talk to the HMC5843.
Other comments:
01-21-2011 01:31 PM
Hi smercurio_fc.
Thanks for your answer.
I will try to fix these problems on Monday and I will keep you informed.
Best regards.
Dr. Caligari
01-24-2011 09:22 AM
Good morning smercurio_fc.
I modified the code following your suggestions, but I’m still not able to acquire data from the sensors.
Actually, the problem is that I’m not sure about how to address the magnetometer when the PCA9848 has already been addressed.
In the example that I attached I added a second property node, with the address of the HMC5843 (namely 1E), but when I try to run the code I receive the following error message:
Error -301742 occurred at NI-845x I2C Write.vi:2
Possible reason(s):
NI-845x: The slave did not acknowledge an address+direction byte transmitted by the I2C master. Reasons include the incorrect address set in the I2C configuration or the incorrect use of the 7-bit address. When entering an address to access a 7-bit device, do not include the direction bit. The NI-845x Basic I2C API internally sets the direction bit to the correct value, depending on the function (write or read). If your datasheet specfies the 7-bit device address as a byte, discard the direction bit (bit 0) and right-shift the byte value by one to create the 7-bit address.
The issue is – I guess – that I’m sending two different I2C address on the same bus and this result in an address conflict.
Could you please help me to understand how I could solve it?
Thanks again and best regards.
Dr. Caligari
P.S. I also attached the code for the single magnetometer modified.
09-03-2012 01:44 PM
This is Zhenyi, now i am doing my final year project using the USB 8451 to extract the data from the smart batteries through PCA9548, I have also encountered the same problem with you. Beacuse it is very very urgent for me, then if you have fixed out this problem, can you share it with me. Thanks very very much!!!
Best regards,
Zhenyi
09-20-2012 02:45 AM
Hi to all,
ihave an equal problem. I'm trying to connect several slaves (up to 10 sensors) with the usb-8451. The problem is that the slaves have an equal addresse.
My questions are:
- is there a need on the external Pull-Ups to connect them all to SDA, SCL lines?
- is it necessary to use some kind of switch (like PCA9548) when the slaves have the same addresse?
Best regards,
Andy