processor expert i2c SendBlock size

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

processor expert i2c SendBlock size

跳至解决方案
1,349 次查看
zohargolan1
Contributor II

Hi All,

Is there a way to send a message with no payload, only the address?

Some devices (like the LTC2451), requires only the address with out any data, for the reading of the adc value.

If I am using size of 0 the SendBlock will return immediately and will do nothing.

Please advise

Zohar

1 解答
1,113 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello zohar golan:

Please mention the MCU part number. Are you using I2C_LDD?

I am not familiar with that device in particular (LTC2451), but the first transferred byte involves the address and a R/W bit to indicate the operation. If you are expecting to "read" values from such I2C slave, then you better use MasterReceiveBlock() with the number of bytes you are expecting to read. This will then send the Address + Read bit and prepare to receive bytes from the slave.

If the slave really just needs a dummy address, then I don't think that case is covered by Processor Expert I2C_LDD component, so you need to create your own API for this, it should be pretty simple.

If your MCU is from Kinetis family, I can also recommend you to check if it is already supported by KSDK platform and migrate your project. You can see the supported devices in the release notes.

Regards!

Jorge Gonzalez

在原帖中查看解决方案

2 回复数
1,114 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello zohar golan:

Please mention the MCU part number. Are you using I2C_LDD?

I am not familiar with that device in particular (LTC2451), but the first transferred byte involves the address and a R/W bit to indicate the operation. If you are expecting to "read" values from such I2C slave, then you better use MasterReceiveBlock() with the number of bytes you are expecting to read. This will then send the Address + Read bit and prepare to receive bytes from the slave.

If the slave really just needs a dummy address, then I don't think that case is covered by Processor Expert I2C_LDD component, so you need to create your own API for this, it should be pretty simple.

If your MCU is from Kinetis family, I can also recommend you to check if it is already supported by KSDK platform and migrate your project. You can see the supported devices in the release notes.

Regards!

Jorge Gonzalez

1,113 次查看
zohargolan1
Contributor II

Hi Jorge,

Thank you for your reply, seems like this function does the trick. The device I am using is MK20FX512VMD12.

I was using function call CI2C1_RecvBlock , which apparently is doing similar things.

Zohar

0 项奖励
回复