The Embedded System Tool Chain

Most of the projects listed in this website are based around a microcontroller. Once you design an embedded circuit around a microcontroller, you need to put in some intelligence by programming it and that’s when the term ‘Tool Chain’ kick in. So what exactly is a tool chain with respect to a microcontroller? The following picture should help….

In the block diagram above, excluding the circuit block, everything comes in the ‘Tool Chain’. Let’s keep it straight, to program a microcontroller you first need a place where you can write the code. That place is called an Integrated Development Environment or an IDE. Once you have written the code, you need something that converts its into machine language which the microcontroller understands. This is done by a Cross Compiler or (simply) a Compiler which compiles the code into a ‘Hex’ File. Now once you have the hex file ready, you need some device that can actually take this hex file and ‘dump’ or ‘burn’ it into the microcontroller. This is accomplished by a ‘Programmer’ or, in some cases, by a ‘Debugger’. The programming language in which the code is written for the microcontrollers is predominantly ‘C’ or ‘Embedded C’ as they call it.

When it comes to microcontrollers, there are thousands of options available. So how do you chose the one that fits your needs? Firstly, you look at your application and decide the kind processing power, memory, peripherals etc. you require. That’s the technical part. I have broadly discussed this issue in the report, ‘Microcontroller Analysis – Technical, Marketing and Application Perspective’. The non-technical part consists of calculating the total costs of the tool chain involved, the IDE, the Compiler, the Programmer/Debugger etc. come at a price and mind you, these things can get really costly with the total costs running in a few thousand dollars! Now you know that making a choice based only on the technical specs is not wise. On the contrary, usually its the cost of the tool chain that dominates the final decision, especially if you are a student or a hobbyist or a small start-up company running on a tight budget.

I was a big fan of the Atmel’s AVR series of 8-bit microcontrollers during my college days, I still am. I have designed hardware based around the ATMega16/32/128 controllers. It was the cost of the tool chain, which was virtually free of cost, that made me opt for the AVR and this is the controller that I would still recommend to any student/hobbyist who wants to jump in this field. Later, when I felt the need for more processing power, I directly jumped to the 32-bit microcontroller domain and opted for the Microchip’s PIC32 controllers simply because the overall cost of the tool chain was minimalistic.

Let’s talk about the AVR tool chain in detail and see what are the viable and cheap options we have,

a. The IDE

  1. The AVR Studio from Atmel – Free
  2. Programmer’s Notepad – Free (comes bundled with the WINAVR compiler)

b. The Compiler

  1. WINAVR – Open Source, Windows compatible and absolutely free.

c. The Programmer

Kindly understand that here, the term ‘Free’ implies that the schematics of the programmer and the software/firmware/drivers etc. are available as free downloads. Since the programmer is a ‘hardware’, you need to invest some amount of money into building it yourself. In that sense, none of the programmer’s are ‘Free’!

  1. PonyProg – The extremely simply DIY (and Free of course!) serial port programmer for the AVR microcontrollers. Only problem is that it doesn’t support the USB port or the USB to Serial Converters available and chances are that your PC/Laptop doesn’t have any serial port. Sad!
  2. USBASP – The hugely popular DIY USB AVR programmer. I use it and its free!
  3. Free USB Programmer Amadeus – Yet another killer USB programmer which happens to program both the Microchip’s PIC series (including the 16 and 32 bit processors) and the Atmel’s AVR series. The circuitry and software are pretty elaborate, kindly let me know if you have made one (and it worked!).
  4. AVRminiProg – Another USB hotshot for the AVRs!
  5. Robokits AVR USB Programmer – If time is not on your side and you think that making and testing the above DIY programmers is not your cup of tea, then go for this ready-made solution from Robokits India. Highly reliable, Windows 7 compatible and very easy to install and use. I have recommended this programmer to quite a few people for its high reliability and compatibility with the new Windows Operating System. At roughly $15, its damn cheap too!

Well, if you have followed till now then you have everything in the tool chain. Great. But wait, you don’t have any microcontroller based circuit to program yet! One way is that you do what I do, make a temporary customized circuit from scratch on the bread board or on a general purpose PCB. Test it and then design a PCB for the finalized circuit. This is fun and a great way to learn, but takes time and a bit of experience. If you are a complete newbie then this is not recommended, unless you are the adventurous cum persevering cum lots-of-time kind. Its better to get a quick kick start and buy some ready-made development boards already available on the internet. I am giving a list of some of them which are available in India and are from Indian companies. I have used all of them and each is equally good. You need to make an intelligent decision depending upon your application. Sometime later, I intend write an article dedicated to this, making a comparative study of all of these boards. But for now, here is the list :-

  1. AVR Development Board from Thinnkware
  2. AVR Rapid Robot Controller Board from Robokits
  3. AVR Rapid Robot Controller Board v2 from Robokits
  4. iBoard AVR from ThinkLABS @ IIT Bombay
  5. ProStik AVR from ThinkLABS @ IIT Bombay

