S32K312 - How can I set I2C baud rate?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312 - How can I set I2C baud rate?

Jump to solution
1,105 Views
ssean
Contributor II

Hello.

How can I set I2C baud rate for S32K312 MCU ?

Source clock from AIPS_SLOW, 30 MHz.

I want to set baud rate to 400 Kbps.

How can I set this config page ?

ssean_0-1703664951411.png

 

Best Regards,

SEAN SUNG

 

 

 

0 Kudos
Reply
1 Solution
1,080 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Please refer to the Table 424. Timing Parameters of S32K3XXRM. Modify the value of I2c Clock High Period(CLKHI) and I2c Clock Low Period(CLKLO). The I2c Baud Rate will be automatically calculated based on your input value and will be displayed there. But the value you configured now is too small, causing it to exceed the Baud Rate upper limit of LPI2C_FAST_MODE (so it is displayed in red). Please also note: Table 426. LPI2C Timing Parameter Restrictions

Table 424. Timing Parameters Table 426. LPI2C Timing Parameter Restrictions.png


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

3 Replies
1,081 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Please refer to the Table 424. Timing Parameters of S32K3XXRM. Modify the value of I2c Clock High Period(CLKHI) and I2c Clock Low Period(CLKLO). The I2c Baud Rate will be automatically calculated based on your input value and will be displayed there. But the value you configured now is too small, causing it to exceed the Baud Rate upper limit of LPI2C_FAST_MODE (so it is displayed in red). Please also note: Table 426. LPI2C Timing Parameter Restrictions

Table 424. Timing Parameters Table 426. LPI2C Timing Parameter Restrictions.png


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,059 Views
ssean
Contributor II

Dear Robin.

 

Thank you for reply.

I set CLKHI=31, CLKLO=42, FILTSCL=1, PRESCALE=2 (DIV4)

My calculated baud rate is 100000 (100K).

ssean_2-1703832686054.png

But S32DS auto calculated baud rate is 200000(200K).

ssean_3-1703832880536.png

ssean_4-1703832980716.png

 

What is my miss?

Could you check my project(attached), please?

And.. HAPPY NEW YEAR!

 

Best Regards,

SEAN SUNG

0 Kudos
Reply
1,052 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi SEAN SUNG,

I think it should be 100K. Maybe the S32 Configuration Tool calculated it wrong. It is recommended to test the actual frequency of SCL. And observe the value of PRESCALE during debug.

HAPPY NEW YEAR!


Best Regards,
Robin

 

0 Kudos
Reply