Intro to Arduino: What is Arduino?
Arduino is an organization that has provided a way to develop microcontroller projects without having to worry about the technical details. This lets people that have never touched electronics or programming create things with the Arduino environment with a very small learning curve. People with all kinds of backgrounds including artists, students, teachers, and professionals have been able to easily create advanced automation by using the Arduino environment.
How Does the Arduino Environment Make Development Easy?
I’m sure you’ve seen (at least in part) what a pilot goes through to get a plane up in the air. The pilot has to go through a pre-flight check, set the fuel lines, set the flaps, set the choke, and so on before he is ever actually flying the plane. On the other hand, when you are on a plane and the pilot offers you the yolk to fly the plane, you get to skip all of those tedious steps and fly right away. This is what the Arduino environment does for you.
Normally, when you work with a microcontroller you have to turn on and set up all of the different parts of the microcontroller that you need for your project, bit by bit (literally). That takes a lot of time and it can be very frustrating if you overlook something. Arduino helps us around this by creating a standard operating environment (program) that runs on the microcontroller with any sketch. This program sets up all of the modules and settings in the microcontroller. The program code that you write (your sketch) becomes a part of their program. Now, when you turn on the microcontroller, it begins to run the Arduino program, which sets up the microcontroller and gets things going, and then it runs your code.
Related Hardware
In addition to the software, Arduino also standardized a form-factor for the compatible hardware. This form-factor defines the location of the power connections, digital I/Os, analog inputs, and some communication connections. Because of this standardization, other peripheral boards (i.e. shields) can be stacked on top of Arduino boards and connect appropriately. This form-factor can be seen on boards like the Uno, Leonardo, Yun, Galileo, etc. Larger boards, like the Mega, also have the standard layout with the addition of even more connections.
What Arduino Is Not
Now, we need to set some terminology straight. Arduino is not a board, processor, or circuitry. Arduino is the ecosystem of software and hardware standardization that creates the compatibility and ease of development that we associate with Arduino boards.
Arduino development boards like the Uno, Leonardo, Mega, and so on are just microcontroller development boards. Believe it or not, there is no magic in the boards that make them Arduinos. It is important to understand this so that you don’t feel trapped. You are programming REAL microcontrollers when you use the Arduino environment. You are just skipping the setup. I have programmed Arduino boards with other software and I have programmed other hardware with Arduino. The only thing that has been done to make the Arduino boards work with the Arduino environment is that a UART serial bootloader has been loaded onto the microcontroller.
The Bootloader
The serial bootloader that is programmed into the processor of every Arduino development board is the secret to the simplicity of programming the Arduino board for such a low cost. Without the bootloader, every board would have to have a special programmer circuit built into it.
By default, you have to load a program into a microcontroller’s memory using a special programmer. However, most microcontrollers have the ability to change their own memory. A bootloader is a very small program that is loaded onto a microcontroller that uses the self-writing ability of the microcontroller. When in programming mode, the bootloader receives instructions from a communication stream (UART serial in this case) and writes the program into memory next to the bootloader program. The next time the microcontroller is reset, the bootloader will run again (as always) and check to see if it should start program mode. If it is not told to enter program mode, the bootloader will stop running and tell the microcontroller to run the program code instead. The beauty of using the bootload to upload program code is that you do not need a special programmer. Arduino boards only have a USB to UART serial bridge to pass the programming commands from the computer to the microcontroller.
The only drawbacks to using a bootloader are that it ALWAYS runs before your code, which delays the start of your code, and it uses a little bit of the available program memory. If you are interested in flashing your own bootloader or program code without using a bootloader, you should check out the programmers that we stock in our Development Tools section or give the ArduinoISP sketch a try (much slower).