Friday, 7 December 2012

Project IP - MSP430 Powered Remote Controlled Car!

Hey All,

I know I haven't been around for a very long time. School did its best to keep me busy and away from the microcontroller world this semester. However, the semester is almost over and I have already started thinking about what kind of projects I will want to work on over the break and presumably next semester before classes start getting difficult again.

Also, I have added a new project on the blog. Well, I say new, but it is actually something I did all the way back in April 2012. I just had a chance to share it. It is called the Multifunctional Bluetooth Temperature Probe. Yeah, yeah, I know it has a cheesy name, but that was the best I could come up with. Still though, you should check it out! You should also watch the video of me explaining how the system works. That is also pretty cheesy, so you might get a laugh or two out of it. Don't blame me, I am not good in front of the camera, I get excited.

Now to the topic, NEW PROJECTS! I have two projects that have been keeping my brain busy past few days!


  • MSP430 Powered Remote Controlled Car!
I have already started gathering the parts I will need for this project! First of all, I need an RC car. You might ask, why are you buying an RC car to build an RC car? Well, the answer is my brains only works for electrical stuff, not much for mechanical. An RC car has all the gears and other small parts needed to turn and spin the wheels. That is the kind of stuff I wouldn't be able to take care of on my own. The reason why I want to this project is that I have never worked on a "robotics" project before. And this project involves a sort of motor controlling application, so I figured I would challenge myself!

Better yet, I might even upgrade the motor that will come with the RC car. I had one big criteria for the RC car when I was online looking for it, I wanted the biggest RC car that I could find (and I could afford). I figured it would be pointless to buy a fully functioning RC car and then "turning it into" another RC car. So I went on eBay and found this gem at this link. It is 1/10 Scale Ferrari Modena RC Car. Better yet, the mechanics are intact and it even comes with a battery!

Picture of the donor RC Car
Picture of the donor RC Car

In short, here is the plan with this project. Once I get all the parts I need, I will take all of the electronics out of the Ferrari and replace them with my own. The brain will be an MSP430G2553 (most likely) and it will control two motors. One is the main motor that drives the rear wheels, the other is a servo which will control the front wheels. I will also have to build a remote control for this guy, for which I will use an old X-Box controller. The driver will have full control over throttle and steering, which means that the speed of the car will be fully controllable (between 0%-100%). Same goes for steering, wheels will not only fully lock into one direction but will be able to turn to any degree in between (this is where the servo comes in). 

Before I end this post, I just want to say that I have many crazy ideas running through my head. I am thinking about making this system as complicated as possible. For example, I am thinking about adding an LCD screen to the controller which will show me the state of charge on the car, how much current the motors are pulling and how many volts the battery measures...

The Graphical LCD screen mentioned above.

One last note, which may come to you as a surprise, the wireless communication will be via Bluetooth. Yes I know you didn't expect me to choose Bluetooth, it is not like I ever prefer Bluetooth in my projects (sarcasm). But do visit the blog regularly, I am in the process of collecting the materials and once I have them all, I will build this!

Thanks guys,

-Anil


Update: I just won the auction on eBay for that Ferrari RC car!

Saturday, 22 September 2012

Programming the MSP430 using Assembly

Hey everyone,

From those of you who are in Prof. Khan's ECE2560 microcontroller's class, I have been getting a lot of questions on how to load the assembly project examples onto the MSP430 Launchpad. For this tutorial, I will use the Blinky.asm.

To start, go ahead and start up CCS v5. Do note that in order to be able to program the MSP430 Launchpad, you will need to be on the Free Code Size Limited license.

1) To create a new project, go to File>New>CCS Project. Make sure you choose CCS Project and not just Project!

2) Look at the screenshot below and make sure that you make the same selections. Make sure that you have MSP430 selected as your device, and MSP430G2553 as your variant. Also Choose Empty Assembly-only Project as a template. You can name your project as you wish, it does not have to be Blinking_LEDs.


