USER GUIDE. ATmega168 Xplained Mini User Guide. Introduction

Similar documents
USER GUIDE. ZigBit USB Stick User Guide. Introduction

USER GUIDE EDBG. Description

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

8-bit. Application Note. Microcontrollers. AVR282: USB Firmware Upgrade for AT90USB

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

AVR1922: Xplain Board Controller Firmware. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR115: Data Logging with Atmel File System on ATmega32U4. Microcontrollers. Application Note. 1 Introduction. Atmel

Atmel AVR ATxmega384C3 microcontroller OLED display with pixels resolution Analog sensors. Ambient light sensor Temperature sensor

Atmel AT32UC3A3256 microcontroller 64MBit SDRAM Analog input (to ADC) Temperature sensor RC filter

ET-BASE AVR ATmega64/128

AT88CK490 Evaluation Kit

Two mechanical buttons Two user LEDs Four expansion headers. Board controller with USB interface. One power LED and one status LED

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

QT1 Xplained Pro. Preface. Atmel QTouch USER GUIDE

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR270: USB Mouse Demonstration

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

CryptoAuth Xplained Pro

AVR1510: Xplain training - XMEGA USART. 8-bit Microcontrollers. Application Note. Prerequisites. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR272: USB CDC Demonstration UART to USB Bridge

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description

STK User Guide

APPLICATION NOTE. Atmel AT01095: Joystick Game Controller Reference Design. 8-/16-bit Atmel Microcontrollers. Features.

APPLICATION NOTE. AT16268: JD Smart Cloud Based Smart Plug Getting. Started Guide ATSAMW25. Introduction. Features

USER GUIDE. ZigBit Extension User Guide. Introduction

The Quadcopter Controller

APPLICATION NOTE. Atmel AT04389: Connecting SAMD20E to the AT86RF233 Transceiver. Atmel SAMD20. Description. Features

General Porting Considerations. Memory EEPROM XRAM

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

Application Note. 8-bit Microcontrollers. AVR293: USB Composite Device

Atmel AVR4921: ASF - USB Device Stack Differences between ASF V1 and V2. 8-bit Atmel Microcontrollers. Application Note. Features.

APPLICATION NOTE. Secure Personalization with Transport Key Authentication. ATSHA204A, ATECC108A, and ATECC508A. Introduction.

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

SAM D21 Xplained Pro. Preface. SMART ARM-based Microcontrollers USER GUIDE

Introducing AVR Dragon

AVR32701: AVR32AP7 USB Performance. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

APPLICATION NOTE. Atmel AT02985: User s Guide for USB-CAN Demo on SAM4E-EK. Atmel AVR 32-bit Microcontroller. Features. Description.

AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

RC2200DK Demonstration Kit User Manual

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

AVR106: C Functions for Reading and Writing to Flash Memory. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

AT13041: AVR for IoT - Using megaavr with ATWINC b/g/n Wi-Fi Network Controller Module. Description. megaavr Microcontrollers

APPLICATION NOTE. Atmel LF-RFID Kits Overview. Atmel LF-RFID Kit. LF-RFID Kit Introduction

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

AVR287: USB Host HID and Mass Storage Demonstration. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

SAM G55 Xplained Pro. Preface. SMART ARM-based Microcontrollers USER GUIDE

Atmel AVR4903: ASF - USB Device HID Mouse Application. Atmel Microcontrollers. Application Note. Features. 1 Introduction

Atmel AVR1017: XMEGA - USB Hardware Design Recommendations. 8-bit Atmel Microcontrollers. Application Note. Features.

Atmel AVR4920: ASF - USB Device Stack - Compliance and Performance Figures. Atmel Microcontrollers. Application Note. Features.

SAM D20 Xplained Pro. Preface. SMART ARM-based Microcontrollers USER GUIDE

SAM4L Xplained Pro. Preface. SMART ARM-based MCUs USER GUIDE

EvB 5.1 v5 User s Guide

APPLICATION NOTE. Atmel AVR600: STK600 Expansion, Routing and Socket Boards. Atmel Microcontrollers. Introduction

Atmel AVR1923: XMEGA-A3BU Xplained Hardware User Guide. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

AT91SAM ARM-based Flash MCU. Application Note

AT86RF230 (2450 MHz band) Radio Transceiver... User Guide

