4.
If the source contains fuse settings, go to
Production file
and upload the .elf file and program the
fuses.
Note:
If ISP programming fails it could be because the debugWIRE is enabled. See
on how to disable debugWIRE mode.
1.6.2.
Debugging the ATmega328PB Xplained Mini by using mEDBG
1.
Start
Atmel Studio
.
2.
Connect the mEDBG USB to the PC.
3.
Open your project.
4.
In the
Project
menu select the project properties page. Select the
Tools
tab and select mEDBG as
debugger and debugWIRE as interface.
5.
In the
Debug
menu click
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. Debugging can start.
8.
When exiting debug mode select
Disable debugWIRE and Close
in the
Debug
menu, this will
disable the DWEN fuse.
Note:
If the 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 by using the SPI (ISP) interface.
Atmel AT08401: Getting Started with Atmel ATmega328PB [APPLICATION NOTE]
Atmel-42482A-Getting-Started-with-ATmega328PB_AT08401_Application Note-08/2015
10