Mr. Adobo
Mr. Adobo

Reputation: 835

How to make MSP430 Sleep in mode 4?

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!

Upvotes: 2

Views: 1303

Answers (2)

Adam Casey
Adam Casey

Reputation: 989

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.

Upvotes: 3

Martin Thompson
Martin Thompson

Reputation: 16832

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.

Upvotes: 3

Related Questions