Thursday, October 27, 2011

Programming the DEV.BO and External Targets with a LaunchPad

Many readers have been asking me how to program the DEV.BO with the LaunchPad. Likewise, many of you are also wondering how to program the newer MSP430 microcontrollers with the LaunchPad, such as the MSP430F55xx series.

Since this seems to have sparked quite a bit of confusion, I want to make this post complete and thorough. There are two ways to program an MSP430: the first is using four-wire JTAG, the second is using two-wire JTAG. The LaunchPad can only use the two-wire JTAG method, which is also known as Spy-Bi-Wire (SBW). For the rest of this post, I will be referring to the two-wire JTAG as SBW and four-wire JTAG as just JTAG.

I want to make sure this is clear before I continue; JTAG and SBW are two separate methods for programming an MSP430. The LaunchPad can program MSP430s using SBW, not JTAG. That being said, not all MSP430s can be programmed using SBW, some of the older MSP430s can only be programmed using JTAG. TI has a document, SLAU157, which shows which chips support either just JTAG or both JTAG and SBW.

Now that we know JTAG and SBW are different methods of programming newer MSP430s, how do we use the LaunchPad to program all these cool devices? Spy-Bi-Wire needs two wires to program an MSP430: RST and TEST. The image below shows where you can find these two pins on the Launchpad.
The programming pins on the LaunchPad
The RST pin is shown by a yellow square, TEST is shown by a green square, and all of the GND pins are shown by blue squares. What about power? Well, you can either use the LaunchPad to power the DEV.BO (or your target MSP430 that supports SBW) or use an external power source. Regardless of how you power the target, you will need to also connect the LaunchPad's GND pin to the target. This is because you need a common reference for the data pins (RST and TEST); so technically you actually need a minimum of three wires to program an MSP430.

DEV.BO programming header
For this post we will use the LaunchPad to not only program the DEV.BO, but to also power it during programming. The image above shows which signals make up the programming header on the DEV.BO. There is a reason that I designed the programming header pins in that order. They are the same order as the LaunchPad; this is very important. What about the GND pin on the LaunchPad? Though there is no GND pin on the programming header, the LaunchPad does have a few GND pins available on board. Depending on what you have to connect the boards together, determines which GND you should choose.

The programming connection on the LaunchPad's side
The image above shows how I connect the DEV.BOs header to the LaunchPad. That nice six pin rainbow connector is available here at SparkFun and it works great for this task. Notice how I am using female connectors on this LaunchPad which makes it easy for me to connect GND to the rainbow connector using just a short breadboard wire. If you don't have access to this nice rainbow ribbon cable, you can use any method to connect these pins together.

Hopefully that should clear up any confusion on how to program the DEV.BO. Using this method, you can also program any other MSP430 that supports SBW; just connect up the necessary pins and you can program away.

I have two last things I want to mention. The RXD and TXD pins are not needed for programming but I included them on the DEV.BO in case they are ever needed for a project. The second thing is that you need to make sure the correct chip is selected in CCS or whatever IDE you use when programming the MSP430, otherwise it probably won't work.

I hope this clears up any confusion on how to program external MSP430s, including the DEV.BO, using the LaunchPad. Please leave a comment if you have any questions about this post. Don't forget to check out the DEV.BO, which is available in my online store.

Comment away!

