Understanding Arduino software architecture
In order to understand how to make our nice Arduino board work exactly as we want it to, we have to understand the global software architecture and the toolchain that we'll be using quite soon.
Take your Arduino board in hand. You'll see a rectangle-shaped IC with the word ATMEL written on the top; this is the processor.
This processor is the place that will contain the entire program that we'll write and that will make things happen.
When we buy (check Appendix G, List of Components' Distributors, and this link: http://arduino.cc/en/Main/Buy) an Arduino, the processor, also named chipset, is preburnt. It has been programmed by careful people in order to make our life easier. The program already contained in the chipset is called the bootloader (http://en.wikipedia.org/wiki/Booting). Basically, it takes care of the very first moment of awakening of the processor life when you supply it some power. But its major role is the load of our firmware (http://en.wikipedia.org/wiki/Firmware), I mean, our precious compiled program.
Let's have a look at a small diagram for better understanding:
I like to define it by saying that the bootloader is the hardware's software and the firmware is the user's software. Indeed, it also has some significance because memory spaces in the chipset are not equal for write operations (within a specific hardware which we'll discuss in the future sections of this book). Using a programmer, we cannot overwrite the bootloader (which is safer at this point of our reading) but only the firmware. This will be more than enough even for advanced purposed, as you'll see all along the book.
Not all Arduino boards' bootloaders are equivalent. Indeed, they have been made to be very specific to the hardware part, which provides us more abstraction of the hardware; we can focus on higher levels of design because the bootloader provides us services such as firmware upload via USB and serial monitoring.
Let's now download some required software:
FTDI USB drivers: http://www.ftdichip.com/Drivers/VCP.htm
Arduino IDE: http://arduino.cc/en/Main/Software
Processing: http://processing.org/download/
Processing is used in this book but isn't necessary to program and use Arduino boards.
Tip
What is the Arduino's toolchain?
Usually, we call Arduino's toolchain a set of software tools required to handle all steps from the C code we are typing in the Arduino IDE on our computer to the firmware uploaded on the board. Indeed, the C code you type has to be prepared before the compilation step with avr-gcc and avr-g++ compilers. Once the resulting object's files are linked by some other programs of the toolchain, into usually only one file, you are done. This can later be uploaded to the board. There are other ways to use Arduino boards and we'll introduce that in the last chapter of this book.