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

I2C issue

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



Joined: 20 Jul 2006
Posts: 15

View user's profile Send private message

I2C issue
PostPosted: Sun Dec 24, 2006 10:20 am     Reply with quote

I had a couple of questions.
I am trying to implement I2C interface between a master and slave device.
1. I see there are pull up resistors connected to the SDA and SCL line of both the device(Master and Slave). Is that an issue, and what will I need to do?
2. I get some values in the slave device from its 10 bit ADC. I have been multiplying that number to an ADCfactor = (5/(2^(10))). But instead of doing this I want to take that number coming out of the 10 bit ADC and send it to the Master in 2 write commands so it could be packed into a 16 bit value. How do I take that number and convert into a bunch of 0s and 1s as a 16 bit packet. I also have some instances when I need to convert that number coming out of the ADC in the slave as just an 8 bit number and send it to the Master through just 1 write command. What will I need to for that.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Dec 24, 2006 12:18 pm     Reply with quote

What are the resistor values ? For a 5v i2c bus, the lower limit for
the pull-ups is about 1.6K. If you have two pullup resistors, use the
"product over sum" formula to find the effective resistance.
Example:
One side has 4.7K. The other side has 3.3K.
Code:

 4.7 x 3.3       15.51
------------ =  ------- = 1.94
 4.7 + 3.3        8.0

The combined resistance is 1.94K, and this is greater than the 1.6K
minimum, so it's OK.
pr83



Joined: 20 Jul 2006
Posts: 15

View user's profile Send private message

PostPosted: Sun Dec 24, 2006 4:09 pm     Reply with quote

Thank you PCM Programmer. You are correct I can treat them as Rs in Parallel.
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