MCP2221DLL SmbReadBlock 讀不到資料

作者 datou 於 2018年01月02日 16:23:11
使用MCP2221 I2C SMBus Terminal可以正常讀到資料,用MCP2221DLL SmbReadBlock就讀不到,回傳-18(timetou)。

MCP2221 I2C SMBus Terminal 設定:

Protocol:SMBus
Address Length:7bit
Address:73
Operation:Read
Register Index:99
Data:A
PEC:Off

Source code

byte smbAddress
= 0x73;
byte[] smbReadData = new byte[10];
uint numberOfBytesToRead = 10;
uint smbSpeed = 100000;
byte usesPEC = 0;
byte readRegIndex = 0x99;
int ret = UsbI2c.Functions.SmbReadBlock(smbAddress, smbReadData, numberOfBytesToRead, smbSpeed, usesPEC, readRegIndex);

來自: http://www.microchip.com.tw/newbb/viewtopic.php?forum=1&topic_id=22164&post_id=77639