This user guide describes how to get started with the ATmega328PB Xplained Mini evaluation kit. The
evaluation kit is a hardware platform to evaluate the ATmega328PB microcontroller. The on-board mini
embedded debugger provides seamless integration with Atmel Studio. The kit provides access to the
features of the ATmega328PB enabling easy integration of the device in a custom design.
Steps to start exploring the Xplained Mini platform:
1.Download Atmel Studio.
2.Launch Atmel Studio.
3.Connect a USB cable (Standard-A to Micro-B or Micro-AB) between the PC and the USB port on
the kit.
ATmega328PB Xplained Mini
When the Xplained Mini kit is connected to your computer for the first time, the operating system will
perform a driver software installation. The driver file supports both 32- and 64-bit versions of Microsoft
Windows® XP, Windows Vista®, Windows 7, Windows 8, and Windows 10. The drivers for the kit are
included with the Atmel Studio.
Once the Xplained Mini board is powered the green status LED will blink and Atmel Studio will autodetect
which Xplained Mini board is connected. Atmel Studio will present relevant information like data sheets
and kit documentation. The ATmega328PB device is programmed and debugged by the on-board Mini
Embedded Debugger and therefore no external programmer or debugger tool is required.
2.2 Design Documentation and Related Links
The most relevant documents and software for the evaluation kit are available here:
ATmega328PB Xplained Mini website - Kit information, latest user guide, and design documentation.
ATmega328PB Xplained Mini on Microchip Direct - Buy this kit on microchipDIRECT.
•Atmel Studio - Free IDE for the development of C/C++ and assembler code for microcontrollers.
•Xplained products - Xplained evaluation kits are a series of easy-to-use evaluation kits for
Microchip microcontrollers and other Microchip products.
–Xplained Nano - used for low pin-count devices and provides a minimalistic solution with
access to all I/O pins of the target microcontroller.
–Xplained Mini - used for medium pin-count devices and adds Arduino Uno compatible header
footprint and a prototyping area.
–Xplained Pro - used for medium to high pin-count devices that features advanced debugging
and standardized extensions for peripheral functions.
®
Note: All the above kits have on-board programmers/debuggers, which creates a set of low-cost
boards for evaluation and demonstration of features and capabilities of different Microchip products.
•Atmel Spaces- Open Source projects for Xplained Mini.
•QTouch® tools - A collection of tools to design capacitive touch applications.
•http://start.atmel.com/ - Atmel START is an online tool that helps the user to select and configure
software components and tailor your embedded application in a usable and optimized manner.
2.3 Programming and Debugging
2.3.1 Programming the Target Using mEDBG
Using the Embedded Debugger on the ATmega328PB Xplained Mini board to program the
ATmega328PB.
2.Go to Atmel Studio: Click the Tools tab, select Device Programming, and select the connected
mEDBG as Tool with Device as ATmega328PB and Interface to ISP, click Apply.
3.Select "Memories", locate the source .hex or .elf file, and click Program.
4.NOTE: If a previous debug session was not closed by selecting "Disable debugWIRE and Close" in
the Debug menu, the DWEN fuse will be enabled and the target will still be in debug mode, i.e. it
will not be possible to program the target using the ISP interface.
5.If the source file contains fuse settings, select "Production file" and upload the .elf file to program
the fuses.
6.Select "Fuses" to program the fuses manually. Set the fuse(s) and click "Program". Recommended
fuse settings:
Using the Embedded Debugger on the ATmega328PB Xplained Mini board to debug the ATmega328PB
via debugWIRE.
ATmega328PB Xplained Mini
1.Start Atmel Studio.
2.Connect the Xplained Mini USB to the PC.
3.Open your project.
4.Click the "Project" tab and select the project "properties", click the "Tools" tab, and select mEDBG
as debugger and debugWIRE as interface.
5.Click the "Debug" tab and select "Start Debugging and Break".
6.Atmel Studio will display an error message if the DWEN fuse in the ATmega328PB is not enabled,
click YES to make Studio set the fuse using the ISP interface.
7.A debug session is started with a break in main, the debugging can start.
8.To exit debug mode, select "Disable debugWIRE and Close" in the Debug tab. This will disable the
DWEN fuse.
If debug mode is not exited by selecting "Disable debugWIRE and Close" in the Debug menu,
the DWEN fuse will be enabled and the target will still be in debug mode, i.e. it will not be
possible to program the target using ISP.
If any other CPU CLK than the external CLK supplied by the mEDBG is used, the debugWIRE
is not guaranteed to work.
Applying a signal to J202/RESET (the RESET_SENSE signal) while debugging may result in
unexpected behavior. This signal is NOT available during a debugging session because the
RESET line is actively used by the debugWIRE interface.
2.3.3 Programming the Target Using an External Programmer
How to program the target ATmega328PB using the AVR® JTAGICE mkII, JTAGICE3, Atmel-ICE, or other
programmers.
1.Connect the External Programmer USB to the PC.
2.Connect the External Programmer to the ATmega328PB Xplained Mini board ISP connector.
3.Go to Atmel Studio: Click the Tools tab, select Device Programming, and select the External
Programmer connected as Tool with Device as ATmega328PB and Interface to ISP, click Apply.
4.Select "Memories", locate the source .hex or .elf file, and click Program.
2.3.4 Programming the ATmega32U4 Using an External Programmer
How to program the ATmega32U4 using the AVR JTAGICE mkII, JTAGICE3, Atmel-ICE, or other
programmers.
1.Connect the External Programmer USB to the PC.
2.Connect the External Programmer to the ATmega328PB Xplained Mini board JTAG connector.
3.Go to Atmel Studio: Click the Tools tab, select Device Programming, and select the connected
mEDBG as Tool with Device as ATmega32U4 and Interface to JTAG, click Apply.
4.Select "Memories", locate the source .hex or .elf file, and click Program.
5.Select "Fuses" to program the fuses manually. Set the fuse(s) and click "Program". Recommended
fuse settings:
Warning: Changing the firmware in the ATmega32U4 will remove the programming and
debugging capabilities of the mEDBG. If the EEPROM is altered the mEDBG may not be
recognized by Atmel Studio anymore.
2.3.5 Programming the ATmega32U4 Using a Bootloader
This section describes how to use the bootloader to program the ATmega32U4.
1.Launch Atmel Studio.
2.Short strap J102.
3.Open the programming dialog, select the bootloader in the tool menu.
4.Connect the ATmega328PB Xplained Mini board USB connector to the PC.
5.Select Device = ATmega32U4 (Device - Select).
6.Select USB communication (Ctrl+U).
7.Select the memory area to program (use the toggle memory button).
8.Select Load Hex file (Ctrl+L).
9.Select Programming Options.
10. Click "Run", observe the status in the status field.
Warning: Changing the firmware in the ATmega32U4 will remove the programming and
debugging capabilities of the mEDBG. If the EEPROM is altered the mEDBG may not be
recognized by Atmel Studio anymore.