In lesson 2 I forgot to mention one final step — creating a snapshot. At the end of every lesson, I suggest you create a snapshot of your virtual machine so that in case anything goes wrong, you can restore it. The reason I bring this up is because it happened to me while I was writing the last lesson. After I compiled gcc, my virtual machine died. It would boot and then black screen on me, so instead of fighting trying to fix it, I just restored my snapshot.
Subscribe to RSS
I had to recompile the toolchain, but it was less time wasted than recreating the whole virtual machine had I not created that snapshot. In the last lesson we went through the motions of compiling and installing the GNU toolchain. Now we will take a quick look at what is in there. These are the binaries provided by the installation.
In this lesson we will only be using gcc. When called on its own with default arguments, gcc actually invokes the C preprocessor, assembler and linker all in one. The output is an executable. By using additional flags, the compiler can be instructed to stop at any one of these steps.
Before we jump into the code, we should spend a bit of time talking about editors. If you already have a preferred editor, you can probably skip to the next step. There are many options for editing code and I will point out a few of the most popular ones.
Blinking the LED with MSP430
I personally use vim — which is a command line based editor. I like it because it is fast and has all the features I need. I have customized my installed with additional programs, plugins and hot-keys so I can quickly navigate code. I will tell you now, vim is not for everyone. It takes some time to learn.
If you are interested in using vim, I can provide you with my setup and configuration. GUI front-ends exist for both vim and emacs.
For simple text editors, gedit is quite popular and is the default text editor on some Ubuntu distros. It has an easy to use tabbed interface and it is lightweight.
There are also plugins available which can add most IDE functionality. In the full-blown IDE category, the most popular is Eclipse.After doing this, you will get a window mentioned below.
Enter your project name, select family as MSPand now variant is mspg Remember, this is a critical step. To check your option, refer your chip on the Launchpad. It has a mentioned of the variant.
For all the tutorial, I will be using mspg as the chip, so kindly change accordingly. In the bottom box, select Empty project with main. Have a look at the basic structure of the code already written. The first line is your header file that depends upon the variant; you choose while creating your project. Next step is the main function.
Inside the main function you can see, initialization of watchdog timer. The MSP and many of the new generation microcontroller includes a special timer called the Watchdog Timer.
However, many developers used this timer in a scenario when they want to reset the controller when certain conditions are met. For now remember to turn off the watchdog timer, as we will discuss it when we talk about timers in the tutorial. Now, here comes the task we want to do i. Since the leds are on port1 and on pin 0 and 6 respectively, we will first have to make this pin or declare these two pins as whether they are acting as output or input.
Here comes the use of P1DIR register. P1DIR register is responsible for making your pins as output or input. Since we want to configure pin 6 and pin 0, we assign P1DIR as. Next is to specify the particular pin of the particular port as high or low. For that, you can use P1OUT as the register. Since we are initializing things, I set the led on P1.
Next is the infinite while loop, in it there are two steps. First is toggling and other is providing a delay after each toggle to see the toggling effect successfully.
This will reverse the state of pin6 and pin0. So initially pin6 was low it will become high, and pin0 will become low. This process would go on continuously. The important point is there is no inbuilt delay function is MSP, so you have to use for a loop to provide the delay.
The next is step is nothing. CCS has automatically closed the while loop, and hence we have to burn the program obviously after building it. Before burning you can cross-check the code once again from below. After clicking on debugging, you will get a popup related to power saving, simply click proceed. The moment you debugged the code, your program got burnt in the controller.TI LaunchPad MSP430 blinking LED Project Microcontroller MSP430G2553
Clicking on a resume starts the program. The debug screen will look like the one, as given below. Notice, it also has the function of breakpoints, and single-step or continuous run while are essential while debugging and YES, on the Launchpad you would be able to see the Red and Green Led toggling.
After doing this, you will get a window mentioned below Enter your project name, select family as MSPand now variant is mspg After clicking Finish, you will get this screen. The number will determine your toggling time. So choose it carefully.I started using launchpad as a part of my MSc.
This blog covers all the basics required to get started with the development process. I have used MSPG microcontroller on a launchpad board for this project. Hardware: Although, there is an on-board LED, I have used an external one and have connected everything on a breadboard. Picture will be added soon. Code: There is a default project called Blink.
There are various ways in which you can control the delay use timer for precise delay. You are commenting using your WordPress. You are commenting using your Google account. You are commenting using your Twitter account. You are commenting using your Facebook account.
Notify me of new comments via email.
Notify me of new posts via email. Share this: Twitter Facebook. Like this: Like Loading Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:.
The main purpose of this board it to upload code from the computer to the MCU and read serial data from the MCU for debugging purpose. Hence in this series of tutorials, we will be using the MSPG to explore all the functionalities of this Development kit. You can power board through the mini USB jack and once you do it, you should notice the LEDs red and green at the bottom left corner of your board glowing alternatively.
You can then press the push button connected to P1. Okay now, let us move on to the Software Environment. Texas Instruments allows us to program their Microcontrollers through a variety of Environments. This software is available free of cost. Also, it requires some minimal level of experience with Microcontrollers. There is one more IDE available to write our program i. Energia IDE. Energia is an Open source and free Environment that enables us to program the TI Microcontrollers easily.
Code Composer Studio CCS is a more versatile professional IDE which has more functionalities and capabilities in terms of accessing the inside architecture of microcontroller. It has inbuilt debugging function which can check errors in your code and you can run your code line by line that helps in finding error without any headache.
It will take sometime to get comfortable with CCS. Once you set with this awesome software, trust me you will get to know anything about a particular microcontroller. You have to take help of Datasheet of the microcontroller to write your program.
So, you can download it from the given link Download link. We will use Code Composer Studio V7 but you can download latest version also, procedure remains same. This software is quite heavy around 1GB so, you need to wait until it finished downloading. When you click on setup, just like any other software you will be asked to agree terms and conditions and to select the installation folder.
After that you have to choose boards for which you want to download files. You can download more than one board files. Next window is to select debug probe. By default one option is available so, click on it and finish.
Now, your installation will start so just wait until it finished. After installation, it asks about workspace folder so choose the folder where you want to save your files and click Ok.
This is a simple interface where you can see Getting started menu in which you can start to make your project ,next to getting started there is a Resource Explorer. This is a awesome feature of this software in which you can find every detail of a TI product like datasheets, documentations, etc. There is no need to find datasheets on internet, just click on resource explorer and click on the device which you want to explore after that you can see every detail about the product.I didn't see any evidence that shows bit 0 of P1 is chosen If I choose bit 2 or 3?
What's the code look like? This sets the P 1. If you said something like 2 or 3 the code wouldn't run because you are trying to output on P 1. We use optional third-party analytics cookies to understand how you use GitHub.
Learn more. You can always update your selection by clicking Cookie Preferences at the bottom of the page. For more information, see our Privacy Statement. We use essential cookies to perform essential website functions, e. We use analytics cookies to understand how you use our websites so we can make them better, e.
Skip to content. Instantly share code, notes, and snippets. Code Revisions 4 Stars 5 Forks 1. Embed What would you like to do? Embed Embed this gist in your website. Share Copy sharable link for this gist. Learn more about clone URLs. Download ZIP. This comment has been minimized. Sign in to view. Copy link Quote reply.
Can you pls give an idea regarding interfacing Bluetooth with msp Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment. You signed in with another tab or window.
I searched a lot and everywhere is says that the specific register is just to set the direction. So then I deleted a part of the code and the remaining was this one:. Here is the odd part. The led is on! Shouldn't be off? With only P1DIR nothing should happening. What am I doing wrong? It covers everything from just turning an LED on, to causing it to evenly to the eye diminish and increase in intensity which requires a geometric progression to achieve.
In the meantime, what you didn't realize is the power-on value for P1OUT. And apply one or the other of the above with your latter code example the one with the deleted code. You will see two different behaviors. Regardless, it matters and you need to make sure that P1OUT values are "known" before starting your code. In the case of your first code example that blinks the LED, the initial value didn't matter since the loop XORs the value over and over. Sign up to join this community.
The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. MSP blinking led Ask Question. Asked 6 years, 6 months ago. Active 5 years, 1 month ago. Viewed 6k times. Adam Adam 1 1 gold badge 8 8 silver badges 23 23 bronze badges. Active Oldest Votes. JYelton Now i understood how to use time to reach our goalsI am an angry middle age man who is in turmoil mentally at the moment. Everything is bad, I am reacting to everything.
It's not about me. Your stories and your wisdom are just as meaningful as mine. Click here to read more. There are no reminders to be mindful unless we create them. Here are a few down-to-earth tips on how to become more mindful: 1. What are your tendencies. What kind of thoughts tend to rob you of the now. A few examples of tendencies that are very common are: anxiety worry regret guilt fear pleasure seeking A great tip is to write down your tendencies and how they tease you out of the now.
MSP430G2553 – LED/Blinky
Focus on your breath. Whenever a negative thought arises, take a step back, and look at if the thought is true. They are nothing but teachers on your path.
When you make becoming more mindful one of your main goals, you simply cannot fail. About Henri JunttilaHenri writes at Wake Up Cloud, where you can get his free course: 7 Steps to Building a Lifestyle Business Around Your Passion. Please contact us so we can fix it. Did you enjoy this post. Please share the wisdom :) googletag. Nhmutawa Thank you, very helpful points to stay present srinivasan sankar Beautiful post.
Srini Anonymous Fantastic article, Henri. Vicky Khan Nice helping tips define to get a relax life. Stress Relief mark steers Thank you for the great set of tips for increasing mindfulness.
Lv2terp This is a wonderful article, thank you!!!.
Richieliberties glad to have read this,very helpful,and so simple,clever, eckhart tolle would be pleased,well done. Siena Thank you for the article. Chantaedennis I really like this. I need to talk to someone to help with this problem Jwolf Wonderful and helpful article.
Thank you Vanessa I feel relieved when I read this. Let me commence practicing them. Wahi Fatima Henry, I enjoyed your article and this is really helpful.