The Arduino hardware uses a microcontroller IC which needs to be programmed to perform any desired task. This program is written in the Arduino software using the Arduino Programming Language (APL). After compiling the program it is loaded into the memory of the microcontroller
on the board using a serial or USB connection. The program can be downloaded to the memory of the microcontroller using the Arduino Software itself, thereby avoiding the need of any other external programmer. Writing codes for non professionals is a difficult task. This was the key goal of the Arduino to reduce the complexity in writing codes and allow non-professionals and creative people to foster their thinking with the help of Arduino.
The Arduino IDE provides an editor to prepare the sketch of hardware. The Arduino IDE code editor was very skillfully designed. It gives a very distinguished view (in colour and fonts) to the variables, constants, function, etc. of the source code. It includes features like syntax highlighting, brace matching and automatic code indentation. There is no need to manipulate the makefile or go on command line to dump the code into the hardware. The APL itself has a facility to burn the controller in a single click.
Sketch written in Arduino Programming Language (APL) goes under minor changes (the automatic generation of function prototype), when you press the compile button. Firstly main() function is added to the sketch and the arduino environment transforms the sketch into C or C++ code. The Arduino IDE uses GNU toolchain
and AVR lib
to compile the programs. Then it passes to the AVR-GCC
compiler, which translate/ converts those C instructions into equivalent machine understandable instructions and creates an object file. The object file is combined with standard Arduino Libraries which provides the definitions of the inbuilt arduino functions. The result of this is a single hex (Intel hex/ .hex) file. This hex file
is transferred to the microcontroller. The Arduino IDE uses avrdude
to transfer the hex file on the Arduino board either by using USB or serial port of PC.
The Arduino hardware was very skillfully designed to reduce the complexities arising in the circuitry. It has an In System Programmer (ISP), which allows users to transfer the software inside the microcontroller without removing it from the circuit. The basic model of an Arduino board consists of an 8-bit AVR microcontroller along with some other necessary components like a 5 volt linear regulator IC, a 16 MHZ crystal, ceramic resonator, output connectors, direct adaptor input, etc.
The IO ports on boards are positioned in a way that it can be easily attached with the interchangeable add-on modules, known as shields. Shields are daughter boards that can be externally attached/ plugged with the arduino boards to extent the board’s capabilities. For example an xbee shield can be attached with the arduino board to establish a wireless communication. A motor control shield can be attached on the top of Aurdino board to run the motors or to provide an ease to control the speed of motors. The Arduino Board can easily interface with external sensors, circuits or other peripherals.
Arduino hardware is available in various designs and configurations depending on the use. The different configurations use different AVR chips, Atmega8/168/328/1280/2560. Each board has its own additional feature, like Arduino UNO consists of ATmega328 which communicates to PC via USB using FTDI chip. very comfortable for attaching shields. On the other Arduino NANO uses Atmega168/328 which also uses FTDI chip but is much comfortable to use it on breadboard.
Some non-ATmega Arduino boards are also available. These boards don’t contain Atmel’s ATmega controller but are compatible with arduino shield. These microcontrollers cannot be programmed by the standard Arduino IDE but manufacturers do provide some other versions of Arduino IDE which includes the necessary libraries related to the controller. For example Leaflabs Maple based on 32bit arm processor or chipKIT UNO32 based on PIC micro controllers.
The earlier version of the arduino board had controller with bootloader which communicated with the Arduino IDE mostly via a Serial port. Later a FTDI chip was introduced on the Arduino board which is a USB to serial converter to allow the communication with the USB port. And today the Arduino boards are available with Atmel’s microcontroller which have inbuilt capacity to communicate with the USB port.