nickcengel / TinyWireSio

I2C Library for Attiny Controllers for Platformio
4 stars 1 forks source link

Clock precision #1

Open nablabla opened 1 year ago

nablabla commented 1 year ago

Hi, I am having trouble to get my ESP talk to my atTiny44(with TinyWireSio) I looked at SCL/SDA with a scope and a logic analyzer: It all looks correct according to i2c specs and is identical to what my Arduino Nano is doing, which does work properly - the tiny sends an ACK at the correct time and the Nano understands. The ESP has the same code (the i2cScanner from the arduinoIDE), but the tiny does not respond to, i.e. no ACK (and no clock strech attempts) visible on the wires. Although the communication is identical with one exception: The ESP's clock cycle is 13us long in constrast to the Nano's correct 10us (resulting in 100kHz). Is the 13us clock cycle just too slow for the TinyWireSio? Can I set it into a more tolerant mode? best regards and thanks!

nablabla commented 1 year ago

grafik

Here is the timing diagram that I logged (the same instance for each masters, but I highlighted different timings with the tool). Additionally I checked with the scope, the signal has an amplitude of 4.3V (actually slightly higher for ESP) in both cases and look rather clean. Now as you can see, I increased the speed of the ESP to match that of the Nano, but still no Ack from TinyWireSio. In the nano case it sends the Ack after 8.87us and it looked like it streched the clock, because for all the other addrs the clock was not streched. The only difference that is visible now is that the Nano starts the clock later after the START symbol. btw the ESP can talk to other clients (don't want to use the s-word)