In this blog post, I will show you how to program an MSP430G2 series chip outside the MSP430 LaunchPad (MSP-EXP430G2) development board using the Launchpad itself as a programmer. This is useful for doing in-system programming without having to swap the target chip in and out of the LaunchPad.
Each MSP430 LaunchPad comes with its own flash emulation hardware as well as the MCU itself, and thus it can be used as a programmer independent of the rest of the MCU circuitry. By default, the programming headers (see picture below) are connected to the on-board MCU via jumpers, but the jumpers can be easily removed so that you can use the flash emulation portion by itself as a programmer.
MSP430G2 devices support the Spy-Bi-Wire interface (see slau320i: Programming Via the JTAG Interface) and the corresponding pins are brought out via the TEST and RST pins:
On 14 pin devices (e.g. MSP430G2231, MSP430G2211), the SBWTDIO (Spy-Bi-Wire test data input/output) pin corresponds to pin 10 (RST) and the SBWTCK (Spy-Bi-Wire test clock) pin corresponds to pin 11 (TEST). On 20 pin devices (e.g. MSP430G2452, MSP430G2553), the SBWTDIO pin is pin 16 and SBWTCK pin is pin 17. The relative locations for these two Spy-Bi-Wire pins are the same across all MSP430G products.
To program an external MSP430G2 device, you need to simply remove all the jumpers from the LaunchPad develpment board and connect the TEST, RST and ground pins with your target device (see picture below). Since the on-board MCU will be disconnected from the flash emulation circuitry there is no need to remove the MCU from the Launchpad when programming an external device. And the external device does not have to be the same type as the one on the LaunchPad either.
In the picture below, the RxD pin is also connected, this was for my testing purpose and is not needed for programming the chip.
According to the reference design, a 47K resistor should be used as the pull-up resistor on the RST pin.
Using this setup, you can program the external chip using TI’s Code Composer Studio the same way as you would with the LaunchPad, except in this case the external chip is being programmed instead of the chip on the LaunchPad.