Archive

Posts Tagged ‘Development Board’

My tryst with the AVR microcontroller.

December 2nd, 2008

I am deeply attached to the 8051 microcontroller. In the truest sense, it has been my first love. It was the very first microcontroller which I was introduced to and then it was love at first sight. Even my undergraduate project work was based on the 8051 microcontroller. (Although sometime back I did purchase an Arduino board, which in fact has an Atmega16 microcontroller in it. But you know the thing with Arduino, the processing IDE abstracts out everything for you and I never really was HW-aware that I was working with an Atmega in the strictest sense. So in effect this particular project represents my true close encounter with the AVR series of microcontrollers).

So even when I started this hobby of creating embedded stuff for fun at home, it was my natural choice. I had my own development platform - both software and hardware for the 8051 and I enjoyed creating stuff using it. For an interesting story on how I got my development platform together for the 8051, take a look at this post.

Of late however, I decided it was time to see beyond the horizon of the 8051 microcontroller. So I decided to take upon a new beast. Two most popular choices were the PIC microcontroller and the Atmel AVR. After doing some research, I zeroed down on the AVR, chiefly for three reasons:

a) Most of the basic AVR micros had JTAG debugging. Till now the 8051 variant (AT89S52) I was using did not have any debugging facilities.

b) AVR packs in more MIPS for the same clock frequency compared to a PIC.

c) Freely downloadable and FULL version of the IDE for the AVR from its makers, Atmel. On the other hand the full version of the PIC development IDE from Microchip costs real money.

Besides, the AVR is much more advanced than the plain old 8051 which I am using currently. It has :

a) An in built 8 channel ADC. The AT89S52 has none.
b) An in built hardware SPI(Serial Perepheral Interface) and TWI(Two-Wire Interface). The AT89S52 has none.
c) An in built EEPROM to store program settings and persistent data. The AT89S52 has none.
d) An in built analog comparator. The AT89S52 has none.
e) An in built PWM generator to control DC motors and the like. The AT89S52 has none.
f) In built JTAG debugging, the MOST important factor for me. The AT89S52 has none.
g) The AVR RISC architecture has been designed ground up to be keeping in mind the C language. So very compact and high density code can be generated with the widely available avr-gcc C compiler. AT89S52, on the other hand was never designed to work with C, although there are compilers(both closed source and open source) which claim to generate efficient code.

Of course, there are about a zillion 8051 variants(SILABs, Analog Devices etc.) out there in the market today which boast of all these add on capabilities like ADC/SPI/USB connectivity etc. But I compared with only the plain vanilla 8051 (AT89S52) here, because that is the one I have used so far and also to level the playing field.

After an extensive research, I gathered the following list in order to realize a complete HW+SW development platform for my future AVR projects.

a) A programmer to ‘burn’ the hex files into my microcontroller : PonyProg(SW) + SIProg(HW).
b) A small ‘development’ board wherein I can prototype my creations before ‘deployment’ : ATMega32 Dev Board.
c) A compiler/assembler suite (possibly with an IDE) to create the software to run on the ATMega32.(AVRStudio, WinAVR)
d) A JTAG board to allow real time and in-system debugging of the microcontroller : Aquaticus JTAG Board .

It took about 2 days to create a) and b). As for c), I was able to very easily download them from the web. Currently, I am engaged in making d), the JTAG debugging board and once that is done, the setup for me development environment would be complete.

Oh, here are some pictures that I took yesterday of my first setup consisting of the programmer board and the development board. Please don’t mind the crudeness of my stuff. I am still to learn to make actual PCBs at home and so till then please adjust with the ugly-looking pre-drilled PCBs. I wrote a simple C program to blink an LED on and off to see if my setup was working properly.

img_0557

My own programmer board based upon the modified SI prog circuit. Notice the serial port connectors at top left corner. I admit, I could have made it much more compact. Also notice the crude power lines coiled up like a snake. For this board, I am drawing the needed 5 volts from the PC SMPS power supply.

The small development board with the ATMega32 in place along with the 8Mhz crystal and the power terminals.

The small development board with the ATMega32 in place along with the 8Mhz crystal and the power terminals.

My first AVR LED blinky program. The Program was written in the AVR Studio IDE, compiled using avr-gcc and programmed using my new SIProg programmer board.

My first AVR LED blinky program. The Program was written in the AVR Studio IDE, compiled using avr-gcc and programmed using my new SIProg programmer board.

So that’s about my first tryst with the AVR microcontroller. I hope you enjoyed reading it as much I enjoyed writing it.

I also do hope that my dear old 8051, does not get jealous and get me wrong. She is still my first love. AVR and I are just friends! ;-)

admin Embedded Hobbyist, My Creations, Tech , , , , , ,