Sun Microsystems V2.0 manual Deep Sleep, Activating deep sleep mode

Page 38

CPU – power on but CPU clock off (the CPU's power saving mode)

Master system clocks – power on

Low level firmware – power on

RAM – power on but inactive

Flash memory – power on but inactive

CC2420 radio – power on

AT91 peripherals – power on

Because power is maintained to all the devices the Sun SPOT continues to react to external events such as the arrival of radio data. The Sun SPOT also resumes from shallow sleep without any latency. That is, as soon as any thread becomes ready to run, the Sun SPOT wakes and carries on.

Deep Sleep

The Sun SPOT can be programming to use a deeper power-saving mode called “deep sleep”. In this mode, whenever all threads are inactive, the Sun SPOT can switch off its primary power supply and only maintain power to the low level firmware and the RAM.

CPU – power off

Master system clocks – power off

Low level firmware – power on

RAM – main power off, RAM contents preserved by low power standby supply

Flash memory – power off

CC2420 radio – power off

AT91 peripherals – power off

The Java thread scheduler decides when to deep sleep. It takes some time to wake from deep sleep, so the scheduler may choose to shallow sleep if the sleep duration will be too short to make deep sleep worthwhile. Because deep sleep involves switching off the power to peripherals that may be active it is necessary to interact with the device drivers to determine if deep sleep is appropriate. If a deep sleep cannot be performed safely the scheduler will perform a shallow sleep instead.

Activating deep sleep mode

Deep sleep is enabled by default. You can disable deep sleep mode using the SleepManager:

ISleepManager sleepManager = Spot.getInstance().getSleepManager(); sleepManager.disableDeepSleep();

If deep sleep is disabled the Sun SPOT will only ever use shallow sleep. Once deep sleep is enabled, the Sun SPOT may choose to deep sleep if appropriate.

The minimum idle time for which deep sleeping is allowed can be found from the SleepManager. For example, the following code can only ever trigger a shallow sleep:

Thread.sleep(sleepManager.getMinimumDeepSleepTime() – 1);

The following code may deep sleep, but only if a number of preconditions (detailed later) are met:

Thread.sleep(sleepManager.getMinimumDeepSleepTime());

The minimum deep sleep time includes a time allowance for reinitializing the hardware on wake up so that user code resumes at the correct time. Any part of the allowance that is not needed is made up using a shallow sleep.

38

Image 38
Contents Page Page Contents Http protocol support Introduction Building and deploying Sun Spot applications Deploying and running a sample applicationBuild Successful Total time 3 seconds \MyApplication Ant -Dport=COM2 info Total time 4 seconds \MyApplication Total time 0 seconds \MyApplication Deploying a pre-existing jar Incorporating utility classes into your applicationOther user properties Manifest and resourcesExcluding files from the compilation Overview Using the BasestationBuilt-in properties Set up Introduction Base Station configurationRemote operation Connect a Sun Spot base station Take suitable actions during over-the-air downloads Using short names for SPOTsManaging keys and sharing Sun SPOTs BackgroundChanging the owner of a Sun Spot Sharing Sun SPOTsGenerating a new key-pair What is protected?Deploying and running a host application LimitationsIncorporating pre-existing jars into your host application Configuring network featuresYour own host application Mesh routingLogging Hardware configurations and USB powerTrace route Page Thread priorities Overview of an applicationThreads Device Interface Sun Spot device librariesSun Spot device library Persistent properties Accessing flash memory Overriding the Ieee addressUsart Radio communication library Program Radiogram protocol Client end Server endYou can open server radiogram connections in a similar way Broadcasting Radio properties Turning the receiver off and on Shallow Sleep Conserving power using deep sleep modeMonitoring radio activity Activating deep sleep mode Deep SleepDeep sleep behaviour of the standard drivers USB inhibits deep sleepPreconditions for deep sleeping Device Condition to permit deep sleepWriting a device driver Configuring the http protocol Http protocol supportConfiguring projects in an IDE Socket Proxy GUI modeDebugging Classpath configurationJavadoc/source configuration Ant selectapplication Configuring NetBeans as a debug client Configuring Eclipse as a debug clientUsing library suites Advanced topicsWith adderlib as your current directory, execute the command Use the command Using the spot client SpotSerialPortException other exception in serial port comms Property name Meaning ReferencePersistent system properties Memory usage Contents of the arm directoryContents of the lib directory Start address Space UseContents of the bin directory preverify.exe Contents of the upgrade directory Contents of the tests directory