using I2C1 in Kinetis to read temperature sensor

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

using I2C1 in Kinetis to read temperature sensor

2,389 次查看
mehdikarimibiuk
Contributor V

and I see the program stucks in that last while loop and "prints 2" all the way! Why?

I have my I2C1 interrupt based so master should receive the "ACK signal" before interrupting that "I sent all data", correct?

 

also the last command (" I2C1_MasterSendBlock(I2C1ptr, &passin, 1, [[LDD_I2C_SEND_STOP/ OR /LDD_I2C_NO_SEND_STOP]]);"), I tried with no send stop and it did not work. On page 9, it says, it should send with stop signal.

标签 (1)
5 回复数

2,055 次查看
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. CodeWarrior Development Tools or Kinetis Microcontrollers ) to get it visible for active members.

For details please see general advice Where to post a Discussion?

Thank you for using Freescale Community. 

2,055 次查看
mehdikarimibiuk
Contributor V

I moved it. Is there any update for this?

Can anyone tell me why I cannot talk properly to the I2C temperature sensor component?

0 项奖励
回复

2,055 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Mehdi, sorry for the delay.

The problem here seems to be the same as in your other thread (K60 I2C-EEPROM write and read). Each time you call the MasterSendBlock() API, the K60 Master must be sending the address before the data.

As workaround you can put together all the data you want to send in the same buffer (in this case 0xAC+0x01 in the same buffer).

With this the call to MasterSendBlock() should only generate 1 start signal and send the data correctly.

Let me know if this helps.

Regards!

Jorge Gonzalez

0 项奖励
回复

2,055 次查看
mehdikarimibiuk
Contributor V

No I did not pass data first!

Did you not read my other posts?

0 项奖励
回复

2,055 次查看
mehdikarimibiuk
Contributor V

can you please post answers for this post K60 I2C-EEPROM write and read

I will close this thread.

Thanks!

Mehdi

0 项奖励
回复