Waking From Lpm0 - Texas Instruments LaunchPad MSP-EXP430F5529LP User Manual

Table of Contents

Advertisement

www.ti.com
Similarly, code checks for these other interrupt-driven events that may have occurred after the main loop
checked their flags. If execution enters sleep while these flags are set, they are not handled until yet
another interrupt occurs. This could cause the device to be unresponsive.
For similar reasons, interrupts are disabled prior to evaluating any of these flags. It takes several cycles to
evaluate these conditions, and because these events can occur at any time, the status of the early flags
could potentially change before LPM0 is actually entered. If LPM0 were then entered, they would get
missed. Disabling interrupts prevents that from happening; the events are simply queued up. When
interrupts are re-enabled, any interrupts that came in take effect immediately.
Therefore, the code simultaneously enters LPM0 and re-enables interrupts by setting the GIE bit:
_bis_SR_register(LPM0_bits + GIE);
If an interrupt had come in while interrupts were disabled, the CPU will wake again in the very next cycle
after entry.
3.5.6
LPM0 Exit
When emulating the code, if the device is sleeping, main() execution is seen resting at the LPM0 entry.
The demo application can then exit LPM0 and resume execution in response to three different events:
A SCSI READ/WRITE command has been received. (This happens from a USB interrupt, which can
happen at any time.)
A USB event has occurred. (This happens from the USB event handlers, which are triggered by USB
interrupts, which again can happen at any time.)
One of the LaunchPad pushbuttons has been pressed.
SLAU533B – September 2013 – Revised June 2014
Submit Documentation Feedback
USB event handlers
USB interrupt results in a
USBHID_handleSendCompleted ()
indicating the HID report has now been sent
flag is set to TRUE
bUsbSendCompleted
The handler returns TRUE, waking the
device from LPM0 (if it was sleeping)
From within the USB API
USB interrupt results in new
MSC SCSI command received
Wake from LPM
Figure 30. Waking From LPM0
MSP-EXP430F5529LP LaunchPad™ Development Kit User's Guide
Copyright © 2013–2014, Texas Instruments Incorporated
event,
Port I/O ISR
Pushbutton is pressed
or
bButton1Pressed
bButton1Pressed
flag is set to TRUE
Software Examples
37

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LaunchPad MSP-EXP430F5529LP and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents