mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards: Add support for the Arduino Nano
The Arduino Nano board is the cheapest member of the Arduino family and used the same MCU as the Arduino Uno. It differs in the form factor (the Nano is much smaller), it uses an integrated FT232RL TTL adapter instead of an ATmega16u2 to provide access to the serial console via USB, and it uses a different bootloader (which occupies 2 KiB of the 32 KiB flash instead of 0.5 KiB occupied on the Arduino Uno). This commit mostly copy pastes code from the Arduino Uno.
This commit is contained in:
parent
0f4e51d543
commit
e4ebbaf59f
5
boards/arduino-nano/Makefile
Normal file
5
boards/arduino-nano/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = board
|
||||
|
||||
DIRS = $(RIOTBOARD)/common/arduino-atmega
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
3
boards/arduino-nano/Makefile.dep
Normal file
3
boards/arduino-nano/Makefile.dep
Normal file
@ -0,0 +1,3 @@
|
||||
USEMODULE += boards_common_arduino-atmega
|
||||
|
||||
include $(RIOTBOARD)/common/arduino-atmega/Makefile.dep
|
3
boards/arduino-nano/Makefile.features
Normal file
3
boards/arduino-nano/Makefile.features
Normal file
@ -0,0 +1,3 @@
|
||||
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/atmega328p/Makefile.features
|
23
boards/arduino-nano/Makefile.include
Normal file
23
boards/arduino-nano/Makefile.include
Normal file
@ -0,0 +1,23 @@
|
||||
# define the cpu used by the Arduino Nano board
|
||||
export CPU = atmega328p
|
||||
|
||||
# configure the terminal program
|
||||
PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
BAUD ?= 9600
|
||||
|
||||
PROGRAMMER ?= arduino
|
||||
|
||||
ifeq (arduino,$(PROGRAMMER))
|
||||
# the Arduino Nano bootloader is 2KiB in size
|
||||
BOOTLOADER_SIZE ?= 2048
|
||||
# the Nano's bootloader uses 57600 baud for programming
|
||||
FFLAGS_EXTRA += -b 57600
|
||||
else
|
||||
# not using the bootloader for programming, thus the whole flash can be used
|
||||
BOOTLOADER_SIZE ?= 0
|
||||
endif
|
||||
|
||||
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
|
||||
|
||||
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include
|
42
boards/arduino-nano/doc.txt
Normal file
42
boards/arduino-nano/doc.txt
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
@defgroup boards_arduino-nano Arduino Nano
|
||||
@ingroup boards
|
||||
@brief Support for the Arduino Nano board
|
||||
|
||||
## Overview
|
||||
|
||||
The Arduino Nano is the cheapest member of the Arduino family. It is based on
|
||||
Atmel's AVR architecture and sports an ATmega328p MCU. It is like many Arduinos
|
||||
extensible by using shields.
|
||||
|
||||
### MCU
|
||||
| MCU | ATmega328p |
|
||||
|:------------- |:--------------------------------------------- |
|
||||
| Family | AVR/ATmega |
|
||||
| Vendor | Atmel |
|
||||
| RAM | 2 KiB |
|
||||
| Flash | 32 KiB (2 KiB reserved for the bootloader) |
|
||||
| Frequency | 16 MHz |
|
||||
| Timers | 3 (2x 8bit, 1x 16bit) |
|
||||
| ADCs | 6 analog input pins |
|
||||
| UARTs | 1 |
|
||||
| SPIs | 1 |
|
||||
| I2Cs | 1 (called TWI) |
|
||||
| Vcc | 5.0V |
|
||||
| MCU Datasheet | [ATmega328p datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) |
|
||||
| Board Manual | [Board Manual](https://www.arduino.cc/en/uploads/Main/ArduinoNanoManual23.pdf) |
|
||||
|
||||
## Flashing the device
|
||||
Flashing RIOT on the Arduino Nano is quite straight forward, just connect your
|
||||
Arduino Nano via the USB connector to your host computer and type:
|
||||
|
||||
`make BOARD=arduino-nano flash`
|
||||
|
||||
This should take care of everything!
|
||||
|
||||
We use the open `avrdude` tool to write the new code into the ATmega328p's
|
||||
flash
|
||||
|
||||
##Caution
|
||||
Don't expect having a working network stack due to very limited resources.
|
||||
*/
|
33
boards/arduino-nano/include/board.h
Normal file
33
boards/arduino-nano/include/board.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_arduino-nano
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific definitions for the Arduino Uno board
|
||||
*
|
||||
* @author Martine Lenders <m.lenders@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef BOARD_H
|
||||
#define BOARD_H
|
||||
|
||||
#include "board_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BOARD_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user