Creating and Simulate/Emulating an ASM Project in Atmel Introduction Procedure File New Project Assembler

Similar documents
Getting Started with STK200 Dragon

C Programming in Atmel Studio 7 Step by Step Tutorial

Intro to MS Visual C++ Debugging

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

6L00IA - Introduction to Synergy Software Package Short Version (SSP v1.2.0) Renesas Synergy Family - S7 Series

Debugging in AVR32 Studio

Pre-Lab: Part 1 Using The Development Environment. Purpose: Minimum Parts Required: References: Handouts:

Creating Postcards in Microsoft Publisher

Eclipse CDT Tutorial. Eclipse CDT Homepage: Tutorial written by: James D Aniello

Templates and Forms A Complete Overview for Connect Users

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

AVR Development Board

Now you have the basic hardware tools, its time to setup the software environment. The main softwares you will need are:

Writing Code and Programming Microcontrollers

DOING MORE WITH WORD: MICROSOFT OFFICE 2013

Development Tools. 8-Bit Development Tools. Development Tools. AVR Development Tools

Application Note: 200

PRELAB! Read the entire lab, and complete the prelab questions (Q1- Q3) on the answer sheet before coming to the laboratory.

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET

How to Create a Simple Animation Using MAYA

Expression Design Lab Exercises

Installing and using CW 10.6 for TPMS applications. Revision 4

Required Setup for 32-bit Applications

Geogebra Introductory Activity

Lab 3-2: Exploring the Heap

Create a unit using United Streaming and PowerPoint. Materials: Microsoft PowerPoint, Internet access, United Streaming account

Hands on Experience with AVR32

Dreamweaver Basics Workshop

Figure 1. Simplicity Studio

Customizing DAZ Studio

Register-Level Programming

Assembly Programming in Atmel Studio 7 Step by Step Tutorial

Using Visual Studio.NET: IntelliSense and Debugging

Section Objective: Acquaint with specifications of Launchpad Acquaint with location of switches, LEDs, power-on switch, powering the board.

Programming The Osmium MIMU22BT / MIMU22BTP With AVR Dragon

To start Kidspiration on a Macintosh: Open the Kidspiration 3 folder and double-click the Kidspiration icon.

Figure 1. JTAGAVRU1 application The JTAGAVRU1 is supported by AVR Studio. Updated versions of AVR Studio is found on

The NetBeans Debugger: A Brief Tutorial

Solar Campaign Google Guide. PART 1 Google Drive

New website Training:

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

Module 3: Working with C/C++

Weidmüller Configurator (WMC) User manual

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

TYPO3 Editing Guide Contents

Menu. >Debugging/Simulating in Atmel Studio >Downloading and Debugging/Emulating with the UF-board. Machine Codes 6811: $86 $0A GCPU: $02 $0A

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

Working with Questions in MathXL for School

Laboratory Assignment #3 Eclipse CDT

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

AVR Development Board

2. Tutorial ESC Programming myavr MK2 USB UFO Doctor, June 5 rd, 2010

University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering Revision 0 12-Jun-16

Quick Start Guide for the Turbo upsd DK3300-ELCD Development Kit- RIDE

DOING MORE WITH WORD: MICROSOFT OFFICE 2007

Flowcharts for Picaxe BASIC

SDKs - Eclipse. SENG 403, Tutorial 2

DKAN0011A Setting Up a Nios II System with SDRAM on the DE2

Materials for SOS Workshop No. 1 Getting more out of Microsoft Office Word

Exercise 1. Section 2. Working in Capture

BASICS OF THE RENESAS SYNERGY TM

SKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

PBWORKS - Student User Guide

Creating a template and printing from Geo

PowerPoint 2016 Building a Presentation

ATOLLIC TRUESTUDIO FOR STM32 QUICK START GUIDE

Getting Started With the CCPilot VI and QuiC

FINITE ELEMENT ANALYSIS OF A PLANAR TRUSS

DOING MORE WITH POWERPOINT: MICROSOFT OFFICE 2013

Install Visual Studio Community Version 2017

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

