S32G2 I2C How can I adjust the baud rate?

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

S32G2 I2C How can I adjust the baud rate?

2,338 次查看
eason08253426
Contributor I

Hi

    I want to set the baud rate of i2c to 400KHz and use the tree parameter in S32DS MCAL I2c_1 ex: picture1(the red line) is 52083. The baud rate is 52.5kHz on the board (Picture2) with setting the parameter is (2,5,5) same with sample code, but when I modify the tree parameter(blue line) like picture3, it shows the baud rate is 378787HZ but on the board is 37.8kHz in Picture 4.

The i2c Module Clock Frequency in the Picture1 is 133333333Hz

How can I adjust the baud rate between 100 and 400Khz?

 chip: S32G274A

Use S32 RTD AUTOSAR 4.4 3.0.2 HF01 D2204

I2c_lp_Transfer_S32G274A_M7 Example

1.

eason08253426_0-1668750039771.png

2.

eason08253426_1-1668750040048.png

3.

eason08253426_2-1668750040190.png

4.

eason08253426_3-1668750040706.png

 

 

标记 (3)
0 项奖励
回复
3 回复数

2,308 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hi eason08253426,

Perhaps, the internal pull-up resistor value = 2k2Ω is affected to the baud rate in the second situation.

In the second situation, Could you try to re-test using the resistor value = 200Ω or 10KΩ pull-up VDD for both SDA and SCL?

Best regards,

Dan

 

0 项奖励
回复

2,292 次查看
eason08253426
Contributor I
Thanks for your reply, I will try your suggestion

2,302 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hi eason08253426,

About the formula calculate baudrate, you can view this file:

C:\NXP\S32DS.3.4\eclipse\mcu_data\components\PlatformSDK_S32XX_2022_03\I2c\I2c_Ip_PBcfg.c

Best regards,

Dan

0 项奖励
回复