2019-08-25 05:32 PM
I am trying to interface with a VEML7700 light sensor. Specifically I need to generate the following request:
<start><0x10><Wr><ACK><0x04><ACK><start><0x10><Rd><ACK><8bitdata><ACK><8bitdata><ACK><NAK><STOP> where: <Wr> is a single zero bit, <Rd> is a single one bit, and things in bold come FROM the sensor.
When i use the HAL_I2C_Master_Transmit and HAL_I2C_Master_Receive calls to first transmit the <0x10><Wr><0x04> and then the receive call to request the data I end up generating:
<start><0x10><Wr><ACK><0x04><ACK><STOP><Start><0x10><Rd><ACK><8bitdata><ACK><8bitdata><ACK><STOP>
That <STOP> in the middle is killing me. How do I make the request without having the HAL_I2C_Master_Transmit generate a <STOP>? That <STOP> in the middle resets the transaction with the sensor and all I get back are zeros. I have a sensor hooked up to a Pi and I can get proper responses using i2cget but it does not insert that <STOP>.
Thanks for insights. I'm going nuts here!
2019-08-26 05:30 AM
I used I2C protocol for temperature and humidity sensor interfacing with STM32L4xx.
if all above configuration is used for I2C, interface should work fine.
check your sensors data sheet as I'm unaware with this sensor.
Keep Going =)
2019-08-26 06:12 AM
Thanks. I thought that using software end was the approach. How do you set that up specifically?
Thanks so much for the reply. Your outline seems right.