Howto
ATmega328P Xplained Mini support in
Arduino
In order to use the ATmega328P Xplained Mini development board in the Arduino IDE, all it needs is
an Arduino compatible bootloader and the installation of a board support package in the Arduino
IDE. Notice that the ATmega328P Xplained Mini development board features an on-board debugger,
the mEDBG, that is used in this application as an USB to UART convertor. This document describes
how to build and install the bootloader and the required packages for the Arduino IDE. This
instruction is intended for students, teachers and support staff.
Optiboot
Optiboot is a bootloader for Arduino and Atmel AVR chips. It takes several steps to use this
bootloader.
1. Compiling the bootloader from source files.
This step is OPTIONAL, because a suitable executable file has already been created and is
available on #OO. The file is called:
optiboot_xplained328p.hex
2. Programming the bootloader.
3. Install packages in the Arduino IDE, so the custom board is supported.
4. Configure the Arduino IDE settings accordingly.
The remainder of this document describes all steps in detail.
Step 1. Compiling the bootloader - OPTIONAL
If for some reason a new bootloader needs to be built, then the source files can be downloaded here:
[Link]
Open the project in Atmel Studio (or another compatible IDE). The project file is located here:
optiboot-master\optiboot\AtmelStudio\[Link]
Built the project.
Note. Ignore the following error: “recipe for target 'baudcheck' failed”
Note. The default compiler settings are sufficient. Compiler options, such as
LED_START_FLASHES=n, can be found here:
optiboot-master\Wiki\[Link]
These options can be added to the Build Commandline setting in the project’s settings (or
directly in the makefile ([Link])).
The generated HEX file is located here:
optiboot-master\optiboot\bootloaders\optiboot\optiboot_xplained328p.hex
Step 2. Programming the bootloader
The generated HEX file must be programmed to the ATmega328P Xplained Mini. Follow the
instructions as described here:
[Link]
Preparing-atmega*-Xplained-mini-for-Arduino-IDE-use-(MS-Windows)
With the provided bootloader correctly installed, the orange LED0 starts blinking fast three times per
second. This not only indicates the successful programming of the bootloader, it also indicates that
no additional application from the Arduino IDE has been programmed yet.
Note 1
For the ATmega328P microcontroller, the fuses must be programmed as follows:
Fuse register Value
EXTENDED 0xFC
HIGH 0xDE
LOW 0xE0
Note 2
The Device Programming application uses the ISP interface to access the fuse registers. If it is not
possible to access the fuse registers through the ISP interface, it is likely that the ISP interface is
disabled and the debugWIRE is enabled instead. The ISP interface is enabled (and hence the
debugWire disabled) by starting the debugger (use any (example) project), and select from the
Debug menu the option Disable debugWIRE and close.
Step 3. Installing packages
The ATmega328P Xplained Mini is supported by a custom board manager in the Arduino IDE. Follow
the instructions as described here to install support for the ATmega328P Xplained Mini board:
[Link]
How-to-use-AVR-Xminis-board-in-Arduino-IDE
Note. Start at step 3.
Step 4. Arduino settings
In the Arduino IDE, select the board as show in the following image:
Make sure the correct COM port is selected.
Verify the installation by uploading the blink example sketch.