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...