Atmel Power Line Communications. Solutions for the Smart Grid

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

Designing Feature-Rich User Interfaces for Home and Industrial Controllers

WIZ-Embedded WebServer User s Manual (Ver. 1.0)

The Atmel-ICE Debugger

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

Application Note. C51 Bootloaders. C51 General Information about Bootloader and In System Programming. Overview. Abreviations

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

Using CryptoMemory in Full I 2 C Compliant Mode. Using CryptoMemory in Full I 2 C Compliant Mode AT88SC0104CA AT88SC0204CA AT88SC0404CA AT88SC0808CA

AN3354 Application note

AT89C5131A Starter Kit... Software User Guide

Quick Start Guide. TWR-MECH Mechatronics Board TOWER SYSTEM

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Quick Start Guide. MRB-KW01 Development Platform Radio Utility Application Demo MODULAR REFERENCE BOARD

Spotlight Management Pack for SCOM

AC-PG-USBASP USBASP AVR Programmer

AN Boot mode jumper settings for LPC1800 and LPC4300. Document information

Introducing a platform to facilitate reliable and highly productive embedded developments

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

APPLICATION NOTE. Atmel AVR2033: SAM-ICE Adapter Hardware User Manual. 8-bit Atmel Microcontrollers. Features. Introduction

Software Prerequisites Linux Ubuntu LTS. Estimated completion time: 15min. The goal of this hands-on is to:

Spotlight Management Pack for SCOM

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

More Secure, Less Costly IoT Edge Node Security Provisioning

Application Note. Atmel ATSHA204 Authentication Modes. Prerequisites. Overview. Introduction

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

AN10866 LPC1700 secondary USB bootloader

Capacitive Touch Technology Opens the Door to a New Generation of Automotive User Interfaces

APPLICATION NOTE. AVR042: AVR Hardware Design Considerations. AVR 8-bit Microcontrollers. Features. Description

AVR1600: Using the XMEGA Quadrature Decoder. 8-bit Microcontrollers. Application Note. Features. 1 Introduction. Sensors

Quest vworkspace Virtual Desktop Extensions for Linux

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

USER GUIDE Programming Adapter Cable for Fujitsu Flash Microcontroller- F²MC-16LX/FR Family Fujitsu Microelectronics America, Inc.

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

AVR1318: Using the XMEGA built-in AES accelerator. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Table of Contents. Section 1 Introduction Section 2 Getting Started Section 3 Hardware Description

Dell One Identity Cloud Access Manager How to Configure vworkspace Integration

Transcription:

USER GUIDE ATmega168 Xplained Mini User Guide Introduction This user guide describes how to get started with the Atmel ATmega168 Xplained Mini board. The ATmega168 Xplained Mini evalutation kit is a hardware platform to evaluate the Atmel ATmega168 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 ATmega168 enabling easy integration of the device in a custom design

Table of Contents Introduction... 1 Getting Started..... 5. 6. Features... Design Documentation and Related Links... Board Assembly.... In Customer Development Assembly.... Connecting an Arduino Shield..... Standalone Node... Connecting the Kit.... Atmel Studio.... Connect the ATmega168 UART to the mebdg COM Port... Programming and Debugging... 5. Programming the Target Using medbg... 5. Debugging the Target Using medbg... 5.. Programming the Target Using an External Programmer... 5.. Programming the ATmega2U Using an External Programmer... 5.5. Bootloader... 5.6. How to Install the "Bootloader PC tool"... Available Example Code... 5 5 6 9 Hardware User Guide... 10.. 5. Board Overview... Clock Distribution... Headers and Connectors.... JTAG (J100).... USB (J101)..... USART (J102)..... ATmega168 Digital I/O (J200 and J201)....5. ATmega168 Analogue I/O (J20)....6. Power (J202)....7. ATmega168 ISP (J20)... Board GUI.... LEDs.... Button... Factory Programmed Data... 10 10 10 10 11 11 11 12 12 12 1 1 1 1. Document Revision History... 1 2

