2.3.1 Programming the Target Using mEDBG
Using the Embedded Debugger on the ATmega328P Xplained Mini board to program the ATmega328P.
- Connect the Xplained Mini USB to the PC.
- Go to Atmel Studio: Click the Tools tab, select Device Programming, and select the connected mEDBG as Tool with Device as ATmega328P and Interface to ISP, click Apply.
- Select “Memories”, locate the source .hex or .elf file, and click Program.
- 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.
- If the source file contains fuse settings, select “Production file” and upload the .elf file to program the fuses.
- Select “Fuses” to program the fuses manually. Set the fuse(s) and click “Program”. Recommended fuse settings: