This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C clock frequency problem

Hi,

I am using NRF52832 development board , to which i have interfaced LIS3DSH accelerometer sensor(3.3V i2c)

when i  configure it for 1600 sampling rate and all the axis enabled , i am not able to get any data .

could anyone help with this problem.

also the I2c clock frequency, as shown in below image, while i am capturing data when i observe in oscilloscope or logic analyzer , clock frequency is showing 200 all the setting is for 400KHz.

what could be the problem for this or is there any other way i need to follow to set the clock to 400KHz.

help me ASAP...

Thank you

Parents
  • I think I have the answer see my reply here:  TWI speed not correct


    "I've had a similar issue. I think I found the source of the issue: the chip's TWIM clock stretching. I'm unfamilar of how the internal chip circuitry works, but I noticed when I added a longer wire to my circuit, all of a sudden the clock rate went from 250kHZ to 125kHz (with the master frequency set to 250kHz). Just by adding a wire! The additional capacitance must have some effect on the clock stretching circuit.

    Just speculating, but the theory would be the slow rise times fool the TWIM into thinking a peripheral is clock stretching, so the TWI skips a clock cycle until the clock line rises back again.

    For workarounds, try using a larger pull-up resistor."

Reply
  • I think I have the answer see my reply here:  TWI speed not correct


    "I've had a similar issue. I think I found the source of the issue: the chip's TWIM clock stretching. I'm unfamilar of how the internal chip circuitry works, but I noticed when I added a longer wire to my circuit, all of a sudden the clock rate went from 250kHZ to 125kHz (with the master frequency set to 250kHz). Just by adding a wire! The additional capacitance must have some effect on the clock stretching circuit.

    Just speculating, but the theory would be the slow rise times fool the TWIM into thinking a peripheral is clock stretching, so the TWI skips a clock cycle until the clock line rises back again.

    For workarounds, try using a larger pull-up resistor."

Children
No Data
Related