User manual

GHI Electronics,LLC Embedded Master User Manual
Hardware and Software Library
11.17. Power Control / Sleep
Hibernate is supported to save power. In this mode all clocks are stopped. This feature
should be used by advanced users only. The user must disable peripherals such as USB
Device and CAN before hibernating and re-enabling them after waking up, as needed.
LPC24xx data sheet should be used as a reference.
Hibernation mode is entered by calling Utility.HibernateSystem() then the processor will only
wake up as the user specified. For example, in order to wake up on a button press
connected to a GPIO pin, the pin must be defined as interrupt port and INTWAKE register
must modified before sleeping. Likewise, registers can be directly modified to tweak the
sleeping mode operation.
Utility.HibernateSystem() first sleeps the processor (Power-down mode in PCON register,
refer to LPC24xx datasheet), and after waking up, it resets all clocks including
USBCLKCFG, then control is returned back to the user.
Normal power operation is about 160mA. In hibernate mode, it is about 40mA.
Example
// Before sleeping
Register INTWAKE = new Register(0xE01FC144); // Interrupt wakeup
INTWAKE.Write((1 << 7) | (1 << 8)); // wake on GPIO0, GPIO2 activity
// define an interrupt pin to wake up the processor on the rising edge (on button
release)
InterruptPort DownBtn = new InterruptPort(EmbeddedMaster.Pins.E0x, true,
Port.ResistorMode.PullUp,Port.InterruptMode.InterruptEdgeHigh);
// sleep, Press and release Down Button to wake it up.
Microsoft.SPOT.Hardware.Utility.HibernateSystem();
// User can resume operation now
A full project example is provided with he SDK.
Hibernate_GPIO_Wakeup and Hibernate_USB_Wakeup projects.
Rev. 2.06 TFT Page 88 of 102 www.ghielectronics.com