Hello all,
backgroud: I'm trying to interface with a air speed sensor: the MS4525DO.
To start a conversion I need to send through I2C only one byte: the address of the sensor. To read the result I need to send the address and then read the 4 byte of data.
The problem is that either: I2C_DRV_MasterSendDataBlocking() and I2C_DRV_MasterReceiveDataBlocking() behave not correctly if cmdSize and txSize (for the Send function) parameters are set to zero.
This because there is no control in the function of the value of cmdSize and txSize and in the ISR there is a if(--master->cmdSize > 0) that of course create problem if master->cmdSize is set to 0 from the beginning.
Same thing for txSize.
For the moment the workaround is to set the 2 parameters to 1, so the SendData packet is 3 bytes instead of 1 and the ReceiveData packet is 6 bytes instead of 5. Not a big deal (luckily the sensor accept it anyway) but it uses the bus more than the necessary.
I hope that in the next release this will be solved.
Best Regards
Giacomo
Edit:
in any case it seems that something is not behaving correctly (blue pin toggle, green I2C SCL line)
the end of I2C_DRV_MasterSendDataBlocking() should be shortly after the end of the packet, but it is circa 1 msec after. This value doesn't change even if I modify the timout setting of the function.
Best Regards
Giacomo
Hello giacomopetrini:
KSDK v1.1.0 has just been released. Check this: KSDK 1.1 Release
This version includes enhancements to some drivers, including the I2C. I recommend you to install this version and try it.
Let us know if you experience the same problems or share the code of your application.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
just did :smileywink:.
I'm updating the project to use the KSDK 1.1 right now (and I have a wierd error withthe C++ compiler, but I'll open another thread for this).
Regards
Giacomo