Jump to content

  • Log In with Google      Sign In   
  • Create Account

Photo

Best information for those new to the MSP430?


  • Please log in to reply
66 replies to this topic

#1 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 31 January 2011 - 10:53 PM

If you are new to the MSP430 then you're probably drowning in information right now.

It's true that there are a zillion configurations to make before the 430 will do what you want it do do.

So I'm betting that you are asking yourself "Where do I start?"

I humbly suggest the following TI application notes and books that will get you going in the right direction:

1. slaa294: MSP430 Software Coding Techniques

This application report covers software techniques and topics of interest to all MSP430
programmers. The first part of the document discusses the MSP430 standard
interrupt-based code flow model, recommended for the vast majority of applications.
The next part discusses a handful of techniques that should be considered by any
developer that sets out to develop an MSP430 application. Using these methods can
greatly reduce debug time and/or provide additional robustness in the field. They
include initialization procedures, validation of supply rails before performing
voltage-sensitive operations, and use of special functions. Code examples are
provided.


2. : MSP430 32-kHz Crystal Oscillators

Selection of the right crystal, correct load circuit, and proper board layout are important
for a stable crystal oscillator. This application report summarizes crystal oscillator
function and explains the parameters to select the correct crystal for MSP430
ultralow-power operation. In addition, hints and examples for correct board layout are
given. The document also contains detailed information on the possible oscillator tests
to ensure stable oscillator operation in mass production.


3. MSP430 Microcontroller Basics: MSP430 32-kHz Crystal Oscillators

Selection of the right crystal, correct load circuit, and proper board layout are important
for a stable crystal oscillator. This application report summarizes crystal oscillator
function and explains the parameters to select the correct crystal for MSP430
ultralow-power operation. In addition, hints and examples for correct board layout are
given. The document also contains detailed information on the possible oscillator tests
to ensure stable oscillator operation in mass production.


3. [url=http://www.amazon.com/gp/product/0750682760?ie=UTF8&tag=machinegridco-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0750682760]MSP430 Microcontroller Basics by John H. Davies

The best thing I can say about this book at this time is that it describes well how to make use of the clocking system of the MSP430. This book should be in your personal library or at least on your wishlist.

Once you digest the information above then you will be in good shape for success in working with the msp430.

Have something to add?
Then post up your valuable sources of knowledge.


  • bluehash, gatesphere, GeekDoc and 11 others like this

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#2 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 05 February 2011 - 04:02 AM

As you progress in your development of an embedded system based upon the MSP430, you will eventually have to cut your dependency on your dev board. When you do this, you will have to give your system the ability to be programmed.

Whether by JTAG or by Spy-Bi-Wire, you will have to assimilate and understand the information inside this document. Otherwise, you will have a brick coming off the assembly line.

Do want to make a million bricks or a million dollars?

Knowing this information will save you time, money and prevent ulcers!


4. slau320: Programming via the JTAG Interface

This document describes the functions that are required to erase, program, and verify the memory module
of the MSP430™ flash-based microcontroller family using the JTAG communication port. In addition, it
describes how to program the JTAG access security fuse that is available on all MSP430 devices. Device
access using standard 4-wire JTAG and 2-wire JTAG [also referred to as Spy-Bi-Wire (SBW)] is
discussed.

  • gatesphere, GeekDoc, Troll_Dragon and 2 others like this

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#3 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 09 March 2011 - 05:31 PM

So, now you got a job doing hardware design and you want to use the MSP430 in your design.

But you've discovered that your boss has insisted on using this "wicked cool awesome" and ancient 5V sensor because they have a bazillion in stock.

"What's the problem with that?" you ask.

The problem is this: the MSP430 is a 3.6V device and it doesn't have 5V tolerant I/O's. This means that you'll probably hurt the part if you put 5V into an input. Go ahead and google it. You'll find our very own OCY schooling someone on this topic back in 2008. I'll let you find the article. OCY is shy. And he's probably gonna rip me open for giving away his secret identity. ;)

So, what's the answer? SLAA148 is the answer.

It will take you through the various input and output scenarios that you may face trying to interface to higher voltage systems - not just 5V.

Using this information, you should be able to measure the status of a 12V power supply with the A/D inputs or figure out how to drive a 12V relay.

Have a read. It's useful info.
  • gatesphere, jsolarski, fj604 and 6 others like this

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#4 ender

ender

    Noob Class

  • Members
  • 8 posts

Posted 22 March 2011 - 09:27 PM

