- Tue Sep 17, 2013 1:32 pm
#163629
I'm trying to use the I2C interface on our STR912 board, in this case to talk to a SDP600 sensor.
I am using the ST library functions for I2C, and Yagarto to build the project.
Everything appeared to be working fine, I can read serial number out of the device, and can set sensor registers.
However, I've suddenly hit a problem. The sensor uses a "hold-master" sequence (also called a "clock-stretching" operation, I think) in order to indicate when it is done with a conversion. I don't see anything in the ST library code that will deal with this operation at all. How do I solve this problem??
I was thinking of just treating the I2C pins as GPIO pins for this purpose, and bit-banging the clock line as required using GPIO_WriteBit() and GPIO_ReadBit(), but I don't know if that will actually work or not. I also don't know if it will nuke the state of the ST I2C module. Has anyone else here dealt with this issue on this chip ??
I am using the ST library functions for I2C, and Yagarto to build the project.
Everything appeared to be working fine, I can read serial number out of the device, and can set sensor registers.
However, I've suddenly hit a problem. The sensor uses a "hold-master" sequence (also called a "clock-stretching" operation, I think) in order to indicate when it is done with a conversion. I don't see anything in the ST library code that will deal with this operation at all. How do I solve this problem??
I was thinking of just treating the I2C pins as GPIO pins for this purpose, and bit-banging the clock line as required using GPIO_WriteBit() and GPIO_ReadBit(), but I don't know if that will actually work or not. I also don't know if it will nuke the state of the ST I2C module. Has anyone else here dealt with this issue on this chip ??