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 CCS Technical Support

Smart Battery Comm. using SMBus

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



Joined: 10 Sep 2009
Posts: 22

View user's profile Send private message

Smart Battery Comm. using SMBus
PostPosted: Wed Jan 12, 2011 3:28 pm     Reply with quote

Hi,
I am trying to communicate to a smart battery BB-2590 using the smbus.
I am using the pic18f97j60 connecting to one of the comm ports on the battery.
I have the i2c setup as:
Code:
#use i2c(Master,Slow,sda=PIN_D5,scl=PIN_D6,restart_wdt)

and my command lines are:
Code:

i2c_start();
i2c_write(0x16);     // Device address 0001011 0 
i2c_write(0x08);  // Device Command Code for Temperature
i2c_start();         // Restart
i2c_write(0x17);   // Device address 0001011 1
data1=i2c_read(1);    // Now read from slave
data2=i2c_read(0);
i2c_stop();

My data keeps coming as FF. Is there something missing?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 12, 2011 5:11 pm     Reply with quote

Post a link to the data sheet for the smart battery. Hopefully the data
sheet has a description of the SMBus interface protocol.

Also, what is the voltage used for the SMBus with this battery ?
Is is +5v or +3.3v ? Hopefully the data sheet has this info.

Does the battery have built-in pull-ups on SCL and SDA, or do you have
to supply them externally ? If you have already added external pull-ups,
what is the resistor value that you used ?

Appnote on the differences between the i2c bus and the SMBus:
http://www.maxim-ic.com/app-notes/index.mvp/id/476

Also, it's possible that your Smart Battery slave addresses are wrong
or are shifted-by-1. Run this program which will scan the i2c bus
(or SMbus) and report all slave devices that it finds on the bus:
http://www.ccsinfo.com/forum/viewtopic.php?t=42368&start=4
joshirupesh1989



Joined: 19 Apr 2017
Posts: 1

View user's profile Send private message

Need source code of smart battery
PostPosted: Wed Apr 19, 2017 7:48 am     Reply with quote

Dear sir, i am also facing same problem.
Can you please send me source code for smart battery +PIC microcontroller on my email address.
[email protected]

thanks
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