To me ..

These two have provided the best information so far:

1. http://mspsci.blogsp... ... arted.html
2. http://glitovsky.com/blog/?p=85
  • bluehash, gatesphere, jbremnant and 6 others like this

#5 bluehash

bluehash

    Site Admin

  • Administrators
  • 5,318 posts

Posted 23 March 2011 - 01:14 AM

Good find on the glitovsky link.

Stellarisiti - Join the new Tiva-C/Stellaris ARM Forums discussing Tiva-C(Stellaris) Microcontrollers.

C2kCentral - C2000 News, Projects and Forums
43oh - MSP430 Discussion, News, Projects and Hacks
MachineGrid - Robots, Hacks and Technology!


#6 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 14 May 2011 - 05:49 AM

This is a follow up to the 5Volt tolerant I/O posting above.

I decided that I should put up a picture of a sample circuit that I've used to do 5V tolerant I/O.

The resistive divider on the left will scale down the 5V to a range tolerable by the MSP430.

The NPN transistor will do the same in the output direction. You could drive anything with the NPN - not just a relay.

This should make things clearer.

Attached Files


  • GeekDoc and Robby like this

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#7 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 16 May 2011 - 05:24 AM

Note: This is a follow up on the JTAG posting above.

This is very valuable information that you should remember.

The MSP-FET430UIF is TI's programming tool. It is able to program an MSP430 using either JTAG or Spy-Bi-Wire. I recommend that you get one if you don't already.

The MSP430 Hardware Tools - User's Guide is its user manual. You want this document because it will aid you in your circuit design choices.

Pay special attention to pages 25 and 26. These circuit diagrams will show you the difference between JTAG and Spy-Bi-Wire circuits.

When you design your product for your customer, you should refer to this User Manual so that you select the correct circuit and components. Then you will be able to mass manufacture your devices with confidence knowing that you will be able to program them.

Also, one more note. The LaunchPad can be used as a programmer for your devices. But, you should take note of which device will be supplying power. Will it be the LaunchPad or the Target Device? Please don't say both. You will light something on fire if you do. Most likely the Target MSP430 will suffer from the excessive amount of heat you generate in it. Learn from my personal experience!
  • bluehash likes this

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#8 n1ksn

n1ksn

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 08 September 2011 - 03:33 PM

Zeke, a great set of posts! I started primarily with Davies' book. As you stated, this is a good source for information on the clock system and, I would add, the MSP430 peripherals. I've downloaded the tutorials and look forward to reading them.

I just finished crawling though Tom Baugh's "MSP430 State Machine Programming." I worked through the exercises using an Olimex H2274 header board holding an MSP430F2274 on a breadboard combined with a few parts and a couple of SMT to DIP adapter boards with an RS232 interface chip and a DAC. I used a Launchpad as a Spy-Bi-Wire programmer. A picture of the setup is in the Programmers and Debuggers forum under "Launchpad as external programmer."

This book is an interesting introduction to designing software based on state machine models without using an RTOS or a task scheduler of any sort. Lots of functionality can be had in 4K of flash. The book covers both bit-banged and peripheral-based UARTs, fancy button debouncing with stuck button detection, reading and writing flash from within a program, and so on. Definately a step or two beyond the examples in Davies. There is also early on an extensive discussion of machine instruction cycle times and addressing modes.

I learned a lot from this book. Its strength is that Baugh shows how to incorporate lots of functionality with an event-driven approach with very low power draw (LMP3) in the idle state. So many resources contain toy programs to illustrate a point or two, while this one shows goes much further into software design using its chosen approach.

There are a couple of downsides to this book. First, the reader is assumed to have a decent knowledge of C. Function pointers and structures abound. I played some catch-up here, but was glad to see these used as it increased my C abilities. Next, it is unlikely that a reader will absorb all the ins and outs on state machine programming in a first reading, even after working all the examples. You will need to try programming some of your own projects to "get it." You are exposed to many concepts like callbacks, event sinks, and so on that take time and experience to fully understand. The book would benefit from even more diagrams than it already has in this regard.

The book has convinced me that the event-driven state machine approach is a good one, and I'm buying a book UML statecharts that takes this approach, but in a more formal way.

Again, Zeke, many thanks for these posts.

Andy
  • zeke likes this

#9 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 08 September 2011 - 04:26 PM

You are so right about Tom Baugh's MSP430 State Machine Programming. I bought it at the same time as Davies' book.

