MSP430 launchpad dev kit how too

A few weeks ago I had purchased a few MSP430 Launchpad, originally from Mouser, but there wait times for shipment of the product wasn’t until mid AUG to SEP

and decided that was unacceptable for my terms of getting product and or waiting for parts…..very few times have i waited for more then a month for anything that I wanted, Sugru was different so I waited for it…..but back to the MSP430.

after searching around I found a company that sold it and was in stock, so i Decided to cancel my other orders and go with them, the company was Newark, and i was very happy with there customer service….very friendly and polite. but i have finally gotten it and was able to do a little testing but not much in the way of programming, I haven’t set up the software for it or the library’s. But i did get to solder on the 32KHz crystal that was sent with the board………to my surprise it was a SMD 1.4mm+-.1mm crystal, with the leads .5mm apart from each other. I saw this and wondered why TI hates us hobbyist. I was expecting a regular through hole crystal, like they showed in one of the videos but that’s not the case, so i will do my best to solder one on to the boards and connect all the headers. I chose the regular female headers, sorta like the arduino, and i left the other board blank so i could solder wires and add other interesting gizmos to it and also to have a board that relies on the internal oscillator. so back to the how too……. Installing the crystal is probably the hardest part of the whole kit, just because the crystal is so small and hard to handle, but if you do it smart you can solder this piece in no time flat. So lets begin with things you may need

  • Supplies
  • Launch pad
  • 32KHz crystal
  • soldering iron
  • solder
  • headers
  • Bright lamp
  • electrical tape or tape like substitute
  • odds and ends (lol)(tweezers or other tool for manipulation)

after getting your supplies ready its time to start plugging stuff in and getting things setup


Remember these are small parts and you may want to get you tape ready before taking out the crystal from the packaging. The small size makes it extremely hard to manage and move around efficiently so you may want to grab your tweezers and start arranging it on the board.

after you have arranged it, making sure both leads touch the pads on the board, this took me a few tries to get it right, I barely could see the leads on the thing, so itΒ  might be a good idea to use a loupe or other magnifying device to line it up correctly.

after its lined up correctly you need to tape it down so you can try and solder such small piece. The leads on the crystal will tell what orientation it goes in, they are bent in a way that only one position will have the leads on the pads to solder.

Be very careful, do not bridge the pads, If you do you will have to remove the bridge and solder and start again, this will not ruin the board but its not something that i would look forward to doing. after the leads are soldered you have one more solder point to finish.


near the 2 solder points you will see a third point to solder, its at the top of the crystal ( what i call the top, Opposite of the leads). there are no leads to solder just solder the crystal down on that end, after that your ready to plug things in or finish soldering the rest of the board. you may choose to leave the through holes or solder female or male headers to the board, its all personal preference at this point.

Click to enlarge and see the solder points

after soldering and letting cool down for a moment it should be time to plug in your test chip (the one with the temp sensor and PWM) once you have plugged it in and verified you have it with the correct pins in the right place, turn it on and see if it still works. If you have done your job it will turn on and run the program. If it doesn’t turn on, your on your own, but I will to give you my input to try and help fix it.

Here is a few links to get you started with the MSP430 launchpad on Linux

it is fully supported on Windows OSs

http://losinggeneration.homelinux.org/2010/07/02/msp430-launchpad-on-linux/

http://eclecti.cc/hardware/using-the-ti-msp430-launchpad-with-ubuntu-10-04

In the near future these will be incorporated into other projects, one may be to replace the arduino in the BPM counter to a MSP430G2231 or similar device with an 10bit ADC. Also I will be creating a How to, to program your MSP430 value line using Linux.

BPM counter update is next πŸ™‚

UPDATE!!!

Test program to verify that you have successfullly installed the crystal correctly.
NON-MSPGCC code
//******************************************************************************
// MSP430F20xx Demo - LFXT1 Oscillator Fault Detection
//
// Description: System runs normally in LPM3 with WDT timer clocked by
// 32kHz ACLK with a 1x4 second interrupt. P1.0 is normally pulsed every
// second inside WDT interrupt. If an LFXT1 oscillator fault occurs,
// NMI is requested forcing exit from LPM3. P1.0 is toggled rapidly by software
// as long as LFXT1 oscillator fault is present. Assumed only LFXT1 as NMI
// source - code does not check for other NMI sources.
// ACLK = LFXT1 = 32768, MCLK = SMCLK = Default DCO
//
// //*External watch crystal on XIN XOUT is required for ACLK*//
//
//
// MSP430F20xx
// ---------------
// /|| XIN|-
// | | | 32kHz
// --|RST XOUT|-
// | |
// | P1.0|-->LED
//
// M. Buccini / L. Westlund
// Texas Instruments Inc.
// September 2005
// Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.40A
//******************************************************************************
#include <msp430x20x3.h>
volatile unsigned int i;
void main(void)
{
WDTCTL = WDT_ADLY_1000; // WDT 1s interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR = 0xFF; // All P1.x outputs
P1OUT = 0; // All P1.x reset
P2DIR = 0xFF; // All P2.x outputs
P2OUT = 0; // All P2.x reset
BCSCTL3 = XCAP_3; //12.5pF cap- setting for 32768Hz crystal
// An immedate Osc Fault will occur next
IE1 |= OFIE; // Enable Osc Fault
while(1)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/interrupt
}
}
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer (void)
{
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
}
#pragma vector=NMI_VECTOR
__interrupt void nmi_ (void)
{
do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0xFFF; i > 0; i--); // Time for flag to set
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
}
while (IFG1 & OFIFG); // OSCFault flag still set?
IE1 |= OFIE; // Enable Osc Fault
}

