IIC Communication on K66F

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

IIC Communication on K66F

1,888件の閲覧回数
a8Chcx
Contributor V

Hi,

I am using K66F for our controller and found some weird issue on IIC communication:

When I run 100KHz on IIC, it works fine with my device.

I am trying to test with 50KHz, and it stops working. I am just using SDK function and change baud-rate.

I think all other settings are done by SDK, right?

Can anybody tell me how to change it to 50KHz? Do I need to change any other parameters as well?

 

Thanks,

Christie

0 件の賞賛
返信
4 返答(返信)

1,858件の閲覧回数
a8Chcx
Contributor V

Hi,

I tried 50KHz and get the bestMult = 0 and  bestIcr = 0x34.

If I am using bestMult = 0 and  bestIcr = 0x2c from 100KHz, and it works fine.

Could anybody tell me what the best number(bestMult, bestIcr) I should use for the different speed because the auto calculated number are not the best fit?

Thanks,

 

Christie

0 件の賞賛
返信

1,818件の閲覧回数
RaRo
NXP TechSupport
NXP TechSupport

Hello @a8Chcx,

Could you please try using the I2C SDK examples? Is the same behavior happening there?

What are you referring with "it stops working"? Is it not working at 50kHz or is it not working at all?

Also, the best MULT and ICR values for 50kHz could be: MULT (00h -> 1) and ICR (34h -> 1152), MULT (01h -> 2) and ICR (2Ch -> 576), and MULT (02h -> 4) with ICR (24h -> 288). These three combinations give you approximately 52kHz. You could see how it is calculated in K66 Sub-Family Reference Manual. Chapter 58. Inter-Integrated Circuit (I2C). Section 58.4.2. I2C Frequency Divider register (I2Cx_F).

Best regards, Raul.

0 件の賞賛
返信

1,780件の閲覧回数
a8Chcx
Contributor V

HI Raul,

Thank you for your reply.

1) I am using SDK and tried 100Khz, I got MULT=0, SCR=0x2C and it works fine.

2) I tried 50Khz, I got MULT=0, SCR=0x34 and it didn't work.

3) Then I tried 50Khz, I got MULT=0, and SCR>=0x23 and <=0x33 and it all works fine.

That is why I think the calculated MULT and SCR are not good for 50KHz. Can you tell me how to decide the best MULT and SCR for the different speed? More important is 50KHz and 100KHz that I am going to use...

 

Another question: I enable "I2C_MASTER_FACK_CONTROL" in SDK and looks fine as well? Could you tell me what the main purpose is? Can it improve I2C reliabilty?

Thanks,

Christie

0 件の賞賛
返信

1,629件の閲覧回数
RaRo
NXP TechSupport
NXP TechSupport

Hello @a8Chcx,

Can you tell me how to decide the best MULT and SCR for the different speed?

Could you please tell us the I2C module clock speed (Hz) that you are using? In K66 Sub-Family Reference Manual. Chapter 58. Inter-Integrated Circuit (I2C). Section 58.4.2. I2C Frequency Divider register (I2Cx_F)., is explained which values of MUL and SCR could be used.

Another question: I enable "I2C_MASTER_FACK_CONTROL" in SDK and looks fine as well? Could you tell me what the main purpose is? Can it improve I2C reliabilty?

The MCUXpresso SDK API Reference Manual mentions the following:

RaulRomero_0-1696014376587.png

[Section 22.2.2.5. Slave Operation in interrupt transactional method]

Best regards, Raul.

0 件の賞賛
返信