I used the state machine approach to design and to code on a recent contract. The beauty is that I could complete a paper code design and know at once that it would work. After fixing two cut and paste errors, I had my code running bug free immediately.

So, I'm a big fan of state machine style programming. I even started a thread on how to design a state machine over here. I haven't finished it just yet due to work commitments but I'll get to it eventually.
  • n1ksn and vicvelcro like this

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#10 n1ksn

n1ksn

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 09 September 2011 - 01:46 AM

Hi Zeke. Thanks for your comments on Baugh's book. I went over to your state machine thread and found it interesting, although I was disappointed to see no responses to it. At the risk of going off-topic, I did have a question on it. I assume that you will be in LPM3 while waiting for a timer ISR to signal a tick?

I think you have inspired me to try a 10 minute countdown timer using the state machine approach. Such a timer (which is used in my ham radio shack to remind me to ID every ten minutes as per FCC regulations) was my very first microcontroller project, using a 14-pin PIC. However, that project used a seven segment display (one digit) to count down the minutes and I want to find a one or two digit display that is very low power to keep things in the spirit of the MSP430, but doesn't need an LCD controller module in the MSP430. Or maybe I can use a yellow warning LED with a low duty cycle blink for the last minute, and then the time-out red LED comes on, ....

As usual, I blather on. Again thanks for this thread and I hope you find the time to complete your state machine post.

Cheers,
Andy

#11 zeke

zeke

    Level 4

  • Members
  • 1,265 posts
  • LocationCalgary, Canada

Posted 09 September 2011 - 07:14 AM

I assume that you will be in LPM3 while waiting for a timer ISR to signal a tick?


Yup. That's the plan. We can talk more in that thread if you'd like.

Again thanks for this thread and I hope you find the time to complete your state machine post.


Just need to find some time and inspiration.

Thanks for the kind words.

"Life is 10% of what happens to me and 90% of how I react to it" - Charles R. Swindoll

 

"The power is in the hand of the maker (not the critic)." - Sean McCabe

 

Electrons   -> randomelectrons.com

Photons     -> ninemicron.ca


#12 jazz

jazz

    Level 2

  • Members
  • 283 posts
  • LocationCroatia


Posted 13 September 2012 - 05:47 AM

If you are new to MSP430, best/simplest/cheapest way to start is with new MSP430f55x series. There is no need for flashing tool, because uC have USB and can be flashed by TI USB BSL tool, without any glue logic. There is no need for development board, because you can build it by yourself (less than 20 parts in total).

And why not to start with older series? Check for example MSP430F2232 / MSP430FF5510 from TI slab034 document. For the same price new series give much more. Development board for older series you can build by yourself too (very simple, 5 parts in total), but you also need to buy/build some flashing tool (BSL/JTAG/SBW).

#13 Nytblade

Nytblade

    Level 1

  • Members
  • 73 posts
  • LocationChicago

Posted 13 September 2012 - 02:59 PM

If you are new to MSP430, best/simplest/cheapest way to start is with new MSP430f55x series. There is no need for flashing tool, because uC have USB and can be flashed by TI USB BSL tool, without any glue logic. There is no need for development board, because you can build it by yourself (less than 20 parts in total).

And why not to start with older series? Check for example MSP430F2232 / MSP430FF5510 from TI slab034 document. For the same price new series give much more. Development board for older series you can build by yourself too (very simple, 5 parts in total), but you also need to buy/build some flashing tool (BSL/JTAG/SBW).


I have started using the F5438 experimenter board and it is great! Plenty of RAM and a massive amount of Flash. It would be nice if TI could make a new official (inexpensive) MSP430 launchpad with the F5438A.

The only problem I had is that the code between the Value Line and 5-series is not really compatible... interrupts have a different syntax and all the peripheral registers names have changed. Also I would prefer a DIP chip, which isn't available for these.

#14 artifus

artifus

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts
  • Locationuk

Posted 20 September 2012 - 05:07 PM

hello fellow noobs. if your eyes are bleeding from reading but your brain is still hungry for more and you have an hour or so to kill i recently found this short series of brief youtube tutorials very easy to watch and quite helpful in getting my head around a few c programming basics, which has been useful when studying code examples.

http://www.youtube.c...61C018D7DC1F431
  • bluehash, GeekDoc, oPossum and 1 other like this
ohm's where the art is

#15 jazz

jazz

    Level 2

  • Members
  • 283 posts
  • LocationCroatia


Posted 28 September 2012 - 08:27 PM