3) I called my project Blinky. The next step is to create a source file into which your code will go. This file can have various formats, it can be a ".c" file, but we want a ".asm" file because we will be using not C, but assembly to program. To do this, find your project under the Project Explorer and make sure its title is in bold. Right click on its name and choose New>Source File. If you are lost, check out the screenshot below. When the New File window comes up, find a name for your source file and make sure to add .asm at the end of it. For example, I chose main.asm as my source file name.



4) Once the new source file is created, the new file will open up in the editor. But you will notice that it is not empty. It puts a couple of lines in the file which include the date and your name. You can see a picture of it below. Delete all of these lines because if you leave them there, your compiler will give you errors. This title would work fine if we were programming in C, but assembly compiler will not be happy.


5) Once you deleted the lines, go to this PDF file  here. You might notice that this is the PDF file on Prof. Khan's website which contains the example code. You will see that the code is copied directly from CCS into the PDF file. You will also see that line numbers are also present. What you can do at this point is copy all of the text and paste it into your new .asm source file on CCS. However, you are not quite done yet because you will need to reformat the whole code in order to be able to compile it. You will see that every line is messed up and the indentations are all wrong. You can try fixing it, but don;t even try because I am nice enough to provide you with this text file which includes the same code, in the correct format. I have done all of the manual labor for you. So all you have to do is open up the .txt file, copy the contents and paste it into your source file on CCS.

6) Once you have that done, all you have to do is debug your code and program your Launchpad. To do this, click on the button that has a bug on it and this button will build, compile and program your code. So it is a pretty useful button, isn't it? If you don't know which button I am talking about, check out the screenshot below.


7) Once CCS finishes programming your MSP430, you will have to command your MSP430 to execute your code in order to see your LEDs blink. To do this, click on the button that looks like a play button. To end your debug session and go back to editing your code, click on the stop button. Here is a screenshot that shows where these buttons are located on the CCS Debug window.



Common Problems
Some of you will inevitably run into problems during debugging. The most common problem will be that you have the wrong license on CCS so you will get a message saying that you cannot program MSP430s with your current license. To fix this, go to Help>Code Composer Studio Licensing Information. Then go to the Upgrade tab and choose Launch License Setup. Once the License Setup Wizard comes up, click on CODE SIZE LIMITED (MSP430) and then click on Finish. Now you should be able to debug your code.

Have questions? Comment below and ask them. I will get back to you.

-Anil

Monday, 10 September 2012

About Me

Hey everyone,

This is my very first post on this blog. I have been meaning to create this blog for a while now, and finally it is live. Before I start talking about the blog though, I would like to say a few words about myself. My name is Anil Ozyalcin, I am a third-year Electrical Engineering student at the Ohio State University. I moved to Columbus, Ohio in September 2010 for college. Before college, I lived with my parents in Ankara, Turkey which is where I am actually from. My dad, too, is an electrical engineer, so you could say that being an electrical engineer is a tradition for the Ozyalcin family.

My encounter of microcontrollers has been a strange one. In November 2011, I bought my first microcontroller not because it had awesome specs, but simply because it was dirt cheap. In fact, at the time I ordered my first microcontroller, I had no idea about what it even was or what it did. You might have guessed already, but the first microcontroller I bought was indeed the $4.30 Texas Instruments MSP430 Launchpad. I bought it because it was very cheap, and it looked awesome with its red circuit board and the "rocket logo." Its looks were more of a criterion to me than its technical specs.

Long story short, this blog is aimed to help newbies out there start building their very own microcontroller projects! I have been there, and I know that it can be intimidating playing with microcontrollers in the beginning. I hope to help you guys understand the basics of programming micrcocontrollers and how to use CCS (Code Composer Studio 5). I deal with the MSP430 Launchpad and the C2000 mainly. So I will have projects and tutorials regarding both in the near future! Stay tuned and comment so I know at least someone is reading this!

-Anil

My desk with my microcontrollers.