22 comments:

  1. Hi this really helped me to get some test boards up and running, programming an MSP430G2231 off the launchpad. I am thinking of doing a small production run (approx 20 boards) and was wondering if you could recommend anywhere that is good to buy a small quantity of chips from, any place i have looked it is about $2 a chip + outrageous postage ( i live in Australia) making it more cost effective to just by launchpads which seems like a very poor way to source chips.

    ReplyDelete
  2. @Hugoagogo - Glad I could help! As for buying the MSP430 in small quantities, you will have to accept a large markup from the 1k pricing. Also, the DIP version of the chip is a decent amount more expensive than the surface mount packages.

    Though I do not know what is best for Australia, I would look at either Mouser or DigiKey as they both provide international shipping. You can also order in quantities of 25 if you are making 20 boards, this adds some savings with Mouser.

    http://www.mouser.com/Search/Refine.aspx?Keyword=msp430g2231&Ns=Pricing%7c0&FS=True

    ReplyDelete
  3. @NJC Yea i know i can accept a reasonable markup on the chips it is the $40 postage for 50 grams of stuff that gets me.

    Also i haven't really done much surface mount soldering before do you know any good guides on this?

    ReplyDelete
  4. Yeah, I always hate paying more for shipping than my items cost. I try my best to save my orders up so I can order LOTS of stuff at once. Check out the eevblog forums, they might have some good recommendations for Australian suppliers.

    For a SMD soldering tutorial, check out SparkFun.

    http://www.sparkfun.com/tutorials/36

    ReplyDelete
  5. Has anyone had experience trying to using a F-series MSP430 with the launchpad? In particular, I see these MCUs support SBW and have exactly the same pinout (including Vcc, Vdd, Test & RST) than the "value" series.

    Should they work or is there something I am missing?

    ReplyDelete
  6. Dimitri: Using an F-series device which has the same pinout will work fine. For example, the MSP430F2013 can be put in the target socket and it will program with no problem. I actually mentioned this in one of my earlier posts; the LaunchPad is really a great device.

    ReplyDelete
  7. Thanks for the quick response, NJC. I have ordered a few Launchpads, can't wait to start experimenting with them and the F2013's 16-bit ADC!

    ReplyDelete
  8. hai, i am newbie, i recently ordered MSP430F5527,if i buy launchpad, will i be able to program the above mentioned ic. thanks

    ReplyDelete
  9. As you probably knew, the LaunchPad pcb has ground plane construction. This means all the empty space on the board is actually GND. It's easy to extend the header and add the missing GND pin. You only have to drill the hole, no wires needed. Unfortunately there is empty space only in the other (left) end of the header.

    ReplyDelete
  10. Hi!
    I need a little help. Have you encountered the problem when powering the target from separate source even if the target power is off the target still gets powered from the debugger rst through the clamp diodes. I can't get a power cycle without de-attaching the debugger. Do you have some workaround for this?

    ReplyDelete
  11. Alex, I also have this problem and I also just unplug the debugger. It is quite frustrating. I wonder if anyone else has come up with a solution to this? If not, it's up to TI to release better firmware for the LaunchPad.

    ReplyDelete
  12. Thanks for a really helpful post. Do you happen to have any recommendations for headers/cables that one can use if one wishes to use the J4 holes for communications between a Launchpad and another board? I've trolled through the web but haven't seen any simple answers to the question.

    ReplyDelete
  13. @cpt - I believe the J4 header is the same size as the one from the EZ430 boards. If I remember correctly, somewhere in the EZ430 documentation (a $20 tool which predates the LaunchPad) TI states what should be used there. The best advice I can give would be to find the right sized headers and make your own makeshift cable converting the J4 holes to a standard size.

    ReplyDelete
  14. There are Launchpads revisions with different sequence of the pins. For example in rev. 1.5.

    ReplyDelete
  15. hey your link to the , SLAU157, is not working. Could kindly update it if you could?

    thanks

    ReplyDelete
    Replies
    1. Thank you for letting me know that the link is broken. I will fix it shortly.

      www.ti.com/lit/pdf/SLAU157

      Delete
  16. Hey i have one question. SBW is supported by not only the MSP value line and series 5 but all the other new 430s too right? so Since they use SBW, cant I use my Launchpads SBW JTAG to program them?

    I mean, SBW must be universal right? so if on a certain msp430 says it can be programmed using SBW, would I be able to?

    Im just curious.
    Im talking about the 4.33$ development board by TI

    ReplyDelete
    Replies
    1. Generally speaking, the MSP430 LaunchPad can be used to program any SBW supported device. Almost all of the new (if not all of the new) MSP430 devices can be programmed via SBW. That being said, if the firmware on the LaunchPad does not support a certain device, it might not be able to program it. Your best bet would be to ask TI directly if a chip is supported.

      Delete
  17. Hi where can i get MSP430 launchpad schematic and layout from?

    ReplyDelete
    Replies
    1. There are many MSP430 LaunchPads, however all of them have the schematic available on their product page. As an example:

      http://www.ti.com/tool/MSP-EXP430G2

      The schematic is available under the Hardware Design Files document. Hope that helps!

      Delete
  18. THANKS can you please confirm how many layers does the MSP430 exp430g2 board have and if it has separate Ground and Supply planes ?

    ReplyDelete

Note: Only a member of this blog may post a comment.