Atmel ATmega328P Xplained Mini User guide

USER GUIDE
ATmega328P Xplained Mini User Guide

Introduction

This user guide describes how to get started with the Atmel® ATmega328P Xplained Mini board.
The ATmega328P Xplained Mini evalutation kit is a hardware platform to evaluate the Atmel ATmega328P microcontroller. The evaluation kit comes with a fully integrated debugger that provides seamless integration with Atmel Studio 6.2 (and later version). The kit provides access to the features of the ATmega328P enabling easy integration of the device in a custom design.
42287A-MCU-05/2014

Table of Contents

Introduction .................................................................................... 1
1. Getting Started ........................................................................ 3
1.1. Features ..... ..... ............................ ..... ..... ..... ......................... 3
1.2. Design Documentation and Related Links ....................... ..... ..... . 3
1.3. Board Assembly ...... ..... ..... ............................ ..... ..... ..... ......... 3
1.3.1. In Customer Development Assembly ................... ..... ..... 3
1.3.2. Connecting an Arduino Shield ..... ..... ........................... 3
1.3.3. Standalone Node ........................ ..... ..... ..... ............... 3
1.4. Connecting the Kit ................. ..... ..... ..... ............................ ..... 3
1.4.1. Connect the Kit to Atmel Studio ... ............................ .... 3
1.4.2. Connect the Target UART to the mEBDG COM Port ......... 3
1.5. Programming and Debugging ... ..... ............................ ..... ..... .... 4
1.5.1. Programming the Target Using mEDBG . ..... ..... ..... ......... 4
1.5.2. Debugging the Target Using mEDBG ........ ..... ..... ..... ..... 4
1.5.3. Programming the Target Using an External
Programmer ....................... ..... ..... ............................ 5
1.5.4. Programming the ATmega32U4 Using an External
Programmer ....................... ..... ..... ............................ 5
1.5.5. Programming the ATmega32U4 Using a Bootloader ......... 6
1.5.6. How to Install the "Bootloader PC tool" ............ ..... ..... .... 6
1.6. Available Example Code ............. ..... ..... ..... ............................ . 7
2. Hardware User Guide ............................................................. 8
2.1. Board Overview ...... ..... ..... ..... ............................ ..... ..... ..... .... 8
2.2. Clock Distribution . ..... ..... ............................ ..... ..... ..... ............ 8
2.3. Headers and Connectors ..... ............................ ..... ..... ..... ........ 8
2.3.1. JTAG (J100) .. ..... ............................ ..... ..... ..... ........... 8
2.3.2. USB (J101) .......................... ..... ..... ..... ..................... 9
2.3.3. USART (J104) ................... ..... ..... ..... ........................ 9
2.3.4. Target Digital I/O (J200 and J201) ........................ ..... ... 9
2.3.5. Target Analogue I/O (J203) .. ............................ ..... .... 10
2.3.6. Power (J202, J300, J301) .. ..... ..... ............................ . 10
2.3.7. Target SPI (J204) .. ..... ............................ ..... ..... ..... .. 11
2.3.8. Additional Target Signals ... ..... ............................ ..... . 11
2.3.9. Extension headers .... ..... ..... ..... ............................ .... 12
2.4. Board GUI ... ..... ............................ ..... ..... ............................ 13
2.4.1. LEDs ..... ..... ..... ............................ ..... ..... ..... ........... 13
2.4.2. Button ..... ..... ............................ ..... ..... ..... .............. 13
2.5. Factory Programmed Data ........ ..... ..... ..... ............................ . 14
2.6. Errata ..... ..... ..... ............................ ..... ..... ..... ...................... 14
3. Document Revision History ................................................... 15
ATmega328P Xplained Mini User Guide [USER GUIDE]
42287A-MCU-05/2014
2

1. Getting Started

1.1 Features

The ATmega328P Xplained Mini evaluation board provides a development platform for the Atmel ATmega328P.

1.2 Design Documentation and Related Links

The most relevant documents and software for the evaluation board is available here:
http://www.atmel.com/tools/XplainedMini.aspx

1.3 Board Assembly

The Xplained Mini board is very flexible and can be used in a number of ways. E.g. as your own prototype for SW development and HW verification.

1.3.1 In Customer Development Assembly

The ATmega328P Xplained Mini board can be wired into the customer prototype assembly by using the on­board connector grid, where the target signals are available.

1.3.2 Connecting an Arduino Shield

By assembling receptacles in the marked positions (J200, J201, J202, and J203) Arduino® shields can be mounted.

1.3.3 Standalone Node

The ATmega328P Xplained Mini board can be used as a standalone node - use the 4xAAA or 2xAAA battery pack available in Atmel store to provide power.

1.4 Connecting the Kit

How to connect the evaluation board.

1.4.1 Connect the Kit to Atmel Studio

