This user guide describes how to get started with the Atmel® ATmega328PB
Xplained Mini board. The ATmega328PB Xplained Mini evaluation kit is a
hardware platform to evaluate the Atmel ATmega328PB microcontroller. The
evaluation kit comes with a fully integrated debugger that provides seamless
integration with Atmel Studio 6.2 (and later version). The kit provides access
to the features of the ATmega328PB enabling easy integration of the device
in a custom design.
How to connect the ATmega328PB UART to a COM port.
All Xplained Mini boards have an embedded debugger (mEBDG) with a number of features, among them
a CDC/COM port, which enables the user to connect the ATmega328PB UART to the PC.
1.Connect the Xplained Mini USB to the PC.
2.A COM port named "mEDBG Virtual COM Port" will be available.
3.Start a terminal emulator or other applications using the COM port, typical COM port settings are
9600 baud N81.
1.4. Programming and Debugging
Programming and debugging the ATmega328PB Xplained Mini.
The target micro-controller is the ATmega328PB.
The mEDBG FW is running on the ATmega32U4.
1.4.1. Programming the Target using mEDBG
Using the Embedded Debugger on the ATmega328PB Xplained Mini board to program the
ATmega328PB and setting the fuses.
1.Connect the Xplained Mini USB to the PC.
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 SPI, click Apply.
3.Select "Memories" and 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 SPI.
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:
1.4.2. Debugging the Target using mEDBG
Using the Embedded Debugger on the ATmega328PB Xplained Mini board to debug the ATmega328PB
via debugWIRE.
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 SPI interface.
7.A debug session is started with a break in main, debugging can start.
8.When exiting debug mode select "Disable debugWIRE and Close" in the Debug tab, this will
disable the DWEN fuse.
Important: If not exiting debug mode 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 SPI.
Important: If any other CPU CLK than the external CLK supplied by the mEDBG is used the
debugWIRE is not guaranteed to work.
Important: Applying a signal to J202/RESET (the RESET_SENSE signal) while debugging
may result in unexpected behaviour. This signal is NOT available during a debugging session
because the RESET line is actively used by the debugWIRE interface
1.4.3. Programming the Target using an External Programmer
How to program the target ATmega328PB using the AVR® JTAGICE mkII, JTAGICE3, Atmel-ICE, or
other Atmel Programmers.
1.Connect the External Programmer USB to the PC.
2.Connect the External Programmer to the ATmega328PB Xplained Mini board SPI 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 SPI, click Apply.
4.Select "Memories" and locate the source .hex or .elf file and click Program.
1.4.4. Programming the ATmega32U4 using an External Programmer
How to program the ATmega32U4 using the AVR® JTAGICE mkII, JTAGICE3, Atmel-ICE, or other Atmel
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" and locate the source .hex or .elf file and click Program.