如何配置高通平台i2c 时序

Setting I2Cclock dividers

I2C规范对I2C时钟脉冲的高电平和低电平周期设置了限制。



为了满足这些限制,可以对QUP寄存器I2C_CLK_CTL进行编程,以设置I2C时钟分频器。




1、Defaultvalues

如果hs_div不为0,如何计算fs_div和hs_div的默认值:

I2C_FS_CLK =I2C_CLK/(fs_div+hs_div+6)

100K transfer rateas example:

19.2M (CXO)/100K(transfer rate) = fs_div+hs_div+6 fs_div+hs_div = 186

通常 fs_div = 2hs_div

这就是为什么默认是: 124/62 under 100K transfer rate.

Output clock frequency

FS divider

HS divider

100 kHz

124

62

400 kHz

28

14

1 MHz

8

5

Other non-standard frequency

OEM必须使用以上的公式计算FS和HS分配器。

 

2、Setvalues

时钟分频器值可以在不同的电路板上有所不同,以满足I2C规范限制。 您可以使用以下DTS字段覆盖驱动程序中设置的默认值:

i2c_2: i2c@f9924000 { /*BLSP1 QUP1 */

//snip

qcom,fs-clk-div = <28>;

qcom,high-time-clk-div =<14>;

};

 

The FS divider value is responsible for the LOW period (Tlow). Reducingit by 1 shortens Tlow by 52 ns (assuming the source clock is TCXO 19.2 MHz).

 

3、Dividersvs clock frequency

SCL期间计算如下:

T = TCXO * ( (FS_DIV+HT_DIV) +6 + NR) + Trise

where

TCXO is 52ns

NR is Noise Rejection level

Trise is SCL Rise time

 

Trise将> 0,因此输出时钟(1 / T)将小于我们设置的时钟(例如400 kHz)。


Output clock isless than 400 kHz due to added rise time

 

Output clock is 400 kHz due to excluded rise time

分频比FS_DIV / HTD应为2:1。 调整分频值以保持该比例并获得较小的和,以便可以生成更高的输出时钟。

例:

100K transfer rateas example:

19.2M (CXO)/100K(transfer rate) = fs_div+hs_div+6

fs_div+hs_div =186

The defaultfs_div/hs_div is: 124/62 under 100K transfer rate.

 

If OEMs want to achieve a longer output clock hightime, they can change the hs_div to 63 or a larger value, so that fs_div shouldbe (186 – hs_div) = 123, and vice versa, they can change the hs_div to asmaller value.




例如:






  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值