background image

 

ATmega168PB Xplained Mini User Guide [USER GUIDE]

42381A-MCU-10/2014

5

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.3

Programming 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.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.

Summary of Contents for ATmega168PB Xplained Mini

Page 1: ...d 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...

Page 2: ...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 H...

Page 3: ...ositions J200 J201 J202 and J203 Arduino shields can be mounted 1 3 3 Standalone Node The ATmega168PB Xplained Mini board can be used as a standalone node use the 4xAAA or 2xAAA battery pack available...

Page 4: ...W_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 debugWI...

Page 5: ...ing a debugging session because the RESET line is actively used by the debugWIRE interface 1 5 3 Programming the Target Using an External Programmer How to program the target ATmega168PB using the AVR...

Page 6: ...Note CKOUT must be enabled the provide clock to the target 1 5 5 Programming the ATmega32U4 Using a Bootloader This section describes how to use the bootloader to program the ATmega32U4 1 Install the...

Page 7: ...6 Available Example Code The ATmega168PB is preprogrammed with a demo program ReMorse Source code is available in Atmel Spaces 3 When the CDC COM port is connected to a terminal window the text you wr...

Page 8: ...ATmega168PB Xplained Mini User Guide USER GUIDE 42381A MCU 10 2014 8 Any Morse code transmitted by using the switch will be displayed as text in the terminal window...

Page 9: ...n The ATmega32U4 mEDBG has an external 16MHz XTAL The ATmega32U4 provides an external 16MHz clock to the ATmega168PB target 2 3 Headers and Connectors The board headers and connectors 2 3 1 JTAG J100...

Page 10: ...ailable on J104 USART header The mEDBG CDC COM port is connected to these signals Table 2 3 J104 USART Header J104 pin ATmega32U4 ATmega168PB Function 1 UART TXD PD3 PD1 TxD from ATmega32U4 2 UART RXD...

Page 11: ...er system Table 2 7 J202 Power Header J202 pin Signal Description 1 NC 2 VCC_TARGET ATmega168PB supply voltage 3 RESET_SENSE RESET from external source monitored by the mEDBG if pulled low the target...

Page 12: ...Board Power Supply Selection J301 pin Signal Description 1 VCC_P5V0 Board external power source as selected by J300 by default connected to VCC_BOARD via R301 2 VCC_BOARD Power supply for ATmega32U4...

Page 13: ...can be found in the selected Extension board documentation Table 2 12 Xplained Pro Extension Header Pin Name Typical C signal Typical grid pin Extension signal description 1 ID NC Communication line t...

Page 14: ...of Serial peripheral interface 17 SPI_MISO PB4 MISO J6 to J5 5 Master in slave out line of Serial peripheral interface 18 SPI_SCK PB5 SCK J9 to J10 Clock for Serial peripheral interface 19 GND I6 to G...

Page 15: ...ATmega168PB pin SW200 User defined high signal press to ground negate 8 PB7 2 5 Factory Programmed Data The ATmega168PB Xplained Mini board comes with a demo program preprogrammed in the ATmega168PB F...

Page 16: ...ATmega168PB Xplained Mini User Guide USER GUIDE 42381A MCU 10 2014 16 3 Document Revision History Document revision Date Comment 42381A 10 2014 Initial document release...

Page 17: ...EN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves...

Reviews: