View previous topic :: View next topic |
Author |
Message |
mkr
Joined: 08 Aug 2006 Posts: 49
|
Standalone I2C device with no address |
Posted: Fri Jan 12, 2007 7:52 am |
|
|
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
|
|
Posted: Fri Jan 12, 2007 8:54 am |
|
|
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
|
|
Posted: Fri Jan 12, 2007 11:24 am |
|
|
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
|
|
Posted: Fri Jan 12, 2007 12:11 pm |
|
|
What is the sensor part number? |
|
|
mkr
Joined: 08 Aug 2006 Posts: 49
|
|
Posted: Sun Jan 14, 2007 3:19 pm |
|
|
Its a ASDX series pressure sensor from honeywell with I2C interface capability. _________________ Thanks
mkr |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Mon Jan 15, 2007 10:49 am |
|
|
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
|
|
Posted: Wed Jan 17, 2007 11:28 am |
|
|
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
|
|
Posted: Wed Jan 17, 2007 5:43 pm |
|
|
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
|
|
Posted: Thu Jan 18, 2007 11:25 am |
|
|
Thanks rnielsen. That was very helpful. _________________ Thanks
mkr |
|
|
|