For entering in USB BSL programming mode, there is no need to disconnect/connect USB cable from/to PC with BSL button pressed every time. USB cable can stay connected, and another entry to USB BSL mode can be done using RESET button. Just press BSL and RESET button together, first release RESET button, and after (1 second is enough) release BSL button.

#16 jazz

jazz

    Level 2

  • Members
  • 283 posts
  • LocationCroatia


Posted 01 October 2012 - 08:42 PM

If you have board based on MSP430F5508, but can't download (even) blink led example firmware using TI USB BSL flasher, don't worry. With your board everything is OK. Everything is OK with flasher, too.

Posted Image

TI prepared examples for MSP430F5529, and because of this none of them will work with MSP430F5508 (blink LED example will work with MSP40F5510). If you have XTAL2 with different frequency than one on TI MSP430F5529 evaluation board, USB (CDC/HID) examples will not work with your MSP430F5529, too.

So, for the first test just select your firmware (prepared for uC used by you) in TI txt format and flash it. :thumbup:
  • RobG likes this

#17 RobG

RobG

    Level 5

  • Members
  • 2,757 posts
  • LocationCary, NC, US


Posted 01 October 2012 - 10:05 PM

And here's the information on how to configure your CCS/IAR to create txt file.
BTW, if your project has spaces in its name, you will have to add .txt extension ("My F5510 Project" will produce "My" file in the Debug folder.)

#18 sirri

sirri

    Level 2

  • Members
  • 163 posts
  • Locationturkey

Posted 04 December 2012 - 07:48 AM

For Energia compiler users, this link is very important, key to most features:  https://github.com/e...a/wiki/Hardware


  • vicvelcro likes this

#19 yyrkoon

yyrkoon

    Level 3

  • Members
  • 476 posts
  • LocationArizona

Posted 07 January 2013 - 07:31 AM

While not specific to the MSP430 processors . . .

 

I found http://www.amazon.co...e/dp/1449302149 a very good read so far. 

 

Also http://kjarvel.wordp...-pointers-in-c/ is a decent intro into table driven state machines, using function pointers. Do keep in mind that the code as presented is close to functional, but will not compile without some minor additions, or adjustments. See if you can spot the omissions :smile:

 

The author of the arduino PID library I believe wrote a decent article on beginner to commercial grade PID controllers. http://brettbeaurega...d-introduction/

 

Also google + general C programming keyword works great for things I am either rusty on, or haven't quite grasped yet. My personal preference is to stick with posts mostly from stackoverflow.com( there are even some MSP430 specific questions / answers here ). Although stuff from The Code project can be very good too.

 

Again, the book, and the links are not MSP430 specific, but are a few sources of information I found useful while trying to wrap my brain around different programming concepts. 

 

Unfortunately for me, I have not found most of the MSP430 related subject matter very useful. So far the users guide for the device im using, and the data sheet while extremely terse have helped me the most. Not to mention this forum, and the fact that the friend I am workign in colaboration with is an excellent electronics engineer ( me being the code monkey .  .) Do realize that most of my programming experience over the last 15 or so years has been OOP in nature, and anything outside of that realm in style makes my head hurt, and eyes bleed. So when I say somethign did not work for me, does not mean it couldnt work for someone else. with that in mind . . .The MSP430 basics book was good up to a point. But being a code snob ( sorry I can not help it ) I find the authors coding style atrocious, and hard to read through because of my own coding style preferences. Coupled with dated material, and code examples written for a different MSP430 than what I am learning on / developing for. I just moved on to different material.

 

EDIT:

 

One thing that *can* be very useful for MSP430 specific subject matter is using google + <keyword> + PDF. There are all kinds of whitepapers, written by various people, and institutions that can be very helpful for topic specific information. As an example just searching for "MSP430 and SPI external memory" I eventually ran into a very interesting white paper written by a college professor from some college ( which I can not remember the name of offhand ). Anyways, perhaps obvious to some, but maybe not to others . . .


I'm an eye-for-an-eye, tooth-for-a-tooth kind of guy.  -  So you support a system that would leave everyone blind and toothless. -  Not everyone. Just the bad guys.

Youtube channel  Blog


#20 RichardVowles

RichardVowles

    Level 1

  • Members
  • 78 posts

Posted 07 January 2013 - 10:07 AM

Has anyone read the Synthesis Lectures on the msp430? Amazon has them only in print form but the publishers have them in pdf. http://www.amazon.co...3/ref=pd_cp_b_2




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users