Full Version : Brian Hammill's What is an AVR?
avr >>BEGINNERS & BUTTERFLIES >>Brian Hammill's What is an AVR?


Admin5- 04-19-2006
What is an AVR?

By Brian Hammill

The AVR family of microcontrollers from Atmel are economical, feature-rich microcontrollers featuring flash program memory. The entire family shares the same instruction set and basic architecture, so you don't have to re-learn a new architecture when going from a small 8 pin part with 2K of program memory to a large 40 pin part with 8K or more of program storage.

All AVR microcontrollers are in-system programmable through a serial interface. You can program the chip's flash program storage as well as EEPROM using simple software and just 4 wires to your target board. Easy in-circuit programmability combined with flash memory makes it easy to update code in the field or during development.

Most AVR instructions take only 1 clock cycle to complete. There is no internal division like on the PIC where an external clock or crystal is divided by 4, giving the true core clock rate. In theory an AVR running at 4 MHz would give about the same throughput as a PIC running at 16 MHz or an 8051 running at 48 MHz! The lower clock speed should give better EMI performance.

Executing 1 instruction per clock cycle makes it easier to keep up with how much time your code takes to execute. Some of the AVR parts run at up to 16 MHz or 16 MIPS. Not bad for a little 20 pin, 8-bit controller than costs under $3 US.

The AVR architecture was designed from the ground up for efficiency with C code. There are a number of C compilers available commercially and for free. You can also use the straightforward assembly language approach.

Many of the new parts incorporate analog to digital converters (ADC) and most of the parts have a built-in UART for serial communications. Most also have an analog comparitor, which can do A/D conversion or be used simply to compare two voltages. All of the parts have at least one programmable counter/timer. You do not have to dedicate any of the counter/timers to the UART like on some other controllers. A PWM output is also included on most of the parts and can be used for digital to analog conversion.

Getting started with the AVR requires nothing more than the free assembler, a simple programmer such as the one by Jerry Meng, and a target board. The target board can be as simple as a few parts since the AVR is highly integrated. Since it is easy to reprogram the flash memory code space, you can develop code and test without the need for an expensive in-circuit emulator. Of course it is nice if you can afford it, but the AVR opens up the world of embedded control to those who could not afford the tools in the past. For under $20 you can be on your way. Spending $49 for the Atmel evaluation board is a good way to go too, if you don't want to build your own programmer and target board.

I like the AVR family because it is fast, easy, flexible, and inexpensive both for the casual experimenter and the serious design engineer.



Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.