Minix Neo Z64A basics

Contents. How to use Magic Ink... p Creating Magic Revealers (with Magic Ink)... p Basic Containers... p. 7-11

Module 4: Working with MPI

Interactive Tourist Map

VG Series Products Mass Interconnect Technologies

Section 1 AVR Studio User Guide

MS Word Basic Word 2007 Concepts

Instruction: Download and Install R and RStudio

Using Eclipse Che IDE to develop your codebase. Red Hat Developers Documentation Team :54:11 UTC

BUSINESS SOURCE PREMIER DATABASE: How to Find it, Access it, and Use it

COMP2121 Experiment 4

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

External Headers. USB Host User LEDs. User Switches. E1 Header (Unfitted)

ET-BASE AVR ATmega64/128

KNJN I2C bus development boards

Using Eclipse Che IDE to develop your codebase. Red Hat Developers Documentation Team :15:48 UTC

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

Introduction to IntelliJ

Faber 6000/Faber 6000 Plus USB Driver Installation for Windows 7/10

Code::Blocks Student Manual

A Quick Tour GETTING STARTED WHAT S IN THIS CHAPTER?

ECE 103 In-Class Exercise L1 Guide

Using the Xcode Debugger

What s New in Cognos. Cognos Analytics Participant s Guide

None. MICROCONTROLLERS III

What is VMware View. IMPORTANT: Connecting from Off-Campus. Connecting to View Desktops. Downloading the Client

