-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimum SCL frequency #29
Comments
The delay between HIGH-to-LOW, and LOW-to-HIGH transitions of the SCL clock signal are stored in a |
Thanks, sounds reasonable. I will modify the library in mi application however, because I need to use I2C over a 6 meter fire-resistant wire. With 10kHz (using ESP32 hardware I2C) we have seen sporadic errors, especially at high temperatures, presumably because of signal degradation due to an increase in impedance. I will be trying out baud rate in the 500Hz range. Btw, I am using this library because with the hardware I2C on the ESP32 we cannot set a clock lower than 10kHz for some reason. |
I don't know what you have done with the hardware but when I needed to drive I2C over a distance of about 2 metres there were some modifications I made:
If the drive capability of the ESP32 is weak you might find a I2C driver specifically designed for I2C helpful. I used a PCA9517A which is sold as a level-translating I2C bus repeater. On the software-side I am not convinced that that reducing the clock speed much lower will be helpful unless your cabling has really high capacitance. If the ESP32 has read errors from measurement noise there is one thing you could try. You could take multiple measurements of the SDA logic-level and accept the majority result. You don't even need to modify
This of course will not help much if the device at the far end is also suffering noise when decoding the outgoing I2C message (even if just decoding the address). |
I just realised that you could also call |
Thanks for your guidance steve, greatly appreciate it. In our hardware we are using 1k resistors on the ESP32 side. We will evaluate using two resistors on the line, maybe it is an issue with noise as you say, high currents are flowing in the ovens where the sensor is installed and this could potencially be the source of the problem. With 100kHz, the capacitance on the line can be clearly seen using an osciloscope in the lab, with 10kHz it is greatly reduced, so that's why I am interested in lowering even further. I will send you pictures, today or tomorrow. |
Hello,
¿Why does the library have a lower bound to the I2C frequency? It seems that the lowest frequency allowed by setClock is 1961 Hz. ¿Whats the reasoning behind this?
Nice library btw.
The text was updated successfully, but these errors were encountered: