Pages: [1]   Go Down
Author Topic: wake up from sleep mode through serial interrupt  (Read 1137 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi every one,
I'd like to put the SAM3X in sleep mode till something is receveid on the serial port. At section 5.5.3 of the SAM3X datasheet is written

 
Quote
The purpose of sleep mode is to optimize power consumption of the device versus response
time. In this mode, only the core clock is stopped. The peripheral clocks can be enabled. This
mode is entered via Wait for Interrupt (WFI) or Wait for Event (WFE) instructions with LPM = 0 in
PMC_FSMR.26
11057B–ATARM–28-May-12
SAM3X/A
The processor can be awakened from an interrupt if WFI instruction of the Cortex M3 is used, or
from an event if the WFE instruction is used to enter this mode.

do you think that the wakeup from the sleep mode should happen automatically if the interrupt procedure of the serial port is called?

Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it should, but why not try it and report back?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pmc_enable_sleepmode(0);
}

void loop() {
  // put your main code here, to run repeatedly:
if(Serial.available())
{
  Serial.print(Serial.read());
  pmc_enable_sleepmode(0);
  }
}

this code seems to work, at least it echoes what i write on the serial. The problem is that i can't check the currrent consuption since i don't have a laboratory power supply
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ciao aureliuss

did you find this topic? you could try....

http://stackoverflow.com/questions/20838412/arduino-due-serial-interrupt-procedure-to-wakeup-from-sleep-mode
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks Kove,
this stackoveflow post seems to confirm my method. It suggests even to try the backupMode, but the datasheet recommend to use backMode only for long wakepu time (wake up from back up mode takes approximately 0.5 ms that is too long for my application.) .
Logged

Pages: [1]   Go Up
Jump to: