-
Sat 2021.06.12
Appears to be a timing issue.
'After a 'save()', I2C fails'
Is a full power off, power on cycle being performed?
There doesn't appear to be any SDA logic high detection after uP reset.
p.11 https://datasheets.maximintegrated.com/en/ds/DS3231.pdf
'When the microcontroller resets, the DS3231 I2C interface may be placed into a known state by toggling SCL until SDA is observed to be at a high level. At that point the microcontroller should pull SDA low while SCL is high, generating a START condition.'
When I use the software I2C (I2C1 in the code above replaced with i2c1 = new I2C() ), everything works fine. This proves my hardware setup is fully operational.
It is of course not a real solution. When hardware I2C is available, I want to use it and not let the humble CPU consume bit-banging cycles for that...