Hi
I am working on Arduino Due I2C at 400kHz. By default I2C frequency is 100kHz. I observed waveform on Oscilloscope and it gives perfectly fine. I changed the frequency to 400kHz. (This change was done by writing TWI_CLOCK = 400000L at ../arduino-1.5.x/hardware/arduino/sam/libraries/Wire/Wire.h) But this gives only 333kHz. Following was observed at different frequency.
Frequency set | Frequency observed
100 kHz | 100 kHz
200 kHz | 180 kHz
400 kHz | 333 kHz
I am not getting what is the issue. Is there anything else need to modify, to change I2C frequency?
Any input is appreciated. Please let me know ASAP.
Thank You in advance.
PS - Waveform for 100kHz, 200kHz and 400kHz are attached.
For 100kHz - One cycle = 4 blocks of 2.5us = 42.5 us = 100 kHz
For 200kHz - One cycle = 5.5 blocks of 1us = 5.51 us = 181 kHz
For 400kHz - One cycle = 3 blocks of 1 us = 3 * 1 us = 333 kHz