View previous topic :: View next topic |
Author |
Message |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
SMBus to TI bq20x series Gas gauge chips? |
Posted: Sun Mar 09, 2008 10:57 am |
|
|
Has anyone used the CCS I2C functions to talk to a Texas Instruments bq20z75 chip or anything similar? The TI chip acknowledges its address, but all data reads give 0xff. I did modify the I2C_start function as the CCS one is too fast for the SMBus spec and the TI chip would not even ACK its own address. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Ttelmah Guest
|
|
Posted: Sun Mar 09, 2008 3:33 pm |
|
|
Turn down the speed of your bus, in the I2C setup.
The timing of the start, is dependant on this setting, and I2C/SMBUS, normally interchange fine, provided:
1) You limit the max operating speed to less than 100K (use for example, 'slow=80000' in the I2C setup).
2) You run with much larger pull-up resistors. Typically something like 20K for SMBUS.
Best Wishes |
|
|
Guest
|
|
Posted: Mon Mar 10, 2008 2:05 am |
|
|
This may be of interest
ccsinfo.com/forum/viewtopic.php?t=26006&highlight= |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Mar 10, 2008 11:32 am |
|
|
Anonymous wrote: | This may be of interest
ccsinfo.com/forum/viewtopic.php?t=26006&highlight= |
Thanks, but this does not seem to lead to any threads but this one. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Guest
|
|
Posted: Tue Mar 11, 2008 2:50 am |
|
|
oops , the http part was missing from the post, if you search for
PIC18F2585 Soft I2C Pin selection Problem
you will see code that talks to a gas gauge for a battery,
perhaps it may help |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
Still no joy |
Posted: Wed Mar 12, 2008 2:01 pm |
|
|
This still has me baffled! If I use about slow=45000 in the #use i2c statement I get about the same timing as the Texas Instruments EV2300 demo box, but still I read only 0xff.
I write to address 0x16 and read from 0x17 and the gas gauge chip acknowledges correctly. If I use a different address it does not acknowledge, so I know it sees and recognizes its own address. I dropped the pull-up resistors to 2k so the data and clock edges are real clean. I even added a gratuitous 150 us between bytes because the demo box does that. I have given up just trying to meet the SMB spec. I am trying to meet every idiosyncrasy of the demo box, and still the demo box can talk to the bq20z75 chip and I can't. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Mar 12, 2008 3:34 pm |
|
|
How about posting a short example program showing your problem? |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
Some Success! |
Posted: Thu Mar 13, 2008 9:04 am |
|
|
Finally it is starting to work! I saw that with #use I2C set to "slow" the Start condition was running too fast, so I wrote my own. Then I found out from Ttelmah that you can specify a particular speed for the bus (not mentioned in my manual or version 3.242 help files) and started to slow down the I2C further. Finally I realized my Start function did not do re-start timing to spec. So I went back to the CCS I2C_Start function with slow=40000 and things started to work. Now with fast pull-ups (2k) I can get it to run as fast as slow=60000. Next I will go back to regular 10k SMBus pull-ups and see if I can maintain that speed. My SMBus length is only about 1" plus a 13pF scope probe.
This was supposed to be the easy part! _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|