Close

The Practical Hardware Design Guide: MSP430

tekobaseTekobase wrote 03/29/2022 at 17:02 • 5 min read • Like

MSP430™ is a 16-bit microcontroller of Texas Instruments. In this tutorial, we will create basic hardware for controlling LED strips.

The Microcontroller

We will use MSP430G2553, with 512B of RAM and 16kB of Flash program memory. This is sufficient for implementing many features, such as I2C OLED display driving, rotary encoder interfacing, motor control, etc.

Some variants of MSP430 have very small RAM. For example, MSP430G2211 has only 128B of RAM. For simple LED blinking and PWM controls, this may be enough. But for more advanced jobs such as OLED display control and interfacing I2C sensors, it's common to exceed the RAM usage. When building binary files in Energia or CCS IDE, the RAM and ROM usage is printed out. But if you're still in the early stage of firmware development or you're not sure how much RAM it will use, just try to use the highest model of MSP430 available.

As we will use a USB-serial converter for programming the MCU in this tutorial, we need to choose an MCU with a serial bootloader. Most of the MSP430 has a serial bootloader on ROM, called ROM-BSL. But not all the MSP430 have it. Some very low-end variants like MSP430G2211 have no ROM-BSL feature. For these chips, a 2-wire Spy-Bi interface can be used with a dedicated programmer/debugger like MSP430UIF.

For MSP430, choosing a delay capacitor (C1 on the diagram) is important. If this capacitor value is too big, the Spy-Bi-Wire cannot work, because the same pin is used for the data line in debug mode. The recommended values are 1nF for a 10k pull-up resistor.

Another common mistake is wiring the USB-serial converter's RX to MSP430's TX pin (P1.2 of MSP430G2553). This is valid for using UART communication. But for ROM-BSL, a different pin (P1.5 of MSP430G2553) must be used.

Section checklist:

USB Programming interface

There are several common USB-serial interface controller ICs, such as FT232, CP2101, PL2303, CH340. The ROM-BSL feature requires 4 pins - TX, RX, DTR, RTS. Note that not all USB-serial converter chips have all these pins available. For example, some CH340 and PL2303 variants do not have DTR or RTS pins.

CH340C and CH340B both have all 4 pins. But as CH340C requires an external crystal oscillator, we'll use CH340B for this example design.

USB Type-C port is widely used to replace the legacy USB micro-B and mini-B ports. In practice, USB-C ports are more strong mechanically. When using a USB Type-C port, be sure to use pull-down resistors for CC pins. These pins are used to tell the USB PD supply to get 5V power. Without these pull-down resistors, the board cannot be powered from USB-PD type supplies such as mobile phone chargers.

Section checklist:

Power supply and IO

Some PIC or AVR microcontrollers work for a wide power voltage range, e.g. 2~5.5V. But all MSP430 microcontrollers work only under 3.3V and don't accept 5V VCC. Make sure to use some 3.3V LDO or switching power supply.

Because the VCC is 3.3V, all the IO levels are 3.3V. This may be a problem for driving high-current MOSFETs directly. For example, to make a 50N06 (50A, 60V N-Channel MOSFET) fully open, the gate voltage should be greater than 5V. In this case, need to use a small MOSFET (e.g. 2n7002) for driving high current MOSFET.

Section checklist:

Full Design Example

Here are full design files in EasyEDA format for a LED lighting controller board as an example.

Prototyping with SMT Assembly Service

These are the fabrication files that can be directly uploaded to JLCPCB's online ordering form. These files can be exported from EasyEDA's Fabrication menu after editing the designs.

Here's the PCBA result from the JLCPCB SMT Assembly service. At the time of this writing, making 10 fully-assembled boards from JLCPCB costs less than 58USD including shipping, which is $6 per board. For mass qty like 100pcs or 500pcs, the unit cost will be decreased more.

Conclusion

Using the MSP430 microcontroller and JLCPCB's SMT Assembly service, we could design and prototype an LED lighting controller board, that is less than $6/pc.

For programming the MSP430 microcontroller on this board, refer:

Like

Discussions