Getting Started 1 Features The ATmega168 Xplained Mini evaluation board provides a development platform for the Atmel ATmega168. 2 Design Documentation and Related Links 1 The most relevant documents and software for the evaluation board. 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 In Customer Development Assembly The ATmega168 Xplained Mini board can be wired into the customer prototype assembly by using the onboard connector grid, where most target signals are available..2 Connecting an Arduino Shield By assembling receptacles in the marked positions Arduino shields can be mounted.. Standalone Node The ATmega168 Xplained Mini board can be used as a standalone node - use the xaaa battery pack available in Atmel store to provide power. Connecting the Kit How to connect the evaluation board..1 Atmel Studio How to connect the ATmega168 Xplained Mini board assembly to Atmel Studio..2 2 Download and install Atmel Studio version 6.2 or newer. Launch Atmel Studio.. Connect the board to the USB port and it will be visible in Atmel Studio. Connect the ATmega168 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 ATmega168 UART to the PC. 5 Connect the medbg USB to the PC. Use the Device Manager to find the COM port number.. Default COM port settings are 9600baud N8 The COM port settings can be changed using the Device Manager. Programming and Debugging How to program and debug the Xplained Mini board. 5.1 Programming the Target Using medbg Using the Embedded Debugger on the Xplained Mini board to program the ATmeag168 via the SPI bus. 1 2 http://www.atmel.com/tools/xplainedmini.aspx http://www.atmel.com/tools/atmelstudio.aspx

Connect the medbg USB to the PC. Go to Atmel Studio: Tools/Device Programming, and select the connected medbg as Tool with Device = ATmega168PA 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.. Select "Memories" and locate the source hex or elf file and click Program.. 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 = 102W_1C00, BOOTRST = [ ], RSTDISBL = [ ], DWEN = [ ], SPIEN = [X], WDTON = [ ], EESAVE = [ ], BODLEVEL = DISABLE, CKDIV8 = [ ], CKOUT = [ ], SUT_CKSEL = EXTCLK_6CK_1CK_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. 5.2 Debugging the Target Using medbg Using the Embedded Debugger on the Xplained Mini board to debug the ATmega168 via debugwire. Start Atmel Studio. Connect the medbg USB to the PC.. Open your project.. 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 ATmega168 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. Important 5. If any other cpu clk than the external clk supplied by the medbg is used the debugwire is not guaranteed to work. Programming the Target Using an External Programmer How to program the target ATmega168 using the AVR JTAGICE mkii, JTAGICE, or other Atmel Programmers. Connect the External Programmer to the PC. Connect the External Programme to the evaluation board connector (J20) (Need the 6-pin 100mil adapter connected to the JTAGICE).. Go to Atmel Studio: Tools/Device Programming, and select the External Programmer connected as Tool, Select Device = ATmega168PA, Interface = ISP and click Apply.. 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 = 102W_1C00, BOOTRST = [ ], RSTDISBL = [ ], DWEN = [ ], SPIEN = [X], WDTON = [ ], EESAVE = [ ], BODLEVEL = DISABLE, CKDIV8 = [ ], CKOUT = [ ], SUT_CKSEL = EXTCLK_6CK_1CK_65MS 5. Programming the ATmega2U Using an External Programmer How to program the ATmega2U using the AVR JTAGICE mkii, JTAGICE, or other Atmel Programmers. To restore the medbg FW use the /tools/medbg/medbg_fw.zip from the Studio installation. Connect the External Programme to the PC. Connect the External Programme to the board connector (J100).. Go to Atmel Studio: Tools/Device Programming, and select the External Programme connected as Tool, select Device = ATmega2U, Interface = JTAG and click Apply.. 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 = V5 HWBE = [X] OCDEN = [ ] JTAGEN = [X] SPIEN = [X] WDTON = [ ] EESAVE = [X] BOOTSZ = 208W_800 BOOTRST = [ ] CKDIV8 = [ ] CKOUT = [X] SUT_CKSEL = EXTXOSC_8MHZ_XX_258CK_65MS Important 5.5 CKOUT must be enabled the provide clock to the target. Bootloader This section describes how to use the bootloader to program the ATmega2U. Install the Bootloader interface on the PC as described in How to Install the "Bootloader PC tool" on page 6. Start the Bootloader PC GUI "FLIP".. Short strap J10 Insert the USB stick in the PC.. Select Device = ATmega2U (Device - Select). 5. Select USB communication (Ctrl+U). 6. Select memory area to program (Use the toggle memory button bellow the Atmel logo). 7. Select Load Hex file (Ctrl+L). 8. Select Programming Options. 9. Click "Run", observe status in status field. 5

