CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

SMBus to TI bq20x series Gas gauge chips?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

SMBus to TI bq20x series Gas gauge chips?
PostPosted: Sun Mar 09, 2008 10:57 am     Reply with quote

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







PostPosted: Sun Mar 09, 2008 3:33 pm     Reply with quote

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








PostPosted: Mon Mar 10, 2008 2:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Mar 10, 2008 11:32 am     Reply with quote

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








PostPosted: Tue Mar 11, 2008 2:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 11, 2008 8:41 am     Reply with quote

Anonymous wrote:
oops , the http part was missing from the postp,
Here is the direct link: http://www.ccsinfo.com/forum/viewtopic.php?t=26006

Another interesting topic was discussed yesterday for the CRC code (PEC) used by a similar TI BQ2060A: http://www.ccsinfo.com/forum/viewtopic.php?t=33986
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

Still no joy
PostPosted: Wed Mar 12, 2008 2:01 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 12, 2008 3:34 pm     Reply with quote

How about posting a short example program showing your problem? Wink
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

Some Success!
PostPosted: Thu Mar 13, 2008 9:04 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group