There are many more available out there, but these are the ones I think that are really worth.

Before discussing about the Microchip’s PIC32 Tool Chain, a few points you must know. These guys are extremely student friendly. They give a flat 25% discount on ALL of their development tools if you register with them from your university/college email IDs. The Microchip’s Forums are the very best I have seen till date. There are many helpful people over there (including me!) who’ll try to help you solve your problems. Microchip’s Customer Support Service is world famous and there are a lot of open source examples, circuits, source code etc. available on the internet to help a newbie get started. Now, let’s take a quick look at the Microchip’s PIC32 Tool Chain,

a. The IDE

  1. The MPLAB IDE – One of the most sophisticated IDEs out there, Free.

b. The Compiler

  1. MPLAB C Compiler for PIC32 MCUs – Open Source with the Student Edition completely free with no restriction on the code size whatsoever.

c. The Programmer

People, nothing is free here!

  1. PICkit3 – Now this one is a real champ. In a really small form factor, this thing is a Universal Programmer for ALL of the Microchip’s microcontrollers, its a debugger, its a logic analyzer and a USB to USART serial converter tool all in one! Costs $33.71 after Microchip’s 25% University Discount.
  2. ICD3 – A superlative of the PICkit3 without the logic analyzer but with dedicated hardware debugging features. Costs $142.49 after Microchip’s 25% University Discount.
  3. MPLAB Real ICE – This is an In-Circuit Emulator guys, a much more sophisticated device. At $500 or $375 after the discount, this is definitely not for the students or hobbyists.
  4. Free USB Programmer Amadeus – The website says that it can program both the Microchip’s PIC series (including the 16 and 32 bit processors) and the Atmel’s AVR series. The circuitry and software are pretty elaborate, kindly let me know if you have made one (and it worked!).

That sums it all. I have never seen somebody build or use that Amadeus USB programmer. Try building one for yourself, you’ll save yourself quite a few bucks if it works. I would obviously recommend PICkit3 of the available four choices.

Regarding the hardware, I would suggest that you first go with the development boards and kits manufactured by Microchip and then, once you have gained some experience with the hardware and software, make you own custom design.

This is the list of development tools manufactured by Microchip for the PIC32.

I personally use the PIC32 USB Starter Kit II with the PIC32 I/O Expansion Board. I also have the older PIC32 Starter Kit, but that’s not recommended anymore. The USB Starter Kit II offers the best PIC32 microcontroller in the series and it also gives ready-made access to the microcontroller’s powerful USB capabilities. I prefer the PIC32 I/O expansion board over the Explorer 16 board because of the flexibility that the I/O expansion board offers. The Explorer 16 is like a ready-made thing to test the complete processor functionality, while the I/O expansion board can be used in a variety of applications because all of the processor pins are readily available for bread boarding. It should be noted that the Explorer 16 Board and the I/O Expansion Board, both are equally capable of supporting the Microchip’s PICtail daughter interface cards.

This brings us to an end of this article. If you are a newbie, I hope the above discussion helped a ton. If you are a seasoned embedded systems engineer just surfing around then I hope you’ll appreciate what I have said. This article also happens to be the first in many to come in the coming year (2011) which will collectively form an extensive tutorial on the AVR and PIC32 microcontrollers. This is what I have planned. I hope things go according to the plan. They usually don’t. 😛 😀

About Pranjal Chaubey

An engineer, who believes in 'Being Wise, b.i.t.Wise!™'
This entry was posted in AVR, PIC32, Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

3 Responses to The Embedded System Tool Chain

  1. onlymag4u says:

    dats really useful info u told… thanks 4 updating us with PIC32…

  2. luke4oxnet says:

    Don’t buy PICkit3 it is awfully slow. ICD3 is best price/value option.
    Using MPLAB 8.xx is real pain. I have not managed to enable code completition. Build in SVN client doesn’t support “Revert” option. If you are going to stay with PIC use MPLAB X beta, it has some bugs but it is far better then 8.x.

    • Thanks for the info!
      I have been using the MPLAB 8.xx for quite some for PIC32 and am pretty satisfied with it so far. Haven’t used a PICkit3 so not sure about its performance but I’ll take your word cause I have heard several people talk similar stuff about it in the forums. I own a PICkit2 and believe that its a darn good thing!

Leave a Reply

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

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

Facebook photo

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

Connecting to %s