MSPGCC code

//******************************************************************************
// MSP430F20xx Demo - LFXT1 Oscillator Fault Detection
//
// Description: System runs normally in LPM3 with WDT timer clocked by
// 32kHz ACLK with a 1x4 second interrupt. P1.0 is normally pulsed every
// second inside WDT interrupt. If an LFXT1 oscillator fault occurs,
// NMI is requested forcing exit from LPM3. P1.0 is toggled rapidly by software
// as long as LFXT1 oscillator fault is present. Assumed only LFXT1 as NMI
// source - code does not check for other NMI sources.
// ACLK = LFXT1 = 32768, MCLK = SMCLK = Default DCO
//
// //*External watch crystal on XIN XOUT is required for ACLK*//
//
//
// MSP430F20xx
// ---------------
// /|| XIN|-
// | | | 32kHz
// --|RST XOUT|-
// | |
// | P1.0|-->LED
//
// M. Buccini / L. Westlund
// Texas Instruments Inc.
// September 2005
// Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.40A
// modified by justin solarski to work with MSPGCC 4.0
//******************************************************************************
#include <msp430x20x2.h>
#include <signal.h> // must be included for interrupt handler
volatile unsigned int i;
void main(void)
{
WDTCTL = WDT_ADLY_1000; // WDT 1s interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR = 0xFF; // All P1.x outputs
P1OUT = 0; // All P1.x reset
P2DIR = 0xFF; // All P2.x outputs
P2OUT = 0; // All P2.x reset
BCSCTL3 = XCAP_3; //12.5pF cap- setting for 32768Hz crystal
// An immedate Osc Fault will occur next
IE1 |= OFIE; // Enable Osc Fault
_enable_interrupt(); // enable interrupts added for mspgcc
while(1)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/interrupt
}
}
//#pragma vector=WDT_VECTOR removed for mspgcc
interrupt(WDT_VECTOR) watchdog_timer (void) //__interrupt void watchdog_timer (void) removed for mspgcc
{
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
}
//#pragma vector=NMI_VECTOR removed for mspgcc
interrupt(NMI_VECTOR) nmi_ (void) //__interrupt void nmi_ (void) removed for mspgcc
{
do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0xFFF; i > 0; i--); // Time for flag to set
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
}
while (IFG1 & OFIFG); // OSCFault flag still set?
IE1 |= OFIE; // Enable Osc Fault
}

** updated Post, Added #include <signal.h> for interrupt handler for MSPGCC, sry it was an oversight