How to connect the ATmega328P Xplained Mini board to Atmel Studio.
1. Download and install Atmel Studio1 version 6.2 or later.
2. Launch Atmel Studio.
3. Connect the board to the USB port and it will be visible in Atmel Studio.

1.4.2 Connect the Target UART to the mEBDG COM Port

All Xplained Mini boards have an embedded debugger (mEBDG) with a number of features, among them a CDC/COM port which enables the user to connect the ATmega328P UART to the PC.
1. Connect the mEDBG USB to the PC.
2. Use the Device Manager to find the COM port number.
3. Default COM port settings are 9600baud N81. The COM port settings can be changed using the Device Manager.
1
http://www.atmel.com/tools/atmelstudio.aspx
ATmega328P Xplained Mini User Guide [USER GUIDE]
42287A-MCU-05/2014
3

1.5 Programming and Debugging

How to program and debug the Xplained Mini board.

1.5.1 Programming the Target Using mEDBG

Using the Embedded Debugger on the Xplained Mini board to program the ATmega328 via the SPI bus.
1. Connect the mEDBG USB to the PC.
2. Go to Atmel Studio: click Tools, select Device Programming, and select the connected mEDBG as Tool with Device = ATmega328P and Interface = ISP, click Apply. Note that if ISP programming fails it could be because debugWIRE is enabled. See debugging chapter on how to disable debugWIRE mode:
“Debugging the Target Using mEDBG” on page 4.
3. Select "Memories" and locate the source hex or elf file and click Program.
4. If the source contains fuse settings go to "Production file" and upload the elf file and program the fuses.
5. To set fuses manually click Fuses and select the setting.
Recommended fuse setting:
BOOTSZ = 1024W_1C00,
BOOTRST = [ ],
RSTDISBL = [ ],
DWEN = [ ],
SPIEN = [X],
WDTON = [ ],
EESAVE = [ ],
BODLEVEL = DISABLE,
CKDIV8 = [ ],
CKOUT = [ ],
SUT_CKSEL = EXTCLK_6CK_14CK_65MS
Important
If any other cpu clk than the external clk supplied by the mEDBG is used the debugWIRE is not guaranteed to work.
The mEDBG will prevent writing certain fuse combinations in order to protect your kit.

1.5.2 Debugging the Target Using mEDBG

Using the Embedded Debugger on the Xplained Mini board to debug the ATmega328P via debugWIRE.
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 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, debugging can start.
8. When exiting debug mode select "Disable debugWIRE and Close" in the Debug menu, this will disable the DWEN fuse.
ATmega328P Xplained Mini User Guide [USER GUIDE]
42287A-MCU-05/2014
4
Important
If any other cpu clk than the external clk supplied by the mEDBG is used the debugWIRE is not guaranteed to work.

1.5.3 Programming the Target Using an External Programmer

How to program the target ATmega328P using the AVR® JTAGICE mkII, JTAGICE3, or other Atmel Programmers.
1. Connect the External Programmer to the PC.
2. Connect the External Programme to the evaluation board ISP connector (J204) (Need the 6-pin 100mil adapter connected to the JTAGICE).
3. Go to Atmel Studio: Tools/Device Programming, and select the External Programmer connected as Tool, Select Device = ATmega328P, Interface = ISP and click Apply.
4. Select "Memories" and locate the source hex or elf file and click Program.
5. If the source contains fuse settings go to "Production file" and upload the elf file and program the fuses.
Recommended fuse setting:
BOOTSZ = 1024W_1C00,
BOOTRST = [ ],
RSTDISBL = [ ],
DWEN = [ ],
SPIEN = [X],
WDTON = [ ],
EESAVE = [ ],
BODLEVEL = DISABLE,
CKDIV8 = [ ],
CKOUT = [ ],
SUT_CKSEL = EXTCLK_6CK_14CK_65MS

1.5.4 Programming the ATmega32U4 Using an External Programmer

How to program the ATmega32U4 using the AVR® JTAGICE mkII, JTAGICE3, or other Atmel Programmers.
To restore the mEDBG FW use the /tools/mEDBG/mEDBG_fw.zip from the Studio installation.
1. Connect the External Programme to the PC.
2. Connect the External Programme to the board connector (J100).
3. Go to Atmel Studio: Tools/Device Programming, and select the External Programmer connected as Tool, select Device = ATmega32U4, Interface = JTAG and click Apply.
4. Select "Memories" and locate the source hex or elf file and click Program.
5. If the source contain fuse settings go to "Production file" and upload the elf file and program the fuses.
Recommended fuse setting:
BODLEVEL = DISABLE
HWBE = [X]
OCDEN = [ ]
JTAGEN = [X]
SPIEN = [X]
WDTON = [ ]
EESAVE = [X]
BOOTSZ = 2048W_3800
ATmega328P Xplained Mini User Guide [USER GUIDE]
42287A-MCU-05/2014
5
Loading...
+ 11 hidden pages