I have been using 8051 family of microcontrollers starting from 2002. There had been lost of effort, money and search I put to prototype one design using a microcontroller, finding the intended microcontroller in market, more than that getting the programmer, selecting suitable easy development environment etc. I remember when I bought an 8051 microcontroller programmer for 2400/- rupees. Things has been changed drastically nowadays, in the sense, resources are available right at our finger tips with less cost and full documentation. It was in May '06 that I seriously searched and thought about AVR microcontrollers. They really amazing in the sense, blessed with plenty of on chip functions, freely available development/ debug tools, plenty of articles and sample projects etc. A simple example for AVR's power is, most of them come with onchip 10 bit ADCs. They really help you to design your system fast and aviod much of the integration work, so that you can concentarte on the actual design problem. They have In System Programming (ISP) capability too, that really help during the initial stages of development of a design, where you will download the code to the flash many times. Else we have to take the chip out of the circuit and put in an external programmer.
I have woked with ATMEGA8515 and ATMEGA32 AVR microcontrollers. My main design was an Automatic Incubator using ATMEGA32, that used many on chip facilities of AVR. Out of them, the on chip I2C facility was the important one that I utilized much. It helped me to speed up interfacing of thermometer chips with the AVR. The negative side of the game is the device cost. But I think that can be balanced if we look at the utility of the device. If you are going for a uC+ADC design, compared it with a single AVR device with built in ADC.
1. Development Environment:
WinAVR I use C programming with WinAVR for code development. WinAVR contains different tools for code development and debug. Programmers notepad is an easy to use coding environment and it is a continuesly upgrading free software. C compiler used by WinAVR is avr-gcc. It has built in definitions and macros for onchip peripherals and their access. This ease the code development very much, we need to concentrate only on the high level implementation. Currently I am using WinAVR 20070525 release. Latest WinAVR release can be downloaded at http://sourceforge.net/projects/winavr/. Lets go through the code development steps.
I. Download WinAVR to your HDD and install it to a suitable location
II. For every project you develop using WinAVR, you need to keep a Makefile along with it, which will specify or hold the details about the project like, device used, name of C file, frequency of operation etc. It is better to keep the Makefile in the directory where your C code resides. Some of the important fields are
# MCU name
MCU = atmega8535
F_CPU = 12000000
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
# Target file name (without extension).
TARGET = nokia_3310_lcd
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c
III. write your C program using Programmers notepad and compile it Use Tools -> Makeall
IV. Output window will show the warning and errors, if any. else it will show that *.hex file has been generated successfully. This file is in intel hex format and this is to be downloaded to avr flash.
2. Programmer/ Programmer software:
I have incorporated one 28 pin IC socket and one 40pin ZIF socket with a common crystal for both. The above figure shows only 28 pin socket. I have also provided a 6pin male connector on the board which can be utilized to use the programmer for ISP purpose. I didn't provide any separate power supply for the board, else I am directly powering from USB. I couldn't find 68 ohm resistor in my component box so I used two 150 ohm resistors in parallel to form 75ohms. Also, I used 3.3V zener instead of 3.8V zener as prescribed in the above webpage. Other than these connections that are intended for USB, all others are straight forward. Going forward, I am planning to use USB code to utilize for my future projects to give PC access to the microcontroller system through USB. So we can configure settings, transfer data etc between PC and the design board. My practical Programmer circuit is shown in the first figure.
To download the hex file to flash, go to the folder where avrdude is available[…/WinAVR/bin/], run avrdude -c usbasp -p atmega8 -U flash:w:main.hex
3. AVR devices are available at,
#4, Mandi Veerappa Lane
Silver Jubilee Park Road
Parallel to Sardar Patrapa(S.P) Road
Bangalore 560 002PH:080-22238686,080-41140023
4. Sample project
http://www.circuitcellar.com/avr2006/winners/AT2951.htmI would suggest to use AVR for your newer designs. Surely that will help you much all through out your design phases.
I am happy to share and discuss designs with you if you like to do... Happy designing!!!