- Sun Dec 20, 2015 9:07 pm
#36861
THANK GOD!!!! Finally it works!!!! First of all, I tried Matherps code for the DS3231 and it worked just fine, so writing was working. The LA came to the rescue like this...
First of all, I was getting the i2c.begin(112) on the LA, but notice I was getting a NAK instead of an ACK. So a bit of fiddling with the resistors and viola, now getting ACK. YEAH!!!
Still could not get the display to work, so I hooked it back up to the uMite circuit and captured what was working on the LA. Then compared it to the esp to see what the difference was.
Here is a capture of working code on the uMite...
Code: Select allTime [s], Analyzer Name, Decoded Protocol Result
1.755961416666667,I2C,Setup Write to [0x70] + ACK
1.756055500000000,I2C,0x21 + ACK
1.756327666666667,I2C,Setup Write to [0x70] + ACK
1.756421666666667,I2C,0x81 + ACK
1.756696000000000,I2C,Setup Write to [0x70] + ACK
1.756790083333333,I2C,0xEF + ACK
1.757098416666667,I2C,Setup Write to [0x70] + ACK
1.757192416666667,I2C,0x00 + ACK
1.757286500000000,I2C,0x06 + ACK
1.757600916666667,I2C,Setup Write to [0x70] + ACK
1.757695000000000,I2C,0x02 + ACK
1.757789000000000,I2C,0x5B + ACK
1.758098916666667,I2C,Setup Write to [0x70] + ACK
1.758192916666667,I2C,0x06 + ACK
1.758287000000000,I2C,0x4F + ACK
1.758600166666667,I2C,Setup Write to [0x70] + ACK
1.758694166666667,I2C,0x08 + ACK
1.758788250000000,I2C,0x66 + ACK
And here is what was captured on the esp...
Code: Select allTime [s], Analyzer Name, Decoded Protocol Result
1.823055250000000,I2C,Setup Write to [0x70] + ACK
1.823169583333333,I2C,0x21 + ACK
1.823260666666667,I2C,0x81 + ACK
1.823351750000000,I2C,0xEF + ACK
1.847554500000000,I2C,Setup Write to [0x70] + ACK
1.847668833333333,I2C,0x00 + ACK
1.847759833333333,I2C,0x06 + ACK
1.872106833333333,I2C,Setup Write to [0x70] + ACK
1.872221166666667,I2C,0x02 + ACK
1.872312166666667,I2C,0x5B + ACK
1.898349583333333,I2C,Setup Write to [0x70] + ACK
1.898463916666667,I2C,0x06 + ACK
1.898555000000000,I2C,0x4F + ACK
1.924500666666667,I2C,Setup Write to [0x70] + ACK
1.924615000000000,I2C,0x08 + ACK
1.924706000000000,I2C,0x66 + ACK
You can see that the first three writes that initialize the display need to be 3 separate i2c operations. I changed the code by adding i2c.begins and i2c.ends to separate the first 3 operations and needed to get plastic surgery to remove the smile from my face. If you don't have a logic analyzer, do yourself a favor and get one. This is the only way I could have seen what was happening.
Anyway, time to get the www clock working...
Thanks to Mike and Matherp for your help. It pays to be persistent!!!