Search found 56 matches

by MartyMacGyver
Sat Mar 25, 2017 8:27 pm
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

I'll give that a look - define "much better" though... are you seeing errors still, but fewer, or no problems at all (so far)?
by MartyMacGyver
Wed Mar 22, 2017 5:19 pm
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

If you can point us to the code and a description of the setup (what kind of display we need to use), I'll pass this info along so that we can see if the hardware is generating invalid waveforms at some point. It's not so much the code that matters as the device under test does. A display gets far ...
by MartyMacGyver
Wed Mar 22, 2017 7:09 am
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

I was away for a short time. I see your point about rise times and such, but despite that I2C on the ESP32 is proving to be tricky and not very reliable. I've been watching my STM32 drive an I2C OLED display flawlessly for an hour now at 400KHz... the ESP32 is lucky to do it for a minute before glit...
by MartyMacGyver
Thu Mar 09, 2017 11:10 am
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

That strikes me as peculiar... the STM32 operates I2C in open drain mode and doesn't have anything as near as much trouble keeping near the frequency (and the clock settings are straightforward - no fiddle factors). Is there any pull-up value that will produce an actual 400kHz when SCL is configured...
by MartyMacGyver
Tue Mar 07, 2017 11:59 pm
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

This comes back to how exactly you are testing this - what pins are you using? Which bus? Which *board*? What code? Yes, I'm checking normal clocks within the data stream, not the potentially stretched clock periods. The frequencies are off. Try adding some load, an extra I2C device or at least some...
by MartyMacGyver
Tue Mar 07, 2017 9:18 pm
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

I tried your correction along with Espressif's, as you did above. I even reverted to the 1:1 duty cycle to test it. The 100kHz SCL was just about 99kHz, and the 400kHz SCL was around 397kHz. However, that was with two I2C devices I was testing with (OLED with 4.7Kohm pull-ups + a digital barometric ...
by MartyMacGyver
Tue Mar 07, 2017 8:44 pm
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

I was curious to see what app code you ran as part of your test. The Arduino ESP32 HAL has none of the corrections the IDF HAL has but is otherwise similar. The fact that you have to add that much more correction to both SCL low and high periods is similar to what I experience - but while that makes...
by MartyMacGyver
Tue Mar 07, 2017 10:45 am
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

My work on the Arduino-ESP32 fix is proceeding well. You can find the work in progress at https://github.com/MartyMacGyver/arduino-esp32/tree/bugfix-i2c-timings The main changes are in https://github.com/MartyMacGyver/arduino-esp32/blob/bugfix-i2c-timings/cores/esp32/esp32-hal-i2c.c (including annot...
by MartyMacGyver
Mon Mar 06, 2017 8:55 pm
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

So we're on the same page, can you share the code you used to test this?

As for other timings, I think part of the problem is how the various timings are set in the HAL. That's part of what I'm looking at, and once I create a modified HAL to share I'd like to see how it differs.
by MartyMacGyver
Mon Mar 06, 2017 11:02 am
Forum: Report Bugs
Topic: I2C SCL frequency 10% less than it should be at 400kHz
Replies: 55
Views: 92399

Re: I2C SCL frequency 10% less than it should be at 400kHz

I'll be interested in seeing what actual frequency you measure for SCL set to 400kHz (excluding stretched cycle(s)). If you test into a dummy load, please specify the resistance you're terminating SCL and SDA with when you measure this. The registers are being set correctly - it's the output that va...