using I2C1 in Kinetis to read temperature sensor

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

using I2C1 in Kinetis to read temperature sensor

1,227件の閲覧回数
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 返答(返信)

893件の閲覧回数
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. 

893件の閲覧回数
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 件の賞賛

893件の閲覧回数
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 件の賞賛

893件の閲覧回数
mehdikarimibiuk
Contributor V

No I did not pass data first!

Did you not read my other posts?

0 件の賞賛

893件の閲覧回数
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 件の賞賛