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

Standalone I2C device with no address

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



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

Standalone I2C device with no address
PostPosted: Fri Jan 12, 2007 7:52 am     Reply with quote

Good morning All,
I am testing a standalone I2C pressure sensor slave, where I cannot set the address. How do the master (in my case its the dsPIC30F) address the slave.
What is the typicall pull resistor I need to connect to SDA and SCL lines. I currently have 10k connected.

Can any one give me a code sample.
_________________
Thanks

mkr
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Fri Jan 12, 2007 8:54 am     Reply with quote

I use 4.7k for the pull-ups. Faster speeds might use different values.


I think you'll need to write a driver. look at 2401.c in the drivers area
for an example.

Did you search the code library for your device?
Ttelmah
Guest







PostPosted: Fri Jan 12, 2007 11:24 am     Reply with quote

You can't 'change the address', on a hell of a lot of devices (most!). The key is 'what is the address'. So long as you know it, you just use that address. However if you don't (some devices don't specify their address), then you have to 'poll' for it. Normally the devices will specify that they ack some particular cycle, so you just run a loop testing, till you get this acknowledgment.

Best Wishes
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Jan 12, 2007 12:11 pm     Reply with quote

What is the sensor part number?
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

PostPosted: Sun Jan 14, 2007 3:19 pm     Reply with quote

Its a ASDX series pressure sensor from honeywell with I2C interface capability.
_________________
Thanks

mkr
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Mon Jan 15, 2007 10:49 am     Reply with quote

The spec. sheet on this sensor is really not the best that I've seen. It states that the address is fixed at 0xF0. The command sequence is:

i2c_start()
i2c_write(0xF1)// direction bit set for a read
variable = i2c_read(1)// MSB
variable_low = i2c_read(0)// LSB
i2c_stop()

It outputs a 12 bit value so simply combine the two bytes. I'm not sure if this is correct but according to the spec. sheet it should be.

Ronald
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

PostPosted: Wed Jan 17, 2007 11:28 am     Reply with quote

I agree with you regarding the spec. for this sensor. Its very vauge.

Where did you get the address for the device from. I have looked out for this info, but could not get it. Please send the link.
_________________
Thanks

mkr
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Jan 17, 2007 5:43 pm     Reply with quote

Go to: http://content.honeywell.com/sensing/prodinfo/pressure/lit.htm and in the Product Sheets window select ASDX DO Series Pressure Sensors. When you click on Download it will open a PDF file. On page 2 there are seven notes at the bottom. Note 5 explains the communication sequence for the I2C bus and also the fixed address of the device.

Hope that helps.

Ronald
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

PostPosted: Thu Jan 18, 2007 11:25 am     Reply with quote

Thanks rnielsen. That was very helpful.
_________________
Thanks

mkr
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