2016-06-06 12:28 AM
hi,
I'm using stm32f103rct6 to communicate with OPT3001 sensors.I use I2C1 for the configurationto read data from 16bits register it's done but I have problem to send 16bits data.I used this function when I tried to read the same register I find juste one Byte.void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data){ /* Check the parameters */ assert_param(IS_I2C_ALL_PERIPH(I2Cx)); /* Write in the DR register the data to be sent */ I2Cx->DR = Data;}have any one solution?thanks2016-06-06 01:10 AM
I2C protocol don't supprort 16-bit data.
I2Cx->DR is 8-bit.2016-06-06 01:18 AM
2016-06-06 02:32 AM
SO read bytes....
2016-06-06 04:20 AM
So break the 16-bit word into high and low bytes and send the after each other.