21 Responses to MSP430 launchpad dev kit how too

  1. Thanks, I was wondering what that little widge was. I am so used to the wider oblong tin can oscillators I guess. I also think the soldering went much better adding a little solid flux to the pads first as well. Thanks for the idea on taping it down πŸ™‚ .

  2. Hey Justin thanks alot for this tutorial on how to solder and test the crystal on the the MSP430 Launchpad. I have been having some issues testing the crystal, I dont really know which code to use from the set of codes that you have above. I have the 2231 dip package installed on the board. I tested the first code and I get the red LED toggling rapidly, does this means I soldered it incorrect? or is there anything else I could do to test this. I check with the multimeter and it seems to be soldered properly. Any suggestions? Thanks

    • sry for the late reply, but it sounds like it may not be soldered correctly, the other way to test is use a timer with the crystal and see if it works. if you have a decent digital camera take a picture of the joints and check to see if its bridged or just not soldered to the pad.
      if you have more questions check out the forums, 43oh.com

  3. I did what you said and the tape was a good idea! First time I’ve soldering something so darn tiny and now I’ve got this realllllly fast blinking red led, it makes me feel good.

    I did it to the only board I have right now (I got 2 on my first order, gave one away, have 4 more coming) hehehe

  4. After some careful braiding and resoldering (It even looks so much nicer now) it’s timed correctly to one second intervals… yay! kinda browned a tiny section of the board, but it’s still functioning. πŸ˜€

    • Great to here it worked out for you, Yeah i do the same thing every once in a while , ill leave the solding iron on it too long and burns the board a little bit….the worst is on cheap PCB, the copper will lift if your not careful. Good luck and cant wait to see what you create πŸ™‚

      Justin

  5. I solder a fair number of surface mount components, so I have some experience soldering tiny connections. One thing that helps is magnification. I wear a head-mounted set of magnifiers that I can flip out of the way to read and flip back down to do fine work.

    Another thing that helps is to brace my hand. That is, I don’t hold the iron up in the air, but I put my wrist as close to the board as the iron will allow. Less shake that way.

    There’s nothing wrong with Justin’s method of taping the crystal down, but I do it a bit differently. Before taking the crystal out of the packaging, melt a small -small! – dab of solder onto one of the pads. With tweezers, a small screwdriver, popscicle stick, toothpick or whatever works for you, position the crystal so that the leads are in the right place. One will be lifted up off the board, sitting on a tiny hill of solder. Hold the crystal down and reheat the solder. It’ll melt quickly and the crystal’s lead will sink into it. Take away the heat, count to 3 and stop holding the crystal down. If you didn’t shake too much, the crystal is in the right place, held down by one lead. If you need to reposition, now’s the time to re-heat and reposition. The key is to hold the crystal down as you take the iron away, or the crystal might stick to the iron instead of the board. Once the crystal is in the right place and held down by one lead, it’s fairly simple to solder the other lead to the pad and the case to the big pad. Reheat the first lead if it looks iffy. If you bridged the pads, a little solder wick will clean that up.

    Hope that helps someone else!

  6. Just tried the tape & solder method and loaded the the code in IAR. It’s working awesome, but check this out: I move my finger within an inch of the crystal and it starts blinking super fast. Move it away, and it goes back to the 1-sec cadence. If I do it while holding the exposed part of the usb jack, it doesn’t happen. Crazy.

  7. Avatar Eric, NC
    Eric, NC says:

    I have compiled and run the LED test without a problem.

    But when I try the crystal test program get a (.text+0x60): undefined reference to `_enable_interrupt’.

    I copied and pasted the program right from this page.

    I using Mint linux and msp430-gcc

    Any idea’s?

    • OK, just in case someone else has this problem.

      “_enable_interrupt(); ” in the code example for mps430-gcc needs to be “__enable_interrupt();”

      Two underscores, not just one.

      • Thanks for the info, you got to it before i had a chance to even look at it :). That directive worked fine on my mspgcc, but it is a good thing to point out.

  8. Avatar billabott
    billabott says:

    I really needed this one. Worked out fine for me. Thanks for putting this up on the web.

  9. Pingback:CΓ³mo calibrar el MSP430 a 16 MHz | …::: SeveroBot :::… I.E.S. Severo Ochoa, Elche

  10. I m newbie at this.We soldered crystal to just one place.You put male headers to pins.Can we solder anywhere else?Maybe pins
    Like p 1.6

    • you have to solder the crystal to the pad, you can not solder it to the header holes. if you solder it to the holes the crystal will not work right, or maybe not at all.

  11. Make sure to apply solder only to the tips of the xtal’s pins. If you get a solder bridge between the pins or the case close to the case, you lose (as I did)!
    Also see this site for more details on the software side: http://litom.com.pl/blog/msp430/basic-clock-configuration/

  12. If we want to solder anything else like external something like stepper motor maybe we use breadboard,is female header or male header is necessary or we don’t use them and solder directly to pins

    • if you wanted to you could just use the board and solder wires to it or any other device, instead of using the headers.

  13. The example code is missing the line

    BCSCTL3 = XT2S_0 + LFXT1S_0 + XCAP_3;

    which configures the MSP430 to set (according to GRACE)
    * XT2S_0 — 0.4 – 1 MHz
    * LFXT1S_0 — If XTS = 0, XT1 = 32768kHz Crystal ; If XTS = 1, XT1 = 0.4 – 1-MHz crystal or resonator
    * XCAP_3 — ~12.5 pF

    Especially the last line is important – if it is missing the crystal gets really sensitive to e.g. waving your fingers above it.

    • Just to clarify –
      XT2S_0 does not need to be set, the default is setup for the crystal & applies to XT2( XT2 is not applicable to value line chips) .
      LFXT1S_0 defaults to the 32768 HZ crystal when you choose to source from XT1, does not need to be set unless you are using a different clock source IE VLO or another crystal that is not 32768Hz

      XCAP_3 – would need to be set for precision, but does not necessarily need it if you want to check if the crystal was installed. but it is a good idea to include it on any other programming that needs the crystal. I know the crystal is touchy.

      Added the XCAP_3 (~12.5pF)to the code, correct setting when using supplied Crystal –