how go to deep sleep or backup mode?

Hey Guys,

I have some problems with the Arduino DUE.

When cut the PowerSupply off, the RTC of the Cortex-M3 still should run. For this there es is Backup-Battery at the VDDBU-Pin at the Atmel.

But everytime i program, reset, or cut off the Power Supply the RTC is empty.

How can i fix this?

I hope I could fix it, when I set the Arduino into backup mode, so the RTC could going on with the Battery Supply, but it drains aroud 200µA. (The Datasheet says it should it should drain around 2,5A in Backup Mode)

SCB->SCR |= (uint32_t) SCB_SCR_SLEEPDEEP_Msk;
__WFE();

Or are there other ways to safe the RTC time?

okay, with "__WFI();" it seems to work, because the arduino doesnt react to any inputs. I think the Serial-Connection was the event to wake him up with "WFE".

But if I cut off the Power, the CPU does a reset and the backup-mode is off and the board will drain again around 200µA. :(

It seems like there is no possibility to use the RTC, when the power could cut off. Because the Reset-button/Soft-Reset delete all the memory including RTC etc.

So with every Serial connection, new program the RTC is set to zero.

Same is for the Backup-Mode. You can use the backup mode, but when Power is back online, the Due will do a reset -> RTC is gone.

For users who will work with a battery (and no extra power) and dont use the serial communication its no problem to use the backup-mode.

A Battery just for backup-supply is not possible, I think :(

To use the RTC you would need a RTC crystal and you would need the power supply wiring to be different. You can't do it on a standard Arduino Due board.