The Nano platform based on the ATmega328 (Arduino Nano 3.0) or ATmega168 (Arduino Nano 2.x) microcontroller is small and can be used in laboratory work. It has similar functionality to the Arduino Duemilanove, but differs in assembly. The difference lies in the absence of a DC power connector and operation via a Mini-B USB cable. The Nano is developed and sold by Gravitech.
Quick Specs
Microcontroller
|
Atmel ATmega168 or ATmega328
|
Operating Voltage (Logic Level)
|
5V
|
Input voltage (recommended)
|
7-12V
|
Input voltage (limit)
|
6 -20V
|
Digital I/O
|
14 (6 of which can be used as PWM outputs)
|
Analog inputs
|
8
|
DC via input/output
|
40 mA
|
Flash memory
|
16 KB (ATmega168) or 32 KB (ATmega328) with 2 KB used for bootloader
|
RAM
|
1 KB (ATmega168) or 2 KB (ATmega328)
|
EEPROM
|
512 Bytes (ATmega168) or 1 KB (ATmega328)
|
Clock frequency
|
16 MHz
|
Dimensions
|
1.85 cm x 4.2 cm
|
Power:
Arduino Nano can receive food through h connecting Mini-B USB, or from an unregulated 6-20 V (pin 30), or regulated 5 V (pin 27), external power supply. The source with the highest voltage is automatically selected.
The FTDI FT232RL is powered only if the platform itself is powered from USB. Thus, when operating from an external source (not USB), there will be no 3.3 V voltage generated by the FTDI chip, while the RX and TX LEDs flash only when there is a high level signal on pins 0 and 1.
Memory
The ATmega168 microcontroller has 16KB of flash memory for storing the program code, and the ATmega328 microcontroller, in turn, has 32KB (in both cases, 2KB is used for storing the bootloader). The ATmega168 has 1 KB of RAM and 512 bytes of EEPROM (which is read and written by EEPROM library ), while the ATmega328 has 2 KB of RAM and 1 KB of EEPROM.
Inputs and Outputs
¦ ¦
¦ ¦
Each of the 14 digital pins on the Nano, using the functions pinMode(), digitalWrite(), and digitalRead(), can be configured as input or output. The pins operate at a voltage of 5 V. Each pin has a pull-up resistor (disabled by default) of 20-50 kOhm and can pass up to 40 mA. Some pins have special functions:
-
Serial bus: 0 (RX) and 1 (TX). Pins are used to receive (RX) and transmit (TX) TTL data. These pins are connected to the corresponding pins of the FTDI USB-to-TTL serial chip.
-
External interrupt: 2 and 3. These pins can be configured to trigger an interrupt on either a low value, a rising or falling edge, or when the value changes. See attachInterrupt () for details.
-
PWM: 3, 5, 6, 9, 10, and 11. Either pins provide 8-bit PWM using analogWrite ().
-
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins provide SPI communication which, although supported by the hardware, is not included in the Arduino language.
-
LED: 13. Onboard LED connected to digital pin 13. If the pin is high, the LED is on.
8 analog inputs are installed on the Nano platform, each with a resolution of 10 bits (i.e., it can accept 1024 different values). The pins have a range of up to 5 V relative to ground as standard, however it is possible to change the upper limit using the analogReference () function. Some pins have additional functions:
-
I2C: 4 (SDA) and 5 (SCL). Pins provide I2C communication (TWI). The Wire library is used to create it (see the Wiring website).
Additional pair of platform pins:
-
AREF. Reference voltage for analog inputs. Used with analogReference ().
-
Reset. A low signal level at the pin reboots the microcontroller. Usually used to connect a reset button on an expansion board, which prevents access to the button on the Arduino board itself.
Pay attention to the connection between Arduino pins and ATmega168 ports .
Communication
The Arduino Nano platform has several devices installed to communicate with a computer, other Arduino devices, or microcontrollers. The ATmega168 and ATmega328 support UART TTL (5V) serial interface via pins 0 (RX) and 1 (TX). The on-board FTDI FT232RL chip directs this interface over USB, and the FTDI drivers (included in the Arduino program) provide a virtual COM port to the program on the computer. The Serial Monitor of the Arduino software allows you to send and receive text data when connected to the platform. The RX and TX LEDs on the platform will blink when transmitting data through an FTDI chip or USB connection (but not when using serial transmission on pins 0 and 1).
With the SoftwareSerial library, it is possible to create serial data transmission over any of the digital pins on the Nano.
The ATmega168 and ATmega328 support I2C (TWI) and SPI interfaces. The Arduino includes a Wire library for easy use of the I2C bus. More details are in the documentation. To use the SPI interface, refer to the ATmega168 and ATmega328 microcontroller datasheet.
Programming
The platform is programmable with Arduino software. From the Tools> Board menu select "Arduino Diecimila, Duemilanove or Nano w/ATmega168" or "Arduino Duemilanove or Nano w/ATmega328" (according to the installed microcontroller). Please refer to the manual and instructions for details.
The ATmega168 and ATmega328 microcontrollers come with a pre-recorded bootloader, making it easy to write new programs without using external programmers. Communication is carried out by the original STK500 protocol.
It is possible not to use the bootloader and program the microcontroller through the ICSP block pins (in-circuit programming). You can find detailed information in this manual.
Automatic (software) reboot
Nano is designed in such a way that, before writing a new code, the reboot is performed by the program itself, and not by pressing a button on the platform. One of the FT232RL data flow control (DTR) lines is connected to the reset pin of an ATmega168 or ATmega328 microcontroller via a 100nF capacitor. Activation of this line, i.e. giving a low level signal, reboots the microcontroller. The Arduino program, using this function, uploads the code with one click of the Upload button in the programming environment itself. The low-level signaling on the DTR line is coordinated with the start of the code recording, which reduces the bootloader timeout.
This function has another application. The Nano reboots every time it is connected to the Arduino program on a Mac X or Linux computer (via USB). The bootloader works for the next half second after the reboot. During programming, the first few bytes of the code are delayed to prevent the platform from receiving incorrect data (all except the code of the new program). If you are debugging a sketch written to the platform one-time, or entering any other data at the first start, you need to make sure that the program on the computer waits for a second before transferring data.