In the early MSP430 tests i created a blinking LED example that could be controlled through the pc serial connection. Someone on YouTube asked about the code, so i thought i'd post it. See below, small video and explanation first.
Now to create this, i started by stripping the temperature sense demo of everything not necessary, essentially only keeping the clocks setup and serial connection part.Then i added some state based led blink code from an earlier example i modified a little.
Keep in mind though that this was purely created as a private test, and is not optimal yet. For instance, when you press a button on the pc, it instantly sets the new state in an interrupt, but then goes back and finishes it's current blinking cycle before moving to the one you selected. That is because i used "delay_cycles" for the pauses in the blinking.If you would like that optimized, you could switch to timer or counter based blinking, and just reset that as well when a button is pressed (or, char is recieved on RX to be exact)
Edit: Well, a bug creeped into the code, thanks geoper2 for pointing that out!
If you already used the example, at around line 181 the code should be
if (P1IFG & 0x08) not: if (P1IFG == 0x08)
or the program halts when you press the button.With the code correction you will cycle through the blinking programs.
Updated code example: MSP430_serial_ledblink_corrected.txt