Open
Description
There is an issue with the I2C bus state when using low power deep sleep. The problem occurs when the sleeping. When the I2C master goes to sleep, the SCL and SDA lines are pulled low while the MCU is sleeping. This causes excessive power consumption during sleep because of the I2C pull up resistors. The next time the master wakes up, the SCL and SDA lines are pulled high and stay that way until the next I2C transaction. This cycle repeats. Here is the sketch. In this example, the rtc alarm event fires every 10 seconds.
void loop() {
Watchdog.reset();
if ( rtcTick >= heartBeatTick ) {
heartBeatTick += HEARTBEAT_PERIOD;
hostWire.beginTransmission(2);
hostWire.write("Blink");
hostWire.endTransmission();
}
LowPower.deepSleep();
}
void rtcAlarmEvent() {
// RTC alarm wake interrupt callback
rtcTick += RTC_ALARM_PERIOD;
rtc.setAlarmEpoch( rtcTick ); // Set the time for the next RTC Alarm
}