This user guide describes how to get started with the Atmel® ATmega168PB
Xplained Mini board.
The ATmega168PB Xplained Mini evaluation kit is a hardware platform to
evaluate the Atmel ATmega168PB 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
ATmega168PB enabling easy integration of the device in a custom design.
2.5.Factory Programmed Data ........ ..... ..... ..... ............................ . 15
3. Document Revision History ................................................... 16
ATmega168PB Xplained Mini User Guide [USER GUIDE]
42381A-MCU-10/2014
2
1.Getting Started
1.1Features
The ATmega168PB Xplained Mini evaluation board provides a development platform for the Atmel
ATmega168PB.
1.2Design Documentation and Related Links
The most relevant documents and software for the evaluation board is available here:
http://www.atmel.com/tools/MEGA168PB-XMINI.aspx
1.3Board 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.1In Customer Development Assembly
The ATmega168PB Xplained Mini board can be wired into the customer prototype assembly by using the onboard connector grid, where the target signals are available.
1.3.2Connecting an Arduino Shield
By assembling receptacles in the marked positions (J200, J201, J202, and J203) Arduino® shields can be
mounted.
1.3.3Standalone Node
The ATmega168PB 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.4Connecting the Kit
How to connect the evaluation board.
1.4.1Connect the Kit to Atmel Studio
How to connect the ATmega168PB 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.2Connect 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 ATmega168PB 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
ATmega168PB Xplained Mini User Guide [USER GUIDE]
42381A-MCU-10/2014
3
1.5Programming and Debugging
How to program and debug the Xplained Mini board.
1.5.1Programming 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 = ATmega168PB 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
Note
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.
Trying to change CKDIV8 and/or SUT_CKSEL will be prevented and an Error message will
be displayed ("One or more registers differs").
To be able to set fuses freely the ATmega32U4 EEPROM has to be programmed to 0x00
from address 0x200 to 0x214.
Note
If not exiting debug mode 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 SPI.
1.5.2Debugging the Target Using mEDBG
Using the Embedded Debugger on the Xplained Mini board to debug the ATmega168PB 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.
ATmega168PB Xplained Mini User Guide [USER GUIDE]
42381A-MCU-10/2014
4
5. In the Debug menu click Start Debugging and Break.
6. Atmel Studio will display an error message if the DWEN fuse in the ATmega168PB 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.
Note
If not exiting debug mode 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 SPI.
Note
If any other cpu clk than the external clk supplied by the mEDBG is used the debugWIRE is not
guaranteed to work.
Note
Applying a signal to J202/RESET (the RESET_SENSE signal) while debugging may result in
unexpected behaviour. This signal is NOT available during a debugging session because the
RESET line is actively used by the debugWIRE interface.
1.5.3Programming the Target Using an External Programmer
How to program the target ATmega168PB 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 = ATmega168PB, 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.4Programming 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.
ATmega168PB Xplained Mini User Guide [USER GUIDE]
42381A-MCU-10/2014
5
1. Connect the External Programmer to the PC.
2. Connect the External Programmer 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
BOOTRST = [ ]
CKDIV8 = [ ]
CKOUT = [X]
SUT_CKSEL = EXTXOSC_8MHZ_XX_258CK_65MS
Note
CKOUT must be enabled the provide clock to the target.
1.5.5Programming the ATmega32U4 Using a Bootloader
This section describes how to use the bootloader to program the ATmega32U4.
1. Install the Bootloader interface on the PC as described in “How to Install the "Bootloader PC
tool"” on page 6.
2. Start the Bootloader PC GUI "FLIP".
3. Short strap J102.
4. Connect the board USB connector to the PC.
5. Select Device = ATmega32U4 (Device - Select).
6. Select USB communication (Ctrl+U).
7. Select memory area to program (Use the toggle memory button bellow the Atmel logo).
8. Select Load Hex file (Ctrl+L).
9. Select Programming Options.
10. Click "Run", observe status in status field.
1.5.6How to Install the "Bootloader PC tool"
How to install the Bootloader PC GUI tool.
2
http://www.atmel.com/tools/FLIP.aspx
1. Download the FLIP "in system programming tool" installer from http://www.atmel.com/tools/FLIP.aspx2.
ATmega168PB Xplained Mini User Guide [USER GUIDE]
42381A-MCU-10/2014
6
Loading...
+ 11 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.