Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Board: Arduino Uno
WARNING: This entry will be deprecated. All content has been moved to doc.riot-os.org
The Arduino Uno is one of the cheapest board to start and discover with electronics and embedded coding. It is based on Atmel's AVR architecture and sports an ATmega328p MCU. It is like many Arduinos extensible by using shields.
|Timers||3 (2x 8bit, 1x 16bit)|
|ADCs||6 analog input pins|
|I2Cs||1 (called TWI)|
|Datasheet / Reference Manual||Datasheet and Reference Manual|
|Board Manual||Board Manual|
Flashing the device
Flashing RIOT on the Arduino Uno is quite straight forward, just connect your Arduino Uno using the programming port to your host computer and type:
make BOARD=arduino-uno flash
This should take care of everything!
We use the open
avrdude tool to write the new code into the ATmega328p's flash
Don't expect having a working network stack due to very limited resources.
The ATmega328P uses debugWIRE instead of JTag. This could be used by a simple standalone software or using AVaRICE and GDB. The latter approach has more features, thus, this document focuses on this. The cheapest (sadly still about 60€) hardware adapter supported by AVaRICE is the AVR Dragon, hence, this document focuses on this.
To automatically reset the Arduino UNO while programming using the USB connection (no external programmer), an capacitor is added to the REST pin. As debugWIRE uses the reset pin, this capacitor has to be disconnected. This can be done using the circuit board track on new Arduino Unos (or good clones), or requires desoldering or cutting of the capacitor on older boards (or less good clones).
|Fuse||Default Value||Debugging Value|
To enable debugging run:
avrdude -c dragon_isp -p m328p -U lfuse:w:0xff:m -U hfuse:w:0x9e:m -U efuse:w:0xfd:m
To restore the default fuse configuration (e.g. using an AVR Dragon) run:
avrdude -c dragon_isp -p m328p -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0xfd:m
Note that restoring the fuses takes a bit longer, as ISP functionality is not working when debugWIRE is enabled, as the RESET pin is not working as RESET pin.
avrdude detects this and tries to temporarily disable debugWIRE by issuing a debugWIRE command. Afterwards ISP is working properly and debugWIRE is disabled. Don't forget to re-solder the capacitor to restore normal operation, otherwise you have to press the reset button manually while flashing.
Start On-Chip Debugging
Once the hardware is prepared, the fuses are configured to enable the debugWIRE interface, and AVaRICE is installed, simply type
in your application folder.
(NOTE: This is not yet working. I'll create a pull request adding this within the next few days)