Closed ldericher closed 2 years ago
If you can build the firmware yourself, you can comment out this line and you should be able to use the new I2C driver that allows FAST and FASTPLUS speeds.
use the new I2C driver
Fair enough.
Tried it, SLOW speed kind of works (but with frequent errors), anything faster does not produce any recognizable waveform anymore. Meanwhile, Arduino Version works fine without any errors.
No thanks, NodeMCU is not for me … or at least it doesn't cut it for this project.
Hi!
It seems, NodeMCU on only supports one I²C speed. I mostly copied this code from the documentation:
With my scope, I can see the whole transaction takes about 25 ms. It doesn't even matter which speed is put in the
i2c.setup
call, as long as it's any positive integer.1
or1000000
instead ofi2c.FASTPLUS
results in the same exact speed visible on my oscilloscope.I created an equivalent Arduino sketch, which took just over 2 ms to execute. Same hardware, same pins.
I tried this on the cloud-built "release" firmware image of NodeMCU, as well as a local build on Linux of both the "release" and the "dev" branches – same results.
~ LDer