Page 1 of 1

ATSAM3X8EA / AT91SAM and PowerModes/VDDBU

Posted: Fri Jan 30, 2015 9:47 am
by Pyroplan
Hey Guys,

i have a problem to use the RTC in the ATSAM3x.
With external PowerSupply the RTC works well.
But it should also work then i disconnect the power (Backup Battery is installed).

Is there a register which must be set? 
In the moment the Atmel is drawning ~300µA which is quite high  :(

The Datasheet says, that I must set the SUPC_MR Register at least two slow clock periods before VDDIO voltage is removed. 
But it should detect automaticlly the disconnect power and go to backup mode und wake up then Power is on again. 

Can u pls help me?  :?

Re: ATSAM3X8EA / AT91SAM and PowerModes/VDDBU

Posted: Wed May 13, 2015 12:11 pm
by b-s-a
Today I have resolved same problem on AT91SAM3S1C:
1. Check for resistor between TMS/SWDIO line and GND. Before I add it (10K) power consumption in backup mode was about 300-400 uA.
2. Move all PIOs (except XIN* and some application specific ones) to output state with data 0.
3. Setup wakeup events
4. Disable BOD
5. Go to sleep: while(1) { SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; __WFE(); }

Code: Select all

    PIOA->PIO_PER = ~0U;
    PIOA->PIO_OER = ~PIO_OER_P7; //XIN32
    PIOA->PIO_ODR = PIO_OER_P7; //XIN32
    PIOA->PIO_PPDDR = ~0U;
    PIOA->PIO_PUDR = ~0U;
    PIOA->PIO_CODR = ~0U;

    PIOB->PIO_PER = ~0U;
    PIOB->PIO_OER = ~PIO_OER_P9; //XIN
    PIOB->PIO_ODR = PIO_ODR_P9; //XIN
    PIOB->PIO_CODR = ~0U;
    PIOB->PIO_PPDDR = ~0U;
    PIOB->PIO_PUDR = ~0U;

    PIOC->PIO_PER = ~0U;
    PIOC->PIO_OER = ~0U;
    PIOC->PIO_CODR = ~0U;
    PIOC->PIO_PPDDR = ~0U;
    PIOC->PIO_PUDR = ~0U;

    SUPC->SUPC_WUMR = 0;
    SUPC->SUPC_SMMR = 0;
    SUPC->SUPC_WUIR = SUPC_WUIR_WKUPT0_HIGH_TO_LOW | SUPC_WUIR_WKUPEN0_ENABLE;

    SUPC->SUPC_MR = SUPC_MR_BODDIS_DISABLE | SUPC_MR_ONREG_ONREG_USED | SUPC_MR_KEY(0xa5);

//    SUPC->SUPC_CR = SUPC_CR_VROFF_STOP_VREG | SUPC_CR_KEY(0xa5); //alternate way to sleep
    while (1) {
        SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
        __WFE();
    }
Check power consumption without debugger connected.

Re: ATSAM3X8EA / AT91SAM and PowerModes/VDDBU

Posted: Sat Jul 04, 2015 8:50 pm
by masud
hello b-s-a
could u please help me understanding the code u written, what "->" it mean, i am sorry for my negligence but i coudnot understand this symbol, and i even coudnot find on google. and it would be batter for me if u provide some soft material.
Thanks

Re: ATSAM3X8EA / AT91SAM and PowerModes/VDDBU

Posted: Mon Jul 06, 2015 10:01 pm
by jharley
Get yourself a book on C language or search the web for C language tutorials or find a C language reference like ....

http://www.gnu.org/software/gnu-c-manua ... Structures

Regards

Re: ATSAM3X8EA / AT91SAM and PowerModes/VDDBU

Posted: Fri Jul 29, 2016 3:12 pm
by elphnei
Hi.

Did you ever get the RTC to keep date and time using a backup battery?

I have the same problem using a SAM3U4E. Data and time are not being retained when there is a backup power supply connected.

Thanks.