08-04-2014 04:42 AM
Hi,
I intend to use the NI 8451 I2C protocol to communicate with a TI BQ77910A battery fuel gauge.
I am proceeding in small steps and therefore my first VI is very basic and attempts to read the EEPROM registers of the BQ77910A. It is attached to this post.
The device slave address is specified as 0x20 and I have set this in my VI parameters.
When I run the VI and wish to read a particular address I get the "-301742" error.
Looking at previous posts concerning this particular error I checked my SCL, and SDA signals on a scope and they were indeed correct.
I have 2 pull up resistors between pins 29 and GND and pin 30 and GND of 2.2k.
I cannot seem to understand why I am obtaining this error despite all parameters and settings being correct.
Both the BQ77910A datasheet and the VI are attached to this post.
08-04-2014 09:23 AM - edited 08-04-2014 09:26 AM
I don't know this device but according to the datasheet (page 38), its address is not 0x20 but 0x10.
08-04-2014 09:26 AM
Dear JB,
Thanks for your reply.
I have corrected this and I still get the same error....
Vidipt
Engineer Leclanché
08-04-2014 09:55 AM - edited 08-04-2014 10:00 AM
I have 2 pull up resistors between pins 29 and GND and pin 30 and GND of 2.2k.
This is wrong. Extract form this document :
Serial Data (SDA): This is a bidirectional pin used to transfer addresses and data into and data out of the device. It is an open drain terminal, therefore, the SDA bus requires a pull up resistor to VCC. (typically 2.2 or 4.4 kOhm) For normal data transfer, SDA is allowed to change only during SCL low. Changes during SCL high are reserved for indicating the Start and Stop conditions.
For info, VCC = pin 31 of USB-8451.
08-04-2014 10:11 AM
Sorry to bother you again with this but despite changing the position of the resistors and connecting them between pins 31 and 30/29 nothing has changed. I still receive the same error:
Error -301742 occurred at NI-845x I2C Write Read.vi:1"
"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."
Kind Regards,
Vidipt
08-04-2014 10:53 AM - edited 08-04-2014 11:06 AM
Nobody forces me to answer and you don't bother me. Unfortunately I have never used this device.
I would start by only trying to read from EEPROM.
Have you connected the GND of the NI USB-8451 ?
08-05-2014 12:55 AM - edited 08-05-2014 12:56 AM
Does it work now ?
08-05-2014 01:38 AM - edited 08-05-2014 01:38 AM
I've just tried this now and unfortunately it doesn't work. All I have done is replace the write read I2C by the read only function.
Attached is a screenshot. When running the error remains the same.
08-05-2014 01:50 AM
And yes I have connected the ground of the USB8451 to the ground of the BQ77910A.
08-05-2014 07:00 AM
Have you connected the ZEDE pin to enable the I2C communication ? See pages 37, 47 and 48 of datasheet.