Board Of Education USB (#28850)

Installation and Maintenance

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 6: Quartus II Tutorial and Practice. Name: Date:

Transcription:

Page 1/9 Revision 0 Introduction The purpose of this document is to enable a student to quickly create a project under Atmel Studio, to simulate the program, and then to emulate the program. To complete this tutorial you will need one additional file, GPIO_Output.asm. Go to the last page of the document to learn variations using C. Note that when using C, you will need to do something special to work across a network. Procedure This tutorial assumes that you already have Atmel Studio installed and have set your workspace folder to a known location. 1. Open Atmel Studio 7 and create a new project File New Project. 2. Under Installed Templates choose an AVR Assembler Project 3. Give the project a name and browse to a desired location. For this tutorial we will call the project GPIO_Output. (Browse to the location that you want to save your project folder and then Name your project. I usually use the same project name as folder name.) Click OK. 4. Select the correct device and click OK. We are using the ATxmega128A1U.

Page 2/9 Revision 0 5. You should now see the following:

Page 3/9 Revision 0 6. Copy the code from the accompanying GPIO_Output.asm file on the website into the GPIO_Output.asm file. Build the project (which in Atmel is called a Build Solution) by going to Build Build Solution (or use function key F7). The output window at the bottom should say Build succeeded, as shown below. If you have an error or warning (or several of each), you can double-click on the error or wanting and your cursor will be immediately brought to the offending line. If you would like to add line numbers in the asm file editor (to find warning and errors yourself), go to Tools Options Text Editor All Languages and select Line Numbers under the Display heading.

Page 4/9 Revision 0 7. You are now ready to test your code in software (simulate) and on the board (emulate). First select the debugging tool that you will be using. To do this, click the No Tool item. When you put your mouse on the No Tool, item, the second figure below will appear. Under Selected debugger/programmer use the dropdown menu to select Simluator (not Atmel ICE). The No tool selected box in the first figure below should now display Simulator (as shown). The Simulator window should appear as below.

Page 5/9 Revision 0 8. Place a breakpoint in your.asm window on the first instruction by using your mouse to select a point to the far left of an instruction like below, i.e., ldi R16, BIT456. Breakpoints will automatically halt your program before executing the instruction at the breakpoint. A red dot will appear where you placed your breakpoint, as shown below. Select the green arrow at the top (see the red arrow in the above figure), or go to Debug Continue, or simply click F5 on the keyboard to start the simulation. The program should immediately stop execution at the breakpoint you placed. The window on the right should now display the Processor view instead of the Solution Explorer. 9. While debugging, you can view any of the processor s registers, I/O Ports, memory locations, etc. Since we will be using PORTD in this example, we will explore the I/O view of the debugger. Go to Debug Windows I/O View, as shown below for a different project. Also note the Processor Status View (above I/O View), which is shown in the window on the right. If you do not see Processor View, go to Debug Windows Processor Status.

Page 6/9 Revision 0 10. If you want the simulated speed to match the default speed of the actual upad board (and the speed when you emulate), select the value next to Frequency in the Processor window and change the 1.000 MHz to 2.000 MHz (or the oscillator frequency that you are using) for our ATxmega128A1U.

Page 7/9 Revision 0 11. Now in the I/O View window to the right, find and select I/O Port Configuration (PORTD). After selecting it, you will be able to view all of the registers associated with PORTD below. Step through the code you are debugging by hitting F11 on the keyboard. You may also step through by selecting Debug Step Into. As you step through the code, notice the changes that occur in the registers of PORTD. Notice the grey box that gives some info on DIRSET. Boxes like this appear when you hover your mouse over one of the register names.

Page 8/9 Revision 0 12. Now we will repeat steps 8-11, but the code will now be executing in hardware rather than the software simulator; this is called emulation instead of simulation. To stop debugging you click Debug Stop Debugging, or click on the blue square in the toolbar. 13. Make sure the Atmel ICE and PCB board are both connected to the computer with your two USB connectors and that the Atmel ICE connector is connected to J1 (next to the pushbutton at the top of the upad) For the ICE, use the cable with three female headers. Connect the header at the end of the cable that has 8-pins to the ICE (with the red wire adjacent to the notch under AVR). Connect the middle header, which also has eight pins, to the upad (with the red wire adjacent to the dot on the upad PCB). Click the box that now says Simulator and change the Selected debugger/programmer to the Atmel ICE. Also select the Interface to PDI (as shown below). Save the changes and verify that the debugging tool at the top right now says AVR Ice (as shown to the right) and not Simulator. Now you are ready to emulate with our upad board. 14. Repeat steps 8-11. The code will now be running (emulation) on the actually processor. You should see the LEDs at the top of your board (labeled D6, D7, D8, D9) reflect the changes you make to PORTD. These LEDs are connected to PORTD of your processor. More notes 15. In an assembly file, use Ctrl+space to bring up a list of assembly instructions. If you type a letter or two first, it will start at the instruction that starts with those letters. This is sometimes known as Intellisense, Autocomplete, Auto Competition.

Page 9/9 Revision 0 Special Considerations for using C in AtemelStudio Setting up a Network Drive for C AtmelStudio can not work accoss networks without using a network drive. Instructions on how to create a network drive depend on which version of Windows you are using. Windows 10: 16. Type Windows-E (i.e., hold down the windows key and then type E) to open and Windows Exporer 17. In Windows Explorer, select This PC 18. Select Computer Map network drive 19. Select a drive letter, e.g., Z: 20. Put the path to the folder that you want to use, e.g., \\mil.ufl.edu\tebow\3744\labs\ 21. Select Reconnect at sign-in 22. Select Finish Pre Windows 10: 23. Type Windows-E (i.e., hold down the windows key and then type E) to open and Windows Exporer 24. In Windows Explorer, select This PC 25. Select Map network drive 26. Select a drive letter, e.g., Z: 27. Put the path to the folder that you want to use, e.g., \\mil.ufl.edu\tebow\3744\labs\ 28. Select Reconnect at logon 29. Select Finish Procedure to Create, Simulate, and Emulate in C 30. Open Atmel Studio 7 and create a new project File New Project. 31. Under Installed Templates choose an AVR GCC C Executable Project 32. Find the path to the proper location. If necessary, put in the network drive (e.g., Z:) and then the folder name. Browse if necessary. 33. Everything else should work JUST AS IT DID in Assembly. The only limitation is the to step through your program, you will need to turn off optimization. Locate the device part number at the top right (look for the picture of the chip) of the Atmel Studio screen: ATxmega128A1U Toolchain AVR/GNU C Complier Optimization Optimization Level: None (-O0). Don t forget to optimization back on when you are finished debugging.