Jump to content

My Stupid Question Space

Recommended Posts

Since I am liable to have a lot of these, I figure it is best to just consolidate them all into one thread.

I think I am fairly competent in C++, for desktop, but am new to embedded. My electronic knowledge is very basic, at best. Most of my questions will most likely concern the architectural, or electronic, elements of the msp430g2553 in general, since that is what I am working with, although they could be more general, or involve code, as I learn more.

I am currently reading MSP430 Microcontroller Basics . If you are familiar with the book , you will know it involves a different chip and was probably written before the Launchpad came out(?). I am definitely not using the same board anyway. Instead of trying to use the on-board stuff, I am working with a breadboard, also. Everything else aside, this means that is not possible for me to just copy the code and see how it works. This brings me to stupid question #1.

The second program involved using a button to turn the LED on/off. I figured out how to enable the internal pull up/pull down resistor, but did not find anything about how to set it to one or the other. Since what I did worked, is it safe to assume that the chip is smart enough to figure out witch one you want? 

Link to post
Share on other sites

FWIW, I still find myself referring back to sections in MSP430 Microcontroller Basics.

One of the benefits I find working with the MSP430 line is the general code compatibility across many of the devices.  I also make extensive use of the code examples available in the MSP430Ware toolset. Often those examples provide a reasonable starting point when working with the different peripherals or devices.

One of the real benefits with the '430 line is power management. With that in mind, take a look at the code examples using the interrupt (ISR) models rather than polling. An example of such would be msp430g2xx3_P1_02.c Which would be useful for a pushbutton activated LED.  FWIW, you'll find good code analogs for the Davies book examples in the MSP430Ware peripheral examples.

Have fun,


Link to post
Share on other sites

May I recommend that you consider buying a cheap (sub $10), 8-bit, low speed (eg 24 MHz), logic analyser sooner than later ?

That, plus experience with the MSP430 'register page' of the CCS IDE 'Debugger' will be good friends to help you sort out the programming of MSP430 family peripherals.

Welcome to the forum!

Link to post
Share on other sites


I have not gotten to interrupts yet, just just the cheap and dirty way the book describes. I need to wrap my head around bitwise operations first. I also need to get used to CSS. I never looked at registers before, except for the little assembly programing I have done, so I did not think to do so originally. I did find them, and found out why I got lucky, all the pins were set at the start. That leads me to another question: is there a way to switch to binary from hex? It would save me having to look at a chart to see what actually changes.

veryalive, I have an analog scope, I think that would work as a limited logic analyzer? At this point I have only turned an LED on/off with a button, so there is not much to see with either one. :laugh:

Link to post
Share on other sites
1 hour ago, admirlk said:

That leads me to another question: is there a way to switch to binary from hex? It would save me having to look at a chart to see what actually changes.


I have at times used the calculator that comes with windows to do quick hex -> binary as well as binary -> hex.  From the view menu of the calculator, choose "Programmer".

Once you have moved past the blinking LED and dive further into the wonderful world of microcontrollers, you will appreciate having a logic analyzer with 8-16 channels.  They are worth their weight in gold when troubleshooting communication problems.


Link to post
Share on other sites

I was hoping there was a setting, or something, I did not find. If I remember right, it was easy to switch back and forth in VS.  I have a PDF that goes up to 0xff, on one page, so that is handier than using a calculator. I could probably whip up a converter to do the same easy enough also. I did that for converting to/from metric because I got tired of looking it up all the time.

I hope to get past the LEDs eventually, but there is a lot more for me to learn, and I cannot just breeze through it all, like with Arduino. And before someone says look into Energia, I am not looking for the easy way out. I am hoping to eventually find employment.

Link to post
Share on other sites

I was hoping there was a setting, or something, I did not find.

If you are referring to a setting in CCS then it can be done like this:

1) Select the register tab and then the register you are interested in while in debug mode

2) Right click on the number of interest int the value column and then number format

3) Select Binary

I agree with the others.  If you are serious, then get a logic analyzer even if it is a cheap 24 MHz one off of eBay.  Also, take advantage of the TI training videos, e.g. http://processors.wiki.ti.com/index.php/Getting_Started_with_the_MSP430_LaunchPad_Workshop?keyMatch=msp430 training&tisearch=Search-EN-Everything


http://processors.wiki.ti.com/index.php/Category:CCS_Training?keyMatch=code composer studio training&tisearch=Search-EN-Everything

Link to post
Share on other sites

That is exactly what I was looking for. Switching all at once would be better, but cannot have everything.

I started with the value line workshop, but did not care for all the C&P involved. The book seems to give better detail on why you are doing something, as you are doing it. Plus it allows me to work on a breadboard, and figure out how I need to write the code to make it work, as my first question shows. Unfortunately I have not had time to move onto the next step; adding a second LED and button.

I have taken a little time to look into logic analyzers, and found this one on ebay, that should work with sigrok. I assume that is what you all are referring to.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...