AT91SAM9G45 shutdown mode

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

denkrom
Posts: 4
Joined: Thu Jan 17, 2013 4:16 am

AT91SAM9G45 shutdown mode

Thu Jan 17, 2013 4:42 am

Hi everyone! I write simple program to try shutdown mode on a board:

Code: Select all

int main(void)
{
unsigned int i = 0;

TRACE_CONFIGURE(DBGU_STANDARD, 115200, BOARD_MCK);
printf("\n\r\n\r\n\r");
printf("-- Basic Project %s --\n\r", SOFTPACK_VERSION);
printf("-- %s\n\r", BOARD_NAME);
printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);

printf("DO ShutDown!!!");
AT91C_BASE_SHDWC->SHDWC_SHCR = ((0xa5 << 24) + AT91C_SHDWC_SHDW);

while (1) {

printf("INC: %d", i);
i++;

}

return 0;
}
download into sram and run it. But counter still working, board not shutdown. What's the problem? Please help.
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: AT91SAM9G45 shutdown mode

Thu Jan 17, 2013 10:12 pm

Hello,

Does your HW support it?

Two things to check:

Verify that the pin is connected to HW that turns off the power supply when driven LOW.

Verify that the SHDN pin on the micro is being driven LOW when you issue the command.

Regards
denkrom
Posts: 4
Joined: Thu Jan 17, 2013 4:16 am

Re: AT91SAM9G45 shutdown mode

Mon Jan 21, 2013 11:16 am

Yes, AT91SAM9G45 support shutdown mode.
SHDN pin always in LOW mode and not changes.
Why the processor doesn't perceive my sending to the register SHDWC_SHCR? Maybe wrong KEY (0xA5) or Shutdown Controller needs some initialization?

I try this task in IAR Embedded WorkBench.
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: AT91SAM9G45 shutdown mode

Mon Jan 21, 2013 4:24 pm

The shutdown controller requires that your "Slow Clock" is running. So I would check to make sure you have external 32.768 kHz crystal connected to your XIN32/XOUT32 pins or you are running the internal RC osc, and it is configured properly. See section "25. Clock Generator" for information.

EDIT: BTW what board are you using to test this with. Custom board or dev kit?

What ever board you are using when the SHDN pin is low the power supply on your board should be turned OFF. So it sounds like something on your board is also not configured properly.
denkrom
Posts: 4
Joined: Thu Jan 17, 2013 4:16 am

Re: AT91SAM9G45 shutdown mode

Wed Jan 23, 2013 5:34 am

I checked Slow Clock Control Register (SCKCR). His parameters: RCEN=1, OSC32EN=1, OSCSEL=1, OSC32BYP=0. I.e. Slow Clock is running from external 32.768 kHz crystal.
I run basic-rtc-project (Demonstrates basic usage of the Real-Time Clock peripheral) to test Slow Clock and it is works perfectly.
When processor in shutdown mode, user software don't work. Right?
I can't understand what's the matter?

I use dev kit from the third-party vendor (Starterkit).
Also I try Shutdown task on another board (SAM9-L9260 from Olimex) and it is don't works too!
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: AT91SAM9G45 shutdown mode

Wed Jan 23, 2013 6:22 am

The shutdown controller requires external hardware (out side of the processor) that removes power from the processor. It is intended to be a software controlled way to turn off/on power to the processor and possibly the whole board. Just like disconnecting/reconnecting the power from your board. Probably not what you are looking for.

I think you have this Shutdown Mode confused with Idle Mode (and Backup Mode).

In Idle Mode (and Backup Mode) the processor is halted and resumes via interrupt or restarts with a reset. This is probably what you want.

Have a look at the chapter that covers the "Power Management Controller (PMC)" in the data sheet for your processor. To see how to initiate Idle Mode (and Backup Mode) and what is needed to exit this mode. You can also read about the other various processor Modes.

Regards
denkrom
Posts: 4
Joined: Thu Jan 17, 2013 4:16 am

Re: AT91SAM9G45 shutdown mode

Thu Jan 24, 2013 3:57 am

Maybe I confused this modes. I will try to read about this more. Thanks a lot for your help!
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: AT91SAM9G45 shutdown mode

Thu Jan 24, 2013 9:21 am

I use dev kit from the third-party vendor (Starterkit).
Also I try Shutdown task on another board (SAM9-L9260 from Olimex) and it is don't works too!
FYI: the Olimex board does *not* have the required HW to enable shutdown mode.
Not sure which Starterkit you are referring to so I'm unable to tell you if this supports shutdown mode.

Again you probably want the Idle or Backup processor mode.

Regards.
El Berto
Posts: 16
Joined: Mon Feb 17, 2014 7:03 pm

Re: AT91SAM9G45 shutdown mode

Mon Feb 17, 2014 7:21 pm

Hi everybody, I'm having some issues with shutdown procedure (I'm using SAM9G25, is it the same?)....

1) on SAM9G25 datasheet I read SHDN is an output, "PU".
What does "PU" mean referred to an output?
I suppose "Open-Collector", so it needs a pull-up resistor?

SHDN output is always 0V.....
So I supposed I needed a pull-up resistor: with 100k to 3,3 volt, SHDN line is always 0 even after Halt command.

2) I'm using 5V psu for USB, then a second 3,3V PSU for SAM9G25.
To enter in shutdown mode, does SAM9G25 needs to detect 3,3V power off, right?
Regardless state of WKUP pin, right?

Thanks.

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 2 guests