CP2112 returns incorrect data after an Address Read Request (HidSmbus_AddressReadRequest())

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> BrianL on ‎10-21-2014 11:37 AM - edited on ‎12-09-2015 06:59 AM by Administrator Siliconlabs

Symptoms

With Auto Read Response enabled, calling HidSmbus_AddressReadRequest() followed by HidSmbus_GetReadResponse() results in incorrect data. The response buffer will usually include the address of the target data. For example, if the bytes at address 0xAA are 0x04, 0x05, requesting an address read for this data and then calling GetReadResponse will result in the following data&colon; 0xAA, 0x05.

Diagnosis

This is a known issue with the CP2112. There is a small window of time between sending the last address byte of the Read Request and waiting for the restart to complete where the device could mistakenly send the SMB buffer containing the address bytes as a response.

Solution

The soultion, in this case, is to disable Auto Read Response, and instead use Force Read Response after every Address Read Request. The command flow would then be:

 

HidSmbus_AddressReadRequest()
HidSmbus_ForceReadResponse() 
HidSmbus_GetReadResponse()

 

For more information, see this post.