2

I have an MSP430 Assignment which I'm doing in assembly, and the final part states to do this:

Then the microcontroller is put to sleep in mode 4. Another game will start by pushing the RESET button.

I can't find any way of putting it into sleep and after that, i have no idea how to get it out of sleep either. This is all I'm missing to finish my assignment, so any help would be awesome.

Thanks!

Mr. Adobo
  • 815
  • 1
  • 12
  • 24

2 Answers2

3

To enter LPM4 you need to check the datasheet of your specific part, and find where the LPM bits live (in one of the status registers). Set them to the right values using the appropriate assembly code, and that's it.

Assuming reset is connected to the RESET pin, that will wake it from sleep mode. without anything further needing doing.

Martin Thompson
  • 16,395
  • 1
  • 38
  • 56
3

Low power mode 4: SCG1=1, SCG0=1, OscOff=1, CPUOff=1:

BIS #F0h,SR

You can wake from LPM4 with an interrupt. If your reset button is connected to a pin that has an external interrupt associated with it, pressing it will wake your processor.

Adam Casey
  • 949
  • 2
  • 8
  • 24
  • Although it doesn't have the homework tag the OP said it was an assignment. Generally people don't just give out the answers to homework questions on SO, but rather hints on how to find the answer (see Martin's answer as an example). – tinman May 19 '12 at 08:07