What do we need to get started?


Hello and welcome! In my previous post Basics of Microcontrollers, we came across some of the elementary concepts and how a microcontroller based development process goes. In this post, we will see what are the things you need to get started with a MCU.

All the things you need can be categorized into two:

  • Hardware
  • Software

Selecting Hardware

To get started, we must have something upon which we can work, in other words, hardware. We will be requiring the following hardware for our purpose:

  • PC / Mac (preferably PC)
  • In-System Programmer (ISP)
  • Target Board (MCU Development Board)
  • Lastly, a MCU! ;)

PC / Mac

We need a PC / Mac as we will be writing, editing, compiling and debugging the code here! The PC requirements are not too much. Any decent PC / laptop will do.

MCU Development Board Example

MCU Development Board Example

Target Board (MCU Development Board)

A MCU cannot function on its own. It’s not like you go to the market, buy a MCU and it starts working! You need a PCB along with an appropriate circuit to make it work. There will be slot where the MCU will fit in. It also has slots for other accessory drivers, ICs, pins’ outlet of GPIO pins, etc. These PCBs are called Target Boards (or MCU Development Boards). Don’t worry too much about it, there are many readymade boards available. But don’t go and buy any random board. You need to consider the type of ISP and MCU (discussed next) and then choose one according to your requirement and budget.

Here, I am providing few links from where you can get a MCU development board:

In-System Programmer (ISP)

You have your PC at one end (with your hex file ready to be transferred to the MCU) and you have your MCU Development Board at another end. How will you transfer the hex file? For this we need another hardware called the In-System Programmer (ISP). This device programs the MCU by burning the hex file into the flash memory of the MCU. ISP is of three types:

  • Parallel Programmer- Here, data is transferred through the parallel port (printer port) of the PC. Technically, the parallel port is called DB25 port. A DB25 connector is shown below.

    DB25 Parallel Port

    DB25 Parallel Port

  • Serial Programmer- Here, data is transferred through the serial port of the PC. Technically, the serial port is called DB9 port. A DB9 connector is shown below.

    DB9 Serial Port

    DB9 Serial Port

  • USB Programmer- Here, data is transferred through the USB 2.0 port of the PC. A USB connector is shown below.

    USB Port

    USB Port

In some MCU Development boards, there is an inbuilt ISP. In this case, you won’t need any extra hardware for that. You can also get ISP from the links mentioned in the previous topic.

Microcontroller

What to choose?

What to choose?

Selecting a MCU to work upon may be the biggest hurdle that you might face while getting started. There are more than 150 IC manufacturers which manufacture MCUs, and each one of them have more than 100 different models in their account. So, which one to choose?

On the basis of popularity, there are three series of MCUs. They are 8051 (by Intel), PIC (by Microchip) and AVR (by Atmel). 8051 is the oldest of the three, and hence quite popular, but lacks several new features and registers. And AVR is the newest of the three with the most recent architecture.

The following factors may help you choose the MCU you want to work upon.

  • Cost – A cheap MCU is always preferred. PIC microcontrollers are comparatively cheaper than AVR microcontrollers.
  • Speed – Speed of execution also matters. Typically, an AVR is much faster than a PIC, about 3-4 times faster!
  • Ease of use – AVR is much more user friendly and easier to use than PIC.
  • RISC / CISC – There are two different categories of architecture. Let’s talk in layman’s terms. In Reduced Intruction Chip Set (RISC) architecture, less amount of instructions will result in more output, whereas in Complex Instruction Chip Set (CISC) architecture, more amount of instructions will result in less output. In other words, to do a particular job, RISC requires lesser number of instructions than CISC. AVR, PIC, etc are based on RISC architecture whereas Intel 8051, Motorola 68000, etc are based on CISC architecture.
  • Free ‘C’ Compiler – The best part of an AVR is that the C compiler is available for free, and that too by Atmel! Many other manufacturers do not provide with a compliler or a proprietary premium software, which we need to buy.
  • Durability – Practically, it has been found that a PIC MCU is more durable than AVR MCU.

So, choose any MCU you want. I work with AVR and MSP430 (by Texas Instruments) microcontrollers, whereas you may prefer something else. It all depends upon your choice. But still, most of the posts in this blog will be covered using AVR ATMEGA32 (datasheet) MCU. However, they can easily be transformed for any AVR device.

Some of the popular AVR MCUs are:

  • ATTiny 85/2313
  • ATMega 8/16/32/168

P.S. For your information, MSP430 is a Mixed Signal Processing MCU by Texas Instruments. It is famous for low cost and low power applications. MSP430 series consume the lowest power of all the MCUs!

Selecting Software

AVR Studio 4 Logo

