ATmega328P Xplained Mini
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. The kit provides access to the
features of the ATmega328P enabling easy integration of the device in a custom design.
Table of Contents
Preface............................................................................................................................ 1
1. Introduction................................................................................................................4
1.1. Features....................................................................................................................................... 4
1.2. Board Overview............................................................................................................................4
2. Getting Started.......................................................................................................... 6
2.1. Xplained Mini Quick Start............................................................................................................. 6
2.2. Design Documentation and Related Links................................................................................... 6
2.3. Programming and Debugging...................................................................................................... 6
2.3.1. Programming the Target Using mEDBG........................................................................6
2.3.2. Debugging the Target Using mEDBG............................................................................ 8
2.3.3. Programming the Target Using an External Programmer..............................................9
2.3.4. Programming the ATmega32U4 Using an External Programmer..................................9
2.3.5. Programming the ATmega32U4 Using a Bootloader...................................................10
3. Xplained Mini........................................................................................................... 11
3.1. Mini Embedded Debugger..........................................................................................................11
3.1.1. Xplained Mini Clock Output..........................................................................................11
3.2. mEDBG Configuration................................................................................................................12
3.2.1. mEDBG Low Power Modes......................................................................................... 12
3.2.2. mEDBG Fuse Filter......................................................................................................12
3.2.3. mEDBG Command Line Interface............................................................................... 13
3.2.4. Super User Fantastic Feature Enable Register........................................................... 14
3.3. mEDBG Firmware Upgrade and Manual Bootloader Entry........................................................14
Customer Support......................................................................................................... 27
Legal Notice...................................................................................................................28
Trademarks................................................................................................................... 28
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
• Auto-ID for board identification in Atmel Studio
• 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
PB7 PB5
Info:
Changing the default settings require modification of the kit using a soldering iron.
1. Details on how to change the power settings are described in Power Sources.
2. Details on the mEDBG clock are described in Xplained Mini Clock Output.
3. Debugging through debugWIRE may be disabled if the internal oscillator is used.
2. Getting Started
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:
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.
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.
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.
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.
3. Xplained Mini
Xplained Mini is an evaluation platform that provides a set of small boards with access to all
microcontroller I/Os. The platform consists of a series of low-pin-count Microcontroller (MCU) boards,
which are integrated with Atmel Studio to present relevant user guides, application notes, datasheets,
and example code. The platform also features a Virtual COM port for serial communication to a host PC.
Info: The virtual COM port in the mEDBG requires the terminal software to set the data
terminal ready (DTR) signal to enable the UART pins connected to the ATmega328P. If the DTR
signal is not enabled the UART pins on the mEDBG are kept in high-z (tri-state) rendering the
COM port unusable. The DTR signal is automatically set by some terminal software, but it may
have to be manually enabled in your terminal.
The mEDBG controls one status LED on the ATmega328P Xplained Mini. The table below shows how the
LED is controlled in different operation modes.
Table 3-1. mEDBG LED Control
The mEDBG CPU clock frequency depends on the selected voltage, see the table below.
Table 3-2. CPU Clock vs. Voltage
Info: The fuse filter prevents users from changing critical fuses using Atmel Studio; however, it
does not prevent users from setting fuses freely using the command line interface atprogram
bundled with Atmel Studio.
The Super User Fantastic Feature Enable Register allows the user to modify the behavior of the mEDBG.
Name: SUFFER
Offset: 0x0120
Reset: 0xFF
Property: N/A
Bit 7 6 5 4 3 2 1 0
EOF LOWP FUSE
Access R/W R/W R/W
Reset 1 1 1
Warning: Writing the FUSE bit to 0 enables modification of all fuses in the ATmega328P.
Setting wrong fuse settings may render the mEDBG not usable on the ATmega328P Xplained
Mini. As an example; if an invalid clock setting is set, a recovery may require an external
debugger.
VCC_P5V0
0R 0R
The input voltage select jumper (J300, 3-pin header footprint) can be soldered in to select between power
from the USB port or from the VIN pin on the Arduino power header footprint. By default, the selector is
bypassed with a 0Ω resistor (R300) to connect the USB voltage to the on-board 3.3V/150 mA regulator
and target voltage select header.
The target voltage select jumper (J301, 3-pin header footprint) can be soldered in to select between the
on-board 3.3V regulator or the voltage from the input voltage select jumper (J300). The selector is
bypassed with a 0Ω resistor (R301) to connect the kit input voltage to the ATmega328P and mEDBG.
Important: If the target voltage and input voltage select headers are soldered in and used with
a jumper, the bypass 0Ω resistors have to be removed to avoid contention.
Warning: The ATmega328P Xplained Mini connects VCC_TARGET to the Arduino SPI
connector, while all Arduino boards connect VCC_P5V0 to the same pin. The VCC_TARGET
may be either 3.3V or 5.0V depending on the configuration of the kit if the kit is configured for
3.3V operation. Connecting an Arduino shield may damage the board permanently. It is not
recommended to solder the SPI connector when using Arduino shields if not strictly necessary.
If the connector is required it is recommended to remove pin two from the SPI connector.
R209
100k
PB7
SKRAAKE010
3
4
SW200
1
2
C204
100n
GND
PB5
R200
1k
2
D200
LED_12
EL17-21UYC/A3
1
GND
4.5 mEDBG
The ATmega328P Xplained Mini board has an embedded debugger/programmer enabling debugging and
programming of the ATmega328P without any additional external equipment.
The SPI bus signals are available close to the header at row J and K, enabling easy connection to header
pin 15 to 18.
Using pin 11 to 20 enables connection of the 10-pin legacy header used on the RZ600 wireless modules
and the 10-pin Xplained sensor modules.
The general bus connections for an Xplained Pro Extension board are indicated in the table below.
Detailed wiring can be found in the selected extension board documentation.
Table 4-9. Extension Header Typical Signals
"nnnnrrssssssssss"
n = product identifier
r = revision
s = serial number
5.2 Revision 4
Revision 4 is the initial released revision, and there are no known issues.
Microchip provides online support via our web site at http://www.microchip.com/. This web site is used as
a means to make files and information easily available to customers. Accessible by using your favorite
Internet browser, the web site contains the following information:
• Product Support – Data sheets and errata, application notes and sample programs, design
resources, user’s guides and hardware support documents, latest software releases and archived
software
• General Technical Support – Frequently Asked Questions (FAQ), technical support requests,
online discussion groups, Microchip consultant program member listing
• Business of Microchip – Product selector and ordering guides, latest Microchip press releases,
listing of seminars and events, listings of Microchip sales offices, distributors and factory
representatives
Microchip’s customer notification service helps keep customers current on Microchip products.
Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata
related to a specified product family or development tool of interest.
To register, access the Microchip web site at http://www.microchip.com/. Under “Support”, click on
“Customer Change Notification” and follow the registration instructions.
Customer Support
Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the
market today, when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of
these methods, to our knowledge, require using the Microchip products in a manner outside the
operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is
engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
Legal Notice
Information contained in this publication regarding device applications and the like is provided only for
your convenience and may be superseded by updates. It is your responsibility to ensure that your
application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY
OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS
CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE.
Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life
support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend,
indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting
from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual
property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, AVR, AVR logo, AVR Freaks, BeaconThings,
BitCloud, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KeeLoq, KeeLoq logo,
Kleer, LANCheck, LINK MD, maXStylus, maXTouch, MediaLB, megaAVR, MOST, MOST logo, MPLAB,
OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip Designer, QTouch, RightTouch, SAM-BA,
SpyNIC, SST, SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other countries.
ClockWorks, The Embedded Control Solutions Company, EtherSynch, Hyper Speed Control, HyperLight
Load, IntelliMOS, mTouch, Precision Edge, and Quiet-Wire are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom,
chipKIT, chipKIT logo, CodeGuard, CryptoAuthentication, CryptoCompanion, CryptoController,
dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial
Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi, MiWi,
motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient
Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, QMatrix, RightTouch logo, REAL
ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total
Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are
trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of
Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
© 2017, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
ISO/TS 16949
Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer
fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California
® ®
and India. The Company’s quality system processes and procedures are for its PIC MCUs and dsPIC
®
DSCs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design and manufacture of development
systems is ISO 9001:2000 certified.