Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

Author Topic: TI bq34z100 i2c communication  (Read 16346 times)

0 Members and 1 Guest are viewing this topic.

cheerio

  • Sr. Member
  • ****
  • Posts: 306
TI bq34z100 i2c communication
« on: January 25, 2013, 16:26:34 PM »
TI bq34z100: http://www.ti.com/lit/ds/symlink/bq34z100.pdf

Hi i try to communicate with the chip via i2c. But it just won't work. Maybe you can help me.
This is my setup:
-schematic for the chip connections is attached
-i use the bus-pirate v3.6 to communicate with the chip
-VCC = 4.2V
-100khz i2c clock

To check the communication i try to read out the chips name. This is register 0x63, 0x64, 0x65, 0x66, 0x67, 0x68 , 0x69, 0x6A [check page 38 (bottom)] and and should be bq34z100 [check page 40(mid)].

The communication sequence is shown on page 28.

I am pretty rusty on i2c so maybe i messed smth up but this is what i try to read the device name.

Start Bit, 0xAA, 0x63, Start Bit, 0xAB, read byte, ACK, read byte, ACK, read byte, ACK, read byte, ACK, read byte, ACK, read byte, ACK, read byte, ACK, read byte, NACK, Stop Bit

Is this alright? This is d) incremental read on page 28.

The Bus-Pirate Syntax is:
[ = Start bit
0x?? = send 0x??
r:8 = read 8 bytes, ACK the first 7 and NACK the last byte
] = Stop bit

Here is what happens when i do this (sometimes a) happens and sometimes b) happens):
a)
I2C>[ 0xaa 0x63 [ 0xab r:8 ]
I2C START BIT
WRITE: 0xAA NACK
WRITE: 0x63 NACK
I2C START BIT
WRITE: 0xAB NACK
READ: 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF
NACK
I2C STOP BIT

b)
I2C>[ 0xaa 0x63 [ 0xab r:8 ]
I2C START BIT
WRITE: 0xAA ACK
WRITE: 0x63 NACK
Warning: *Short or no pull-up
I2C START BIT
WRITE: 0xAB NACK
READ: 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF  ACK 0xFF
NACK
I2C STOP BIT

The chip does not ACK when it should do so, this is giving me a hard time.
Can you point out any mistake i do?

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #1 on: January 25, 2013, 16:54:32 PM »
This are the logic analyzer logs for a) and b)

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: TI bq34z100 i2c communication
« Reply #2 on: January 26, 2013, 10:05:26 AM »
if i'm not mistaken, shouldn't the address be 0xab for read???
And what is this chip used for?

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #3 on: January 26, 2013, 13:49:47 PM »
yes kam 0xAB is for read. But first i have to write the address i ant to read to the chip using 0xAA. read page 28 of the datasheet carefully.
The chip is used to determine the state of charge of a battery with pretty insane precision
« Last Edit: January 26, 2013, 13:55:53 PM by cheerio »

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #4 on: January 26, 2013, 20:34:11 PM »
i added a cap (330nF) between REG25 and GND.
Now i got the chip talking....

what i do to read the chipname is this:
[0xAA 0x63]
[0xAB r]
[0xAB r]
[0xAB r]
[0xAB r]
[0xAB r]
[0xAB r]
[0xAB r]
[0xAB r]


the incremental read like it was shown in the datasheet won't work yet. i think i experiment more into that. timing issues maybe

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: TI bq34z100 i2c communication
« Reply #5 on: January 26, 2013, 20:47:20 PM »
The chip is used to determine the state of charge of a battery with pretty insane precision
Like, how much capacity is left? The remaining lifespan of the battery??? Something like this?

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #6 on: January 26, 2013, 21:20:44 PM »
AFAIK the chip won't tell you that but it does use this data for it's prediction. The chip uses the open circuit and load voltage(impedance tracking), counts the current that has already been used, and it also compensates battery aging in it's calculations. It can predict the state of charge (remaining battery capacity) with a 1% precision.

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #7 on: January 27, 2013, 16:56:13 PM »
it looks like i have misunderstood the incremental read. it works like this:
%:x = x ms delay
Increment read:
[0xAA REGADDR %:1600 [0xAB r [0xAB r ... [0xAB r]

you can also do it like that:
[0xAA REGADDR]
%:1600
[0xAB r]
...
[0xAB r]
 
for some reason i have to wait 1.6s after a write command. i really don't know whats going wrong here.

« Last Edit: January 27, 2013, 19:40:21 PM by cheerio »

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: TI bq34z100 i2c communication
« Reply #8 on: January 27, 2013, 17:42:46 PM »
AFAIK the chip won't tell you that but it does use this data for it's prediction. The chip uses the open circuit and load voltage(impedance tracking), counts the current that has already been used, and it also compensates battery aging in it's calculations. It can predict the state of charge (remaining battery capacity) with a 1% precision.

tomorrow i order some samples for myself.... Amazing chip

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #9 on: January 27, 2013, 18:53:47 PM »
cool. maybe you can tell me how the flash write works when you got it. I really struggle with writing stuff to the chips data flash

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #10 on: March 12, 2013, 19:37:59 PM »
did you have some time to investigate this chip? in about 1 month i want to continue with the project i need the chip for and help would be really appreciated.

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: TI bq34z100 i2c communication
« Reply #11 on: March 13, 2013, 00:01:02 AM »
no not really. I'm starting a new business right now and i hardly have any time to spend for the site.

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #12 on: March 13, 2013, 01:24:51 AM »
ok. i wish you good luck!

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: TI bq34z100 i2c communication
« Reply #13 on: March 14, 2013, 07:51:53 AM »
Danke sehr! ;)

cheerio

  • Sr. Member
  • ****
  • Posts: 306
Re: TI bq34z100 i2c communication
« Reply #14 on: August 09, 2013, 01:12:26 AM »
i put some time into this chip today and managed to get most of the communication working. to speed up the testing of the chip i attached it to an arduino. when i got alle the stuff working i post the arduino code so you can check out how the communication works exactly. but don't expect much of explanation in the code or a clean code ^^