–Symbolic debug of complex data types including scope information
–Programming and debugging, including power measurements
–Data Gateway Interface: SPI, I2C, four GPIOs
–Virtual COM port (CDC)
•USB Powered
AN2653
Get the Tools
The ATmega4809 Xplained Pro user guide covers how to power the kit and the detailed information on
board components, extension interface, and the hardware guide.
•JTAG Programming of megaAVR, AVR XMEGA, and AVR UC3 Devices
•aWire Programming of AVR UC3 Devices
•ISP and JTAG Programming of AVR Devices in External Target Systems
•Flexible Routing and Socket Card System for Easy Mounting of all Supported Devices
•Eight Push Buttons for General Use
•Eight LEDs for General Use
•All AVR I/O Ports are Easily Accessible through Pin Header Connectors
•Expansion Connectors for Plug-In Modules and Prototyping Area
•On-Board 4Mb DataFlash for Non-volatile Data
•USB mini-AB (On-The-Go) Connector for AVR Devices with USB
•PHY and DSUB-9 Connector for RS-232 Interface
•PHY and DSUB-9 Connector for CAN Bus
•PHY and Header for LIN Bus
•Device Board with an ATmega2560 AVR Microcontroller Included
The STK600 User Guide describes how to power the kit, the detailed information on board components,
extension interface, and the hardware guide.
3.3 Get Source Code from Atmel | START
The example code is available through Atmel | START, which is a web-based tool that enables
configuration of application code through a Graphical User Interface (GUI). The code can be downloaded
for both Atmel Studio 7.0 and IAR Embedded Workbench® via the direct example code-link(s) below or
the BROWSE EXAMPLES button on the Atmel | START front page.
Atmel | START web page: http://microchip.com/start
Example Code
Finding example code for devices in the megaAVR 0-series, can be done by searching for the device
name, e.g. ATmega4809, in the Atmel | START example browser.
Press User guide in Atmel | START for details and information about example projects. The User guide
button can be found in the example browser, and by clicking the project name in the dashboard view
within the Atmel | START project configurator.
Atmel Studio
Download the code as an .atzip file for Atmel Studio from the example browser in Atmel | START, by
clicking DOWNLOAD SELECTED EXAMPLE. To download the file from within Atmel | START, click
EXPORT PROJECT followed by DOWNLOAD PACK.
Double-click the downloaded .atzip file and the project will be imported to Atmel Studio 7.0.
IAR Embedded Workbench
For information on how to import the project in IAR Embedded Workbench, open the Atmel | START user
guide, select Using Atmel Start Output in External Tools, and IAR Embedded Workbench. A link to the
Atmel | START user guide can be found by clicking About from the Atmel | START front page or Help AndSupport within the project configurator, both located in the upper right corner of the page.
Web page: http://www.microchip.com/development-tools/atmel-studio-7
Document/file:
•Atmel Studio 7.0 (build 1645) Installer (.exe)
Atmel Studio 7.0 or later is the preferred IDE for developing and debugging firmware for the megaAVR
0-series.
For device support, refer to Get Device Support.
3.5 Get IAR Embedded Workbench for AVR
Web page: https://www.iar.com/iar-embedded-workbench/#!?architecture=AVR
Document/file: IAR Embedded Workbench® installer for AVR.
3.6 Get Device Support
Atmel Studio: Support for new devices in Atmel Studio can be added by using the Device Pack
Manager, which is found under Tools->Device Pack Manager.
AN2653
Get the Tools
®
For megaAVR® 0-series, update to the latest version by performing the following steps:
1.Click Check for Updates
2.For megaAVR® 0-series, select the latest available version of ATmega_DFP
3.Click Install
For offline installers, go to http://packs.download.atmel.com/. To install a pack, double click on the
installer file and follow the instructions. Any open Atmel Studio windows will have to be closed for the
installation to take effect.
IAR: Support for new devices in IAR Embedded Workbench can be added by installing the latest service
pack. The service pack is available from My Pages on https://iar.com.
•The ATmega4809 Xplained Pro board connected to Atmel Studio 7.0 via the on-board USB
connector, which is connected to the embedded debugger. The kit will be powered by the USB, and
the embedded debugger will enable debugging and programming via the USB.
Workflow
1.Launch Atmel Studio 7.0.
2.The page shown in the figure below will appear when ATmega4809 Xplained Pro is connected to
Atmel Studio 7.0.
4.Select the GCC C Executable Project template from the new project wizard shown in the figure
below, type in the name of the solution and project (e.g. GETTING_STARTED and LED_TOGGLE),
and click OK.
Figure 4-3. New Project Wizard
5.Select ATmega4809 from the device selection wizard as shown in the figure below, and click OK.
9.Build the project by clicking Build → Build Solution or by using the shortcut F7.
10. Program ATmega4809 with the project code and start debugging by clicking Debug → Startdebugging and break or by using the shortcut ALT+F5. The application is programmed onto the
device and program execution should break in main.
11. Run the code by clicking Debug → Continue or by using the shortcut F5).
12. Verify that LED0 is lit when SW0 is pushed on the ATmega4809 Xplained Pro.
4.2 Atmel Studio with STK600
Prerequisites
•Atmel Studio 7.0 1645 or above installed
•The STK600 board connected to Atmel Studio 7.0 via the on-board USB connector.
Workflow
1.Launch Atmel Studio 7.0.
2.Start creating a new project by clicking New → Project... or by using the shortcut Ctrl+Shift+N, as
shown in the figure below.
3.Select the GCC C Executable Project template from the new project wizard shown in the figure
below, type in the name of the solution and project (e.g. GETTING_STARTED and LED_TOGGLE),
and click OK.
Figure 4-8. New Project Wizard
4.Select ATmega4809 from the device selection wizard as shown in the figure below, and click OK.
A new project with a main.c file associated with it will be generated in Atmel Studio.
5.Replace the main function in the main.c file with the following code snippet:
int main (void)
{
/* STK600 have eight User Buttons and eight User LEDs which can be connected to any IO
pin using cables */
/* Configure PB0 as input (remember to connect SW0 to PB0 using a cable */
PORTB.DIRCLR = PIN0_bm;
/* Configure PB1 as output (remember to connect LED0 to PB1 using a cable*/
PORTB.DIRSET = PIN1_bm;
while (1)
{
/* Check the status of SW0 */
/* 0: Pressed */
if (!(PORTB.IN & (PIN0_bm)))
{
/* LED0 on */
PORTB.OUTCLR = PIN1_bm;
}
/* 1: Released */
else
{
/* LED0 off */
PORTB.OUTSET = PIN1_bm;
}
}
}
In the code editor, the code should appear as shown in the figure below.
11. Load the code onto the STK600 and start debugging by clicking Debug → Start debugging and
break or by using the shortcut ALT+F5. The application is programmed onto the device and the
program execution should break in main.
12. Run the code by clicking Debug → Continue or by using the shortcut F5.
13. Verify that LED0 is lit when SW0 is pushed on STK600.
•Application notes: http://www.microchip.com/paramChartSearch/chart.aspx?branchID=30047, find
the preferred device and go to the product page. All relevant application notes can be found under
the documentation tab.
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
Customer Change Notification Service
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
Users of Microchip products can receive assistance through several channels:
•Distributor or Representative
•Local Sales Office
•Field Application Engineer (FAE)
•Technical Support
Customers should contact their distributor, representative or Field Application Engineer (FAE) for support.
Local sales offices are also available to help customers. A listing of sales offices and locations is included
in the back of this document.
Technical support is available through the web site at: http://www.microchip.com/support
Microchip Devices Code Protection Feature
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.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their
code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the
code protection features of our products. Attempts to break Microchip’s code protection feature may be a
violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software
or other copyrighted work, you may have a right to sue for relief under that Act.
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.
2018, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
ISBN: 978-1-5224-2693-6
Quality Management System Certified by DNV
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.