Hi
I am working on Arduino Due I2C communication.
I2C frequency on Arduino Due is by default 100 kHz. I verified it using Oscilloscope.
I what to run I2C at 400 kHz. So changed TWI_CLOCK = 400000L at ../arduino-1.5.x/hardware/arduino/sam/libraries/Wire/Wire.h. But, I am not getting exact 400kHz on Oscilloscope. (I am checking SCL pin).
Following is the observation of I2C frequency on Oscilloscope.
I2C Frequency Set | I2C frequency Observed
100 kHz | 100 kHz
200 kHz | 181 kHz
400 kHz | 333 kHz
For default frequency of 100 kHz, observed frequency is correct but for other frequency there is an error which increase with frequency.
Is this the correct way to change the frequency of I2C? What is wrong?
Any response is appreciated. Please reply ASAP.
Thank You in Advance.
Komal
PS: Waveforms at observed frequency is attached.