Problem when using MSP430G2553 without Launchpad
I found a way to connect the chip on the breadboard. It seems to work well except the the motor won't turn off once it starts spinning for the first time(it spins non-stop until I remove the power). When I use a LED instead of the motor, it works fine. It detects proximity, activates the transistor and the LED for 1 second then it turns off.


The part of your story which I have emphasised, is giving a big clue.

One difference between using an LED as the load (which works correctly) and using a motor as the load (which doesn't work correctly) is the much greater current required by the motor. Your diagram shows no decoupling capacitors.

Another difference is the back-EMF generated by the motor on power-off, but your diagram shows a freewheeling diode, so that seems less likely to be the main problem.


  Is there any components that is missing?


Returning to the subject of capacitors, a plausible reason why your design works with the MSP430 on the Launchpad, is because the Launchpad already has power supply decoupling capacitors included in its design, but they are missing from your design. When the motor turns on, the extra current required could cause a brief dip in the voltage supplied to the MSP430, causing it to misbehave and so not continue running the code and so not turn-off the motor.

I don't know what components you have, and I assume you don't have an oscilloscope to measure the voltage at the MSP430 power pins. In general, I recommend you to:


add a relatively "large" (e.g. 50 uF up to 100s of uF) capacitor across the power rails immediately adjacent to the motor (observe correct capacitor polarity, as capacitors of that value are likely to be electrolytic); and
add a smaller (e.g. 0.1 uF up to 1 uF) capacitor across the power pins of the MSP430, with the shortest possible leads, immediately adjacent to the IC.


Then retry your test and report back.