Microchip ATMEGA328P User Manual

ATmega328P Xplained Mini
ATmega328P Xplained Mini

Preface

This user guide describes how to get started with the ATmega328P Xplained Mini evaluation kit. The evaluation kit is a hardware platform to evaluate the ATmega328P microcontroller. The on-board mini embedded debugger provides seamless integration with Atmel Studio and MPLAB® X integrated development platform. The kit provides access to the features of the ATmega328P enabling easy integration of the device in a custom design.
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 1
ATmega328P Xplained Mini

Table of Contents

Preface........................................................................................................................................................... 1
1. Introduction............................................................................................................................................. 3
1.1. Features....................................................................................................................................... 3
1.2. Board Overview............................................................................................................................3
2. Getting Started........................................................................................................................................ 5
2.1. Xplained Mini Quick Start............................................................................................................. 5
2.2. Design Documentation and Related Links................................................................................... 5
2.3. Programming and Debugging...................................................................................................... 5
3. Xplained Mini.........................................................................................................................................10
3.1. Mini Embedded Debugger..........................................................................................................10
3.2. mEDBG Configuration................................................................................................................ 11
3.3. mEDBG Firmware Upgrade and Manual Bootloader Entry........................................................13
4. Hardware User Guide........................................................................................................................... 14
4.1. Power Sources........................................................................................................................... 15
4.2. Board Assembly......................................................................................................................... 15
4.3. Target Headers and Connectors................................................................................................ 16
4.4. Target Peripherals...................................................................................................................... 17
4.5. mEDBG...................................................................................................................................... 19
4.6. Extension Header Area.............................................................................................................. 20
4.7. Factory Programmed..................................................................................................................21
5. Hardware Revision History and Known Issues..................................................................................... 22
5.1. Identifying Product ID and Revision........................................................................................... 22
5.2. Revision 4...................................................................................................................................22
6. Document Revision History...................................................................................................................23
The Microchip Website.................................................................................................................................24
Product Change Notification Service............................................................................................................24
Customer Support........................................................................................................................................ 24
Microchip Devices Code Protection Feature................................................................................................ 24
Legal Notice................................................................................................................................................. 24
Trademarks.................................................................................................................................................. 25
Quality Management System....................................................................................................................... 25
Worldwide Sales and Service.......................................................................................................................26
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 2

1. Introduction

1.1 Features

The ATmega328P Xplained Mini evaluation kit provides a development platform for the ATmega328P.
Key Features
• On-board Debugger With Full Source-Level Debugging Support In Atmel Studio/MPLAB® X
• Auto-ID For Board Identification In Atmel Studio/MPLAB® X
• Access To All Signals On The Target MCU
• One Green mEDBG Status LED
• One Yellow User LED
• One Mechanical User Push Button
• Virtual COM Port (CDC)
• External Target CLK 16 MHz At 5V, 8 MHz At 3.3V
• USB Powered
• 3.3V Regulator
• Arduino Shield Compatible Footprints
• Target SPI Bus Header Footprint
• Xplained Pro Extension Headers Can Easily Be Strapped In
ATmega328P Xplained Mini
Introduction

1.2 Board Overview

A brief overview of the default kit configuration, headers, and connectors.
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 3
Digital I/O Low (J201)
Digital I/O High (J200)
Power (J202)
Analog I/O (J203)
PC4
PC5
mega328P
Power
Ground
Target I/O
Shared I/Os
PC3
PC2
PC1
PC0
VIN
GND
5V
GND
3V3
RESET
VCC
NC
PD0
PD1
PD2
PD3
PD4
PD5
GND
PD6
PD7
PB0
PB1
PB2
PB3
PB4
PB5
AREF
PC4
PC5
LED / ISP (J204)
CDC TX
CDC RX
External
Clock
SPI
(J204)
CDC UART
(J104)
mEDBG
(ATmega32U4)
Power source
(J300)
Micro USB
Connector
Target power
(J301)
Status
LED
PB5PB7
User
LED
User
button
ISP (J204)
ISP (J204)
ANALOG (J203)
ANALOG (J203)
DIGITAL J200
DIGITAL J200
ATmega328P Xplained Mini
Figure 1-1. ATmega328P Xplained Mini Headers and Connectors
Introduction
Table 1-1. Default Configurations
Function Default Configuration Other Settings
Kit power source (J300) 5.0V USB powered External input VIN
Target power (J301) 5.0V USB powered 3.3V from on-board regulator
ATmega328P clock 16 MHz mEDBG clock
Info: 
Changing the default settings requires modification of the kit using a soldering iron.
1. Details on how to change the power settings are described in 4.1 Power Sources.
2. Details on the mEDBG clock are described in 3.1.1 Xplained Mini Clock Output.
3. Debugging through debugWIRE may be disabled if the internal oscillator is used.
(2)
Internal oscillator
(1)
(3)
(1)
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 4

2. Getting Started

2.1 Xplained Mini Quick Start

Steps to start exploring the Xplained Mini platform:
1. Download Atmel Studio/MPLAB® X IDE.
2. Launch Atmel Studio/MPLAB® X.
3. Connect a USB cable (Standard-A to Micro-B or Micro-AB) between the PC and the USB port on the kit.
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 Atmel Studio/MPLAB® X.
Once the Xplained Mini board is powered, the green status LED will blink, and Atmel Studio/MPLAB® X will autodetect which Xplained Mini board is connected. Atmel Studio/MPLAB® X will present relevant information like data sheets and kit documentation. The ATmega328P device is programmed and debugged by the on-board Mini Embedded Debugger and, therefore, no external programmer or debugger tool is required.
ATmega328P Xplained Mini
Getting Started

2.2 Design Documentation and Related Links

The most relevant documents and software for the evaluation kit are available here:
ATmega328P Xplained Mini website - Kit information, latest user guide, and design documentation.
ATmega328P 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.
MPLAB® X IDE - MPLAB® X IDE is a software program that runs on a PC (Windows®, Mac OS®, Linux®) to develop applications for Microchip microcontrollers and digital signal controllers. It is called an Integrated Development Environment (IDE) because it provides a single integrated “environment” to develop code for embedded 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 feature 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 START - 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 ATmega328P Xplained Mini board to program the ATmega328P.
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 ATmega328P and Interface to ISP, click Apply.
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 5
ATmega328P Xplained Mini
Getting Started
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:
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 6

2.3.2 Debugging the Target Using mEDBG

Using the Embedded Debugger on the ATmega328P Xplained Mini board to debug the ATmega328P 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 ATmega328P 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, and the debugging can start.
8. To exit debug mode, select “Disable debugWIRE and Close” in the Debug tab. This will disable the DWEN
fuse.
ATmega328P Xplained Mini
Getting Started
Info: 
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 ATmega328P 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 ATmega328P 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 ATmega328P 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 ATmega328P 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.
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 7
WARNING
ATmega328P Xplained Mini
Getting Started
5. Select “Fuses” to program the fuses manually. Set the fuse(s) and click “Program”. Recommended fuse
settings:
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 ATmega328P Xplained Mini board USB connector to the PC.
© 2020 Microchip Technology Inc.
User Guide
DS50002659B-page 8
Loading...
+ 18 hidden pages