5.6 How to Install the "Bootloader PC tool" How to install the Bootloader PC GUI tool, Download the Flip "in system programming tool" installer from http://www.atmel.com/tools/flip.aspx. Run the Flip Installer. http://www.atmel.com/tools/flip.aspx 6

. Download the Atmel USB extension and run the installer.. Start Flip - if the USB stick is not recognized continue with step 5. 5. Update the USB DFU driver. 7

Clik the Update Driver button and select "Browse my computer-..." 8

6 Available Example Code The ATmega168 is preprogrammed with a demo program, ReMorse. Source code is available in Atmel Spaces. When the CDC COM port is connected to a terminal window, the text you write will be transmitted via the LED in Morse code. Any Morse code transmitted by using the switch will be displayed as text in the terminal window. http://spaces.atmel.com/gf/ 9

Hardware User Guide 1 Board Overview Figure 2- ATmega168XMINIoverview.png 2 Clock Distribution The ATmega2U (medbg) has an external 16MHz XTAL. The ATmega2U provides an external 16MHz clock to the ATmega168 (target). Headers and Connectors The board connectors..1 JTAG (J100) J100 is the JTAG programming header typically used by the JTAGICE for programming of the ATmega2U (medbg). Table 2- JTAG J100 pin Signal function 1 JTAG_TCK 10

.2 J100 pin Signal function 2 GND JTAG_TDO VCC (5V0) 5 JTAG_TMS 6 RESET 7 NC 8 NC 9 JTAG_TDI 10 GND USB (J101) J101 is a USB0 A PCB connector connecting the board to the PC. Table 2- USB. J101 pin Function 1 VBUS 2 D- D+ GND USART (J102) The ATmega2U UASRT signals are available on J10 Table 2-. J102 USART. J102 pin ATmega2U ATmega168 Function 1 - UART TXD PD PD1 TxD from ATmega2U 2 - UART RXD PD2 PD0 TxD from ATmega168 ATmega168 Digital I/O (J200 and J201) J200 and J201 provide access to ATmega168 digital I/O pins. Table 2-. J200 J200 pin & location ATmega168 pin J200-1/ I11 PB0 J200-2 PB1 J200- PB2 J200- PB J200-5 PB J200-6 PB5 J200-7 GND J200-8 AREF J200-9 PC J200-10 PC5 Table 2-5. J201 J201 pin ATmega168 pin J201-1 PD0 11

.5 J201 pin ATmega168 pin J201-2 PD1 J201- PD2 J201- PD J201-5 PD J201-6 PD5 J201-7 PD6 J201-8 PD7 ATmega168 Analogue I/O (J20) The ATmega168 analogue I/O pins are available in J20. Table 2-6. J200.6 J200 pin & location ATmega168 pin J200-1/ I11 PC0 J200-2 PC1 J200- PC2 J200- PC J200-5 PC J200-6 PC5 Power (J202) The ATmega168 VCC and RESET is available in J20 Table 2-7. J100 Xplained Pro Extension Header.7 J202 pin Description 1 NC. 2 ATmega168 Vcc RESET NC 5 ATmega168 Vcc. 6 GND 7 GND 8 ATmega168 Vcc ATmega168 ISP (J20) J20 enable direct connection to ISP for programming of the ATmega168 or to use the SPI bus to connect external equipment. Table 2-8. J20 J20 pin Function 1 MISO 2 VCC target (ATmega168) SCK MOSI 5 RESET 6 GND 12

Board GUI.1 LEDs There are one LED available for use by application SW and one for the medbg. Table 2-9. LEDs LED Function D100 - Green medbg, will light during enumeration. D200 - Yellow ATmega168 pin 17 - PB5, also connected to medbg SCK for ISP programming, in -state when not used...2 Button A button is available for general use by application SW. Table 2-10. Button 5 Button Function ATmega168 pin SW200 User defined high signal, press to ground (negate). 8 - PB7 Factory Programmed Data The ATmega168 Xplained Mini board comes with a demo program preprogrammed in the ATmega168 FLASH using the external clock provided by the ATmega2U. The ATmega2U is preprogrammed with the medbg. 1

. Document Revision History Document revision Date Comment 2250A 01/201 Initial document release 1

Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(08) 011 F: (+1)(08) 6.200 www.atmel.com 201 Atmel Corporation. All rights reserved. / Rev.: Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, AVR, and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN 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 the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.