SCP1000 (I2C) Pressure Sensor problem

Hey everyone,

I am new to the world of Arduinos, but not new to playing with microprocessor. I have done some work with PICs in the past, including interfacing with the SCP1000 Pressure sensor over the i2c interface. Now I am trying to get a 3.3V Arduino Pro Mini to talk to the sensor with the Wiring Library, but I'd love a little help if possible!

I can post code if that will help, but basically, I am able to talk to the sensor and write to its operation register, but I cannot read any register. I think the problem is that the Wiring library does not provide a way to make a "restart" command in i2c.

I have looked at SCL and SDA on a scope and it appears that the write commands go through with proper sequence including acknowledges from the scp1000, telling me that I am addressing the sensor and communicating with it over i2c just fine. But whenever I try to read any register (status, or pressure/temperature registers) the result comes back as all 1's.

I think the problem is that to do a register read, you need to send the following sequence:

START - 7 bit address of scp1000 - write bit (0) - get ack from scp1000 - 8 bit address of status register - ack from scp1000 - ANOTHER START - 7 bit address of scp1000 - read bit (1) - get ack from scp1000 - 8 bits of status register send by scp1000 to arduino - non-acknowledge from arduino to tell it that's it - STOP

Now the tricky part seems to be that I cannot figure out how to get the repeated start in there. It seems that the way the Wire library is set up, it always wants to do a STOP after writing data. Has anyone encountered this problem? Is there an easy solution?

Thank you very much, and sorry for such a long post. I'd be more than happy to clarify anything if I didn't explain what I'm thinking clearly...

Not sure how much I can help but I have just done a project that involved using I2C with the arduino and processing. Take a look at the code for the arduino, it might give you a clue as to where it is going wrong.

www.thebox.myzen.co.uk/Hardware/Transistor_Tester.html

Thanks Grumpy_Mike. Neat project you've done there!

I'm still stuck.. Perhaps the "repeated start" condition I think the SCP1000 sensor seems to require might not be the problem, since everyone else's i2c code on the arduino seems to get by with just using Wire.beginTransmission(), Wire.send() and Wire.endTransmission() followed by the reads...

I'll let you know if I figure something out!

Hi Scott K, did you ever get the I2C to work? I just got the I2C version and am looking for some code to read it.

Thanks, Mike

Working example code:

http://harleyhacking.blogspot.com/2010/01/barometric-pressure-or-doing-pascals-in.html