I2C fast mode frequency

Hi,

We have 2 queries regarding I2C modes,

1. I2C fast speed mode

    We are undergoing test of I2C under I2C_SPEED_FAST - 400Khz 

    when we enable this frequency on our logic analyzer we are able to read 413Khz as attached in screenshot, we are using laird bl653 (document attached - CS-GUIDE-BL653-DVK_v1_0-1855868.pdf)

    we need to know the tolerance of acceptance ? is 413Khz acceptable ?

2. We want to know more about I2C speed modes,

    as per speed configurations in i2c.h there are following configurations 

    I2C Standard Speed: 100kHz - I2C_SPEED_STANDARD
    I2C Fast Speed: 400kHz - I2C_SPEED_FAST
    I2C Fast Plus Speed: 1MHz - I2C_SPEED_FAST_PLUS
    I2C High Speed: 3.4MHz - I2C_SPEED_HIGH
    I2C Ultra Fast Speed: 5MHz - I2C_SPEED_ULTRA 

    as per above configurations & mentioned detail here https://docs.zephyrproject.org/latest/reference/peripherals/i2c.html, we don't have 250Khz config

    and attached in laird bl653 document (CS-GUIDE-smartBASICEXT-BL653 v30_2_2_0_0.pdf) it mentions 250Khz (document and screenshot attached)

    we want to have more clarity about speed configurations in I2C

CS-GUIDE-BL653-DVK_v1_0-1855868.pdf

CS-GUIDE-smartBASICEXT-BL653 v30_2_2_0_0.pdf

Thank you,

Parents
  • short answer:
    There is nothing wrong with that, the device will work.

    and yes, the "Fast +" mode is used only in nrf5340. otherwise only have "standart" and fast modes this is due to the fact that for high exchange frequencies, current control of the lines is already required in order to obtain steep fronts.

    more expanded:
    The standard does not define the bus rate, but rather simply specifies the typical times: low clock duration, clock high duration, and rise time. These parameters add up the exchange rate, but you noticed that the speed is indicated not in bits / s, but in Hz.
    therefore, for a typical speed of 400 kHz, a small variation is allowed. the main thing is to monitor the steepness of the fronts and the capacity of the bus. Capacitance for 400 kHz should not exceed 400 pF. It is better to generally be at the level of 100-200 pF.
    also, the fact that you measured 413kHz does not mean anything, since the next data frame may have a different frequency. this is due to the fact that, by default, nrf52 chips clock the peripherals from an internal source. if you switch forcibly to an external quartz resonator / oscillator, you will get different numbers.

    p.s. see you diagrams in analog mode. then you will see if the pull-up resistors have been chosen correctly. 

    from what I see, I suspect a very weak leading edge. Due to this, the clock pulses are quite narrow.

    and yes, the frequency meter from sale is mediocre. it counts at the level of 0.7 from the one specified in the settings. therefore, often the readings also depend on the selected sampling frequency.

  • Hi, 

    as i mentioned earlier in this link  https://docs.zephyrproject.org/latest/reference/peripherals/i2c.html while developing on zephyr I2C defined speed configurations we have definition for mentioned speed only

    I2C Standard Speed: 100kHz - I2C_SPEED_STANDARD
    I2C Fast Speed: 400kHz - I2C_SPEED_FAST
    I2C Fast Plus Speed: 1MHz - I2C_SPEED_FAST_PLUS
    I2C High Speed: 3.4MHz - I2C_SPEED_HIGH
    I2C Ultra Fast Speed: 5MHz - I2C_SPEED_ULTRA

    can you please suggest if we are to use  nrf connect sdk how do we add configurations for 250khz as existing configurations are only for mentioned speed.

    Thank you,

  • Hi Hitesh,

    As you can see from the TWI documentation,

    The speed 250kbps is supported and this should be the default speed if no speed configuration is mentioned. 

    Regards,

    Priyanka

  • sorry, I just passed by. And it seems to me that you do not understand each other. I'll rephrase the question a little. the question is not whether the NRF can support a speed of 250 kHz, but how to set the desired speed using the Zephyr.

    for some unknown reason, Zephyr for this board suggests using the i2c module and offers constants for 100 kHz, 400kHz and 1000kHz. but for NRF it is more correct to use the TWIM module.

    I understand that the topic starter's question is exactly this: how to switch to TWIM in Zephyr and set the speed to 250 kHz, aren't?

    as i mentioned earlier in this link  https://docs.zephyrproject.org/latest/reference/peripherals/i2c.html while developing on zephyr I2C defined speed configurations we have definition for mentioned speed only

    You shouldn't use I2C. You must change using node to TWIM (Please, read this page: https://docs.zephyrproject.org/latest/reference/devicetree/bindings/i2c/nordic%2Cnrf-twim.html#dtbinding-nordic-nrf-twim). and after this. you can use speed 250kHz.

Reply Children
No Data
Related