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.

The AVR family includes the following parts that are available or soon to be released:

Part Number Pins Flash EEPROM RAM UART ADC
90S1200 20 1K 64 Bytes 0 No No
90S2313 20 2K 128 128 Yes No
90S2323 8 2K 128 128 No No
90S2333 28 2K 128 128 Yes Yes
90S4433 28 4K 256 128 Yes Yes
90S4414 40 4K 256 256 Yes No
90S8515 40 8K 512 512 Yes No
90S4434 40 4K 256 256 Yes Yes
90S2343 8 2K 128 128 No No
Mega103 64 128K 4096 4096 Yes Yes
Mega603 64 64K 2048 4096 Yes Yes
Tiny10 8 1K 64 0 No No
Tiny12 8 1K 64 0 No No
Tiny13 8 2K 128 128 No No

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. Check out my other links and enjoy!

Back to my AVR Resources Page