AVR Studio 4 Logo

  • Talking about AVR MCUs, any platform (Windows/Linux/Mac) will do. There are different compilers available for different OS.
  • Next, choose the language in which you want to program your MCU. C is preferred over BASIC as it is more organized and gives you the power to do substantially more! Apart from this, C is a language which (ideally speaking) every engineer knows! And its ubiquitous. However, you can also use BASIC, I won’t force you to use C :P .
  • Next, choose a compiler. For BASIC programmers, the best compiler is BASCOM. For C programmers, best compiler is AVR Studio. CodeVisionAVR is another popular software, but it’s not free.
  • And at last, you need a programmer software. Well, to speak of it, most of the compilers (including AVR Studio, CodeVisionAVR and BASCOM) have an inbuilt programmer. But I prefer to use a separate one
    BASCOM AVR Logo

    BASCOM AVR Logo

    for greater flexibility. Some popular programmers are PonyProg (serial), avrdude and FreeISP (GUI for avrdude).

So with this, you are ready to work with a microcontroller. Since I use AVR, my upcoming posts will be related to AVR and its programming. For those who use other MCUs, I am sorry that I won’t be of much help, but still I will help you get the solution to your problem (as the basic concept is the same, irrespective of the MCU used).

Thank you for reading this post. I’ll be awaiting your comments!

About these ads

28 responses to “What do we need to get started?

  1. Pingback: AVR Basics « maxEmbedded·

  2. Hi mayank,
    You are doing a great work…!

    I have a doubt.
    For MSP430 also there are too many MCU available. so how can i decide which one should i use? can you give some ways to filter different types of MSP430?

    Thank you Very much.

    • Hello Student

      If you want to start off with MSP430, try the TI Launchpad for $4.30!. Apart from that, if you could tell me your requirements, I could shortlist a few for you. Do you want to use it for your personal purpose, or any mini-projects, or any design contests, etc etc.

  3. Hey man great posts,
    Im gonna be making an ATmega 16 based project (mobile controlled land robot).I wanted to know:
    1. Specific MCU that i need to buy to program my microcontroller.
    2. what is the ISP (make, brand ,model ,etc…)(usb based [any other will do too]cos i will be using my laptop).
    3. how to go about programming it .(i have downloaded atmel studio 6 and the other tools and .exe files that were required for the programming of the IC.

    Pls drop me an Email dude thanks a lot. ;)

    • Hi Siddhant,
      Here are your answers:
      1. You need to buy an ISP to program your ATmega16.
      2. ISP can be of various types, most commonly used ones are AVRISP, USBasp, USBtinyISP. USBasp is the cheapest, but is comparatively slower and doesn’t support in-system debugging. You can buy them from extremeElectronics store for Rs.350/-
      3. Just keep on reading my blog!

    • Hi Amruth,
      Arduino is a kind of AVR Development Board with an on board bootloader. But the main reason why people go for Arduino is its programming environment. You program the Arduino board with an Arduino software! In Arduino, you basically perform “top-level” programming, whereas in other microcontrollers, you perform “bottom-level” programming. The creators of Arduino have written several libraries for you, which are based upon Processing (Processing is yet another software). While programming Arduino, you are least bothered with the internal hardware and registers of the microcontroller. All you do is call the functions written in the libraries (which are already provided) and bingo! But in case of other microcontrollers, you need to know about its hardware and registers to program it, whether using C or Assembly. The advantage of not using Arduino is that you can switch between microcontrollers (like AVR, PIC, MSP, etc) very quickly and hassle free. You can use Arduino if you want to prototype your project very fast, and are not much concerned about the programming part.

      Well, the AVR board that you wish to buy doesn’t come with the microcontroller and the programmer. There is an option to choose between Atmega16 and 32. But apart from that, you also need a programmer. You can get it from the same site. Make sure you also get a pair of FRC cable and USB cable with the programmer. That should do.

    • Hi Tushar,
      LabVIEW is a software by National Instruments, which is used for test, measurement and automation of systems. Literally speaking, you can automate any damn thing using that. Its a very wonderful software. The best part is that, we program it graphically by placing blocks and connecting them together. If you have used MATLAB before, I would suggest that it is a replacement for that, and a pretty good one too!

  4. Dear Mayank
    It’s very basic guide line and hard to find without help of friend ( who passed the way of mcu)
    Thanks

  5. Mayank……u r fantastic…….Iam a beginner………I could understand very easily…but….don know how to start….please help me out. …:(

    • Hi Aditya

      Thanks for your comments.. ;-).If you have never worked on a microcontroller, I would suggest you to please get one soon
      specifically AVR Atmega 8 or 16 from http://www.extremeelectronics.co.in. After getting one, start following the post listed here.
      And if you find any difficulty, post it, we will help you out.

    • Hi Altairpearl,
      Yes, you can call AVR a kind-of mixed processor because of its ADC. Usually mixed signal processors do other analog operations as well like modulation, demodulation, DAC, error detection and control, etc. and are used for various other applications such as in radio of your cellphone, embedded systems, etc. Since AVR has inbuilt ADC, you can call it as a mixed signal processor as well.

We'd love to hear from you!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s