Projects‎ > ‎Programming‎ > ‎ATMEL AVR‎ > ‎

Why I Use Atmel AVR


Go to any forum for any sort of product in which similar versions are offered from multiple competitors, and you are bound to be lost in a dizzying slew of "fan-boy" nonsensical praise as well as harsh (and often meaningless) criticisms. This is just as true for microcontrollers as it is for cell phones and computer operating systems. Just like anything in life, the decision of who to go with is based on individual needs and wants. There is "no one-size fits all" rule. With that said, once you decide on a type of MCU, it can be in your favor to stick with it. Your knowledge of the instruction set will improve, thereby bettering your code. Also, you won't have to spend time and money collecting the necessary equipment to get up and running each time you start a new project.

Back Story

I never did anything with programming until college. My first experience with code was in an intro to C++ class - a major requirement. I really liked the class and did exceptionally well but never did anything applicable to my field until the Mobile Robotics Class I took senior year. Although I wasn't responsible for the programming of our robots, I did learn a lot and was able to create a lot of basic functionality in the robot-c language used in the XBC programmer. I applied many of these skills to my senior Project - ASLOC - by creating a lot of the code used to control various hardware aspects of the robot while the CS students wrote the higher end functionality such as decision making and path planning. There was a microcontroller course offered, but I never had time to take it. I believe the class was focused on the old favorite: 8051. On top of that, any time anyone I knew was using an MCU in school, they were pressured into using one of the PSoC development kits that our school had so many of, even though no one had ever been taught how to use them. A lot of time was always wasted trying to learn how to do the most trivial things. I never saw a reason to work with them myself.

The first time I was really on my own with programming was with Insomniac - a robot I built as a Master's Project in grad school. It just so happened that the controller designed for use with the iRobot Create was built around the Atmel ATmega168. This was a very popular AVR chip with 16k of flash memory. Although my inefficient coding took up every last ounce of that programming space, I was very impressed with ease and functionality of the MCU. I picked up on the instruction set rather quickly, and whenever I was in doubt, I found a lot of free and useful in formation online. My use of AVR microcontrollers had begun.

Fast Forward

WIth my desire to work in robotics, I knew I had to vastly improve my programming skills to be of any use to anyone. Also, to be able to build anything on my own, I would have to write my own code. Since I had previously worked with the ATmega168, I deecided to order a few of them from Digikey as well as a development board. That's it. There's no magic moment of awareness or long and thought out decision making. I simply went with something I was at least somewhat familiar with. To be honest, I was absolutely clueless to the whole process at first and actually tried to use the board's unconnected serial port to program the chip through a USB to serial converter. After a few unsuccessful attempts and a lot of headaches, I did the necessary research and learned that I need a specific type of programmer to download code directly to a chip (unless you use a bootloader, such as the one in the iRobot Create Command Module or the over-hyped Arduino). I also learned that most development boards are rather pointless if you know anything at all about electronics. I have since customized my mine to be a lot more useful.

I later picked up a USB programmer which has worked flawlessly on Windows XP (32 bit), Vista (32 bit), and 7 (64 bit). There are few different ways to program the chips, but I have stuck to the standard ISP (in system programmer) serial interface which can be found on almost every chip in the ATmega and ATtiny collection. Although I didn't pick the AVR series because of its available features, I have since learned of their vast amounts of functionality. There are numerous timers, interrupts sources, ADC channels, and built in hardware features. Many chips also feature a decent amount of EEPROM as well. The chips can be clocked internally or externaly with a crystal and a couple of capacitors or any other stable clock source. Most importantly (at least from a hobbyist point of view) there are multiple development tools, compilers, and complete integrated development environments (IDE) available completely free to anyone for whatever use on numerous operating systems, not to mention a plethora of reputable websites offering free tutorials and assistance.

Why Stick with AVR?

If you've ever known someone who only buys one brand of something, be it cars, ice cream, or jeans, they will swear up and down that their choice is the best and all other similar products are vastly inferior. This is, or course, complete nonsense. I would be an outright liar to tell you that AVR is the absolute best collection of microcontrollers available and that they would be the perfect fit in anything you could ever do. Not only that, but you would be a complete idiot to believe me. I chose AVR because it was easily available, well documented, feature rich, and cheap - a combination of things not often found in the engineering world. In addition to that, I had been somewhat forced to use the ATmega chip in school. If you are more comfortable with PIC, then by all means use it! Personally, I think it is a huge waste of time to filter through the thousands of available chips for a specific application when you already own the development tools and knowledge necessary to use a specific line. I am sure that someday in the future I will start using another type of MCU for personal or work related purposes, but for now I can find no logical reason to use anything else.

My Thoughts on Arduino

It would be impossible to be in the electronics industry at any level and not have heard of Arduino. At first, I was interested in the potential such a popular platform might have on the technology world, but I have since only been filled with resentment towards all things Arduino. In case you really don't know, Arduino is a development board built around AVR microcontrollers. There have been other versions using other MCUs, but the vast majority of them use AVR. If you never plan to design any of your own circuitry or work on a project beyond blinking an LED, I highly suggest you avoid the Arduino at all cost. There is NOTHING it can do that a standard AVR chip can't do; in fact, there is plenty it CANNOT do that a basic AVR chip can. Now with all of that in mind, if you have been working with technology for a while, and are (for lack of a better word) too lazy to write your own code or design your own circuits, then have at it. But for the most part, all the Arduino has created is a cult following of "hackers" who don't have the slightest clue what they are actually doing, and a whole lot of businesses cashing in on the ridiculous fandom.