ECE372 CodeWarrior Simulator Andreou/Michaelides

Size: px
Start display at page:

Download "ECE372 CodeWarrior Simulator Andreou/Michaelides"

Transcription

1 CodeWarrior simulator demo The code can be written in C language (higher level) as well as in Assembly language (lower level). General C commands are applied across microcontroller families as opposed to assembly commands, which are family specific. Assembly commands may vary within a microcontroller family as well depending upon the functionality being provided by that microcontroller. To see the code written in C, double-click on demo.mcp or open it with CodeWarrior. From the Folder tree on the left double click on main.c which can be found under the Sources folder. The following code should be displayed: /********************************************/ /* The following code demonstrates the use of the */ /* pushbuttons located on Port AD bits 0 & 1. */ /* Pressing the Bit 1 button will increase the counter */ /* number by one. Pressing the Bit 0 button will */ /* decrease the counter by one. Then the counter */ /* number will be displayed by a 7-segment display */ /* */ /* Code writen by : Min kyu Song */ /* Oct 2005 */ /********************************************/ #include <hidef.h> /* common defines and macros */ #include <mc9s12c32.h> /* derivative information */ #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12c32" void Delay(int j) {.. } //Base Delay /** Display integer number on a 7-segment display **/ /** Port T is used as the output ports for this.*/ void segment_display( int i) {.. } void main(void) { int counter = 0; ATDDIEN = 0x03; //Set Pin0 & Pin1 as Digital 1

2 .. } DDRAD = 0xFC; DDRT = 0xFF; //Set Pin0 & Pin1 as Input //Set PORTT as Output For the Assembly program, open assembly_demo.mcp using CodeWarrior. The folder tree on the left contains three important files, starting with the Readme file where details about the project are summarized or important directions are given for the reader. The file containing the code is called main.asm (under Sources), and is appropriately indented and commented to show the program organization, so it is easier to understand. ; DIRECTIVES XDEF Entry ABSENTRY Entry INCLUDE 'mc9s12c32.inc' ROMStart EQU $4000 ORG ROMStart ; Export symbols, program execution begins at the label 'Entry' ; I/O Device Mapping ; Absolute address to place code/constant data ; Set start of program in ROM ; INITIALIZATION PORTION Entry: ; Program execution begins at label Entry clrb ; Sets Register B contents as 0 ldaa #$FF staa DDRT ; Sets Port T for Outputs to the 7 segment ldaa #$01 staa DDRS ; Sets bit 0 of Port S as an Output ldaa #$01 ; to select the 7 segment display The part of the code shown above demonstrates good program organization and indentation, as opposed to haphazard code. Main: ldaa PTAD cmpa #$01 beq Subrout bra Main ; Inputs from Port AD (push button) ; Checks if the push button has been pressed ; If it has been pressed, branches to Subrout ; to output the digit at Port T ; If not pressed, goes back and checks again, ; keeps repeating until pressed. Through comments, it is important to show why something is being done besides stating what is being done, for understandability and reusability of code. 2

3 The third important file in the folder tree is the mc9s12c32.inc file (under Libraries), which has the I/O map for the microcontroller. This is an essential file for program development as it gives a quick reference to the addresses where the ports have been mapped (it can be searched using the ctrl + F shortcut). To enter the debugging mode and run the simulator you can simply hit F5 or select Debug from the Project menu on top. This should open a new window that looks like this: Here you can see 8 windows Source, Procedure, Data:1, Data:2, Assembly, Register, Memory and Command. A detailed explanation of each window is given below. Source Here you can see the C code that currently is loaded into the simulator. The current line of code that it is executed is highlighted Procedure This shows the current procedure the simulator is executing. 3

4 Data:1,2 Data segment where you can select which variables to show. The scope of each window can be changed to Global, Local and User. Assembly Here you can see the assembly version of the C code and the address of each assembly instruction. The current assembly instruction that is executed is highlighted. Register Shows the contents of the CPU registers, indexes, program counter, stack pointer and condition register. Memory Here you can find all the memory locations within the microprocessor (Ram & Flash). Command Shows the status of the debugger and simulator and also commands can be typed here. Type Help in that window for more information. On the top you will notice the following controls Start/Continue simulation Step Out Of Stop Execution Single C step Assembly Step Reset Target Step Over 4

5 With these controls you can run the debugger and simulator step by step to see if everything is working correctly. Also at the bottom you can see the following information Internal bus frequency Selected microcontroller Current execution time Debugger/Simulator Status By left-clicking on the internal bus frequency a window will pop up from which you can change the oscillator frequency, display execution time in milliseconds or CPU cycles. Clicking on the Current execution time will reset it. This can be useful when we want to measure the time or clock cycles it takes to execute a part or all of the code. Running the simulator/debugger To begin click on the single step. You will see that the source window will change and display the initialization code for the microprocessor. Continue clicking on single step until you return to your code. Once you can see your code you will notice that the DATA:1 window will have the following You can expand these variables by clicking on the + next to each. Above you can see the contents of PTT (i.e Port T). The line of code that will be executed in our example will be 5

6 DDRT = 0xFF; By performing a single step you will be able to see that DDRT will now get the value of 0xFF. Remember to expand DDRT in the Data:1 window to see this. The next instruction executed is PTT = 0xFF; Again you can see that this command is executed correctly by looking at the contents of PTT. On the following step the Delay() subroutine is called. The delay creates a loop that is repeated times, of course this will take too long to end so by clicking Step Out Of the simulator will exit the loop and wait for the next step. This can be useful when we want to check whether there isn t an unintentional infinite loop in our code. Repeating the above procedure the normal operation of the rest of the code can be verified and in case of any errors these can be corrected. Using breakpoints Breakpoints can be useful when we want to execute up to a certain instruction and halt the execution of the code. To set a breakpoint simply right-click on the instruction you wish to set the breakpoint and select Set 6

7 Breakpoint. You will see a red arrow on the instruction which indicates that there is an active breakpoint there. The red arrow can also be seen in the Assembly window. To remove a breakpoint right-click on the red arrow and select Delete Breakpoint. Alternatively you can disable temporarily the breakpoint and enable it at a later time by right clicking on the arrow and selecting Disable Breakpoint Set the breakpoint at the second call of the Delay() subroutine, Reset the simulator by clicking on the Reset button and then click on the Start/continue button. You will notice that the code execution will halt right on the breakpoint. 7

8 The same effect as above can be achieved by right clicking on the second Delay() call and selecting Run to Cursor. However breakpoints are more efficient when we need to halt program execution repeatedly. You can have more than one breakpoints at a time. Measuring execution time Unlike assembly it s difficult to measure execution time for C based programs. The simulator has features that allow accurate measurement of execution time for both C and assembly based programs. The execution time can be measured in milliseconds or clock cycles. Assume that we want to know what is the actual delay of the Delay() subroutine. In order to do this we can use breakpoints and the execution time which was described earlier. Set two breakpoints one on the first Delay() call and the other on the instruction following the call. It should look like this: Now click on the Start/continue button and the program execution will halt on the Delay() line. Before continuing we need to reset the execution counter on the bottom of the screen. Double click the counter to reset it. Now by clicking on the Start/continue button again the execution will halt on the next line. The execution counter now shows the time needed to run the Delay() subroutine once. For this example execution time is cycles or mS. It was explained previously how to change the execution time to display cycles or ms. Adding Components The CodeWarrior debugging environment allows you to simulate many components like LEDs, pushbuttons, LCD and 7-segment display. In order to insert such components first you need to run the simulator/debugger. From the developing environment simply hit F5 or Project Debug as explained before. The from the Component menu select Open. 8

9 The following window will pop-up This is a list of the components the demo version of CodeWarrior has to offer. For the example code loaded we can simulate Push Buttons and 7- segment display or LEDs. To insert them select Push_buttons, Segment_display and lo_led component from the list and click OK. The components should now appear in the debugging environment. Before using this component you need to set it up so that it will be connected to the port you want to use. Right-click on the LED component and select Setup. You will get this window 9

10 Here you have to provide the address for the port in hexadecimal notation and also the address for the Data Direction Register(DDR) for the port you will be using. To find the address for a given port look in the Family Data Sheet (one of the two documents you download in Homework 1) in Table 1-1 PIM (port integration module) and chapter 2 Figure 2.2. The base address for the port integration module is 240 hex. The offset for PORT T data register is 0x0000. Therefore PORT T is at 240 hex. The Data Direction Register (DDR) for PORT T is at offset 0x base of module which is at 242 hex. Now if you run the example program we used before you will se that the LED will turn ON and OFF. You can save your settings for the current project in debugging mode so you don t have to add the components each time you compile your code. Other settings for Segment_display and Push button are shown below. Push_buttons Segment_display For more information on how to use the other components you can look in the CodeWarrior help file. Updated: 9/14/2006, UU 10

ECE 3120 Fall 2013 Lab 1 Code Entry, Assembly, and Execution

ECE 3120 Fall 2013 Lab 1 Code Entry, Assembly, and Execution ASSEMBLY PROGRAMMING WITH CODE WARRIOR The purpose of this lab is to introduce you to the layout and structure of assembly language programs and their format, as well as to the use of the Code Warrior

More information

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff CodeWarrior 1 Assembler An assembler is a program that translates assembly language into machine code. Machine code are the numbers that the CPU recognizes as instructions. $B6 $10 $00 Assembly language

More information

CS/ECE 5780/6780: Embedded System Design

CS/ECE 5780/6780: Embedded System Design CS/ECE 5780/6780: Embedded System Design John Regehr Lecture 2: 68HC12 Architecture & Lab 1 Introduction Duff s Device void foo (int x, int *y, int *z) { switch (x % 8) { case 0: do { *y++ = *z++; case

More information

Quick Guide to Using Code Warrior

Quick Guide to Using Code Warrior Quick Guide to Using Code Warrior So now that you have created a project, you are going to want to write an assembly program and assemble (compile) it. When you create a project a new panel appears on

More information

Metrowerks CodeWarrior IDE 5.5 Tutorial

Metrowerks CodeWarrior IDE 5.5 Tutorial Eric T. Hosey ECE480 Design Team 5 November 13, 2009 For Whirlpool Corporation Application Note Metrowerks CodeWarrior IDE 5.5 Tutorial Executive Summary This application note will introduce new users

More information

ECE 3120 Lab 1 Code Entry, Assembly, and Execution

ECE 3120 Lab 1 Code Entry, Assembly, and Execution ASSEMBLY PROGRAMMING WITH CODE WARRIOR The purpose of this lab is to introduce you to the layout and structure of assembly language programs and their format, as well as to the use of the Code Warrior

More information

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram History of the Microprocessor ECE/CS 5780/6780: Embedded System Design Chris J. Myers Lecture 1: 68HC12 In 1968, Bob Noyce and Gordon Moore left Fairchild Semiconductor and formed Integrated Electronics

More information

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1 Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University What is Assembly Language? Assembly language is a programming language

More information

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE EE319 K Lecture 3 Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator University of Texas ECE Introduction (von Neumann architecture) processor Bus Memory Mapped I/O System Input Devices

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (October 4, 2017) 1/18 538 Lecture Notes Week 5 Announements Midterm: Tuesday, October 25 Answers to last week's questions 1. With the diagram shown for a port (single bit), what

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (Sept. 30, 2013) 1/15 538 Lecture Notes Week 5 Answers to last week's questions 1. With the diagram shown for a port (single bit), what happens if the Direction Register is read?

More information

ME 4447/ME Microprocessor Control of Manufacturing Systems/ Introduction to Mechatronics. Instructor: Professor Charles Ume

ME 4447/ME Microprocessor Control of Manufacturing Systems/ Introduction to Mechatronics. Instructor: Professor Charles Ume ME 4447/ME 6405 Microprocessor Control of Manufacturing Systems/ Introduction to Mechatronics Instructor: Professor Charles Ume Lecture on Codewarrior Integrated Development Environment Contents Overview

More information

Mark II Aiken Relay Calculator

Mark II Aiken Relay Calculator Introduction to Embedded Microcomputer Systems Lecture 6.1 Mark II Aiken Relay Calculator 2.12. Tutorial 2. Arithmetic and logical operations format descriptions examples h 8-bit unsigned hexadecimal $00

More information

Changing the Embedded World TM. Module 3: Getting Started Debugging

Changing the Embedded World TM. Module 3: Getting Started Debugging Changing the Embedded World TM Module 3: Getting Started Debugging Module Objectives: Section 1: Introduce Debugging Techniques Section 2: PSoC In-Circuit Emulator (ICE) Section 3: Hands on Debugging a

More information

; export symbols ; export 'Entry' symbol. ; include derivative specific macros PORTA EQU $0000 PORTB EQU $0001 DDRA EQU $0002 DDRB EQU $0003

; export symbols ; export 'Entry' symbol. ; include derivative specific macros PORTA EQU $0000 PORTB EQU $0001 DDRA EQU $0002 DDRB EQU $0003 ******************************************************* * This program for CSE472, Flash Memory Writing * * By Kyusun Choi, ID=0000 * * Date: 11/14/2009 * * Freescale CodeWarrior, for the MC9S12C32 Program

More information

NEW CEIBO DEBUGGER. Menus and Commands

NEW CEIBO DEBUGGER. Menus and Commands NEW CEIBO DEBUGGER Menus and Commands Ceibo Debugger Menus and Commands D.1. Introduction CEIBO DEBUGGER is the latest software available from Ceibo and can be used with most of Ceibo emulators. You will

More information

Coe538 Final Study Guide 2016 (Questions & Answers)

Coe538 Final Study Guide 2016 (Questions & Answers) Coe538 Study Guide 1 of 8 Coe538 Final Study Guide 2016 (Questions & Answers) This version contains questions AND answers. This study guide is meant to help you review coe538 and prepare for the final.

More information

Getting Started with the HCS12 IDE

Getting Started with the HCS12 IDE Getting Started with the HCS12 IDE B. Ackland June 2015 This document provides basic instructions for installing and using the MiniIDE Integrated Development Environment and the Java based HCS12 simulator.

More information

538 Lecture Notes Week 1

538 Lecture Notes Week 1 538 Clowes Lecture Notes Week 1 (Sept. 6, 2017) 1/10 538 Lecture Notes Week 1 Announcements No labs this week. Labs begin the week of September 11, 2017. My email: kclowes@ryerson.ca Counselling hours:

More information

Lab 1 MC9S12 Assembler and Monitor

Lab 1 MC9S12 Assembler and Monitor Lab 1 MC9S12 Assembler and Monitor Introduction and Objectives The purpose of this lab is to help you become familiar with your Dragon12-Plus Evaluation Board (EVB), and some of the software tools which

More information

C programming for embedded microcontroller systems.

C programming for embedded microcontroller systems. C programming for embedded microcontroller systems. Assumes experience with assembly language programming. Outline Program organization and microcontroller memory Data types, constants, variables Microcontroller

More information

Lab 1 MC9S12 Assembler and Monitor

Lab 1 MC9S12 Assembler and Monitor Lab 1 MC9S12 Assembler and Monitor Introduction and Objectives The purpose of this lab is to help you become familiar with your Dragon12-Plus Evaluation Board (EVB), and some of the software tools which

More information

Assignment 1 Board Configuration, Compiling, Debugging, and Executable Files CSE 325, Fall 2010

Assignment 1 Board Configuration, Compiling, Debugging, and Executable Files CSE 325, Fall 2010 Assignment 1 Board Configuration, Compiling, Debugging, and Executable Files CSE 325, Fall 2010 Assignment Objectives 1. To learn how to configure the M5211DEMO board for downloading and running code.

More information

Fredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт.

Fredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт. SECOND шт. Assembly and С Programming forthefreescalehcs12 Microcontroller Fredrick M. Cady Department of Electrical and Computer Engineering Montana State University New York Oxford Oxford University

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Chapter 2 Microcontrollers Objectives Describe the difference between source code and machine code. Define opcode, operand, and address of an operand. Explain the purpose of

More information

EE475 Lab #3 Fall Memory Placement and Interrupts

EE475 Lab #3 Fall Memory Placement and Interrupts EE475 Lab #3 Fall 2005 Memory Placement and Interrupts In this lab you will investigate the way in which the CodeWarrior compiler and linker interact to place your compiled code and data in the memory

More information

It translates (converts) assembly language to machine code.

It translates (converts) assembly language to machine code. Assemblers 1 It translates (converts) assembly language to machine code. Example: LDAA $0180 Uses an instruction set manual: Tests/Final Exam. B6 01 80 Use software: Like the IDE in the Lab. 2 Assembler:

More information

An Introduction to Komodo

An Introduction to Komodo An Introduction to Komodo The Komodo debugger and simulator is the low-level debugger used in the Digital Systems Laboratory. Like all debuggers, Komodo allows you to run your programs under controlled

More information

Computer Organization I. Lecture 28: Architecture of M68HC11

Computer Organization I. Lecture 28: Architecture of M68HC11 Computer Organization I Lecture 28: Architecture of M68HC11 Overview Architecture of HC11 Microprocessor Format of HC11 Assembly Code Objectives To understand the simplified architecture of HC11 To know

More information

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7 ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume LECTURE 7 Reading Assignments Reading assignments for this week and next

More information

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

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission. INTRODUCTION This manual will guide you through the first steps of getting the SE-8051ICD running with the Crossware 8051 Development Suite and the Atmel Flexible In-System Programming system (FLIP). The

More information

ECE 367 -Experiment #1 Fall 2012

ECE 367 -Experiment #1 Fall 2012 Due at the beginning of lab during week 3 (9/1/2012) Introduction ECE 367 -Experiment #1 Fall 2012 The goal of this experiment is the acquaint you with the Technological Arts nanocore12 microcontroller

More information

Project Debugging with MDK-ARM

Project Debugging with MDK-ARM Project Debugging with MDK-ARM Notes: This document assumes MDK-ARM Version 5.xx (µvision5 ) is installed with the required ST-Link USB driver, device family pack (STM32F4xx for STM32F4-Discovery board;

More information

Lecture #4 Microcontroller Instruction Set Embedded System Engineering Philip Koopman Monday, 25-Jan-2016

Lecture #4 Microcontroller Instruction Set Embedded System Engineering Philip Koopman Monday, 25-Jan-2016 Lecture #4 Microcontroller Instruction Set 2 18-348 Embedded System Engineering Philip Koopman Monday, 25-Jan-2016 Electrical& Computer ENGINEERING Copyright 2006-2016, Philip Koopman, All Rights Reserved

More information

EUROScope lite 16FX Reference Manual

EUROScope lite 16FX Reference Manual lite 16FX Reference Manual June 2007 EUROS Embedded Systems GmbH Campestraße 12 D-90419 Nuremberg Germany Fon: +49-911-300328-0 Fax: +49-911-300328-9 Web: www.euros-embedded.com email: support@euros-embedded.com

More information

The board contains the connector for SWD bus to implement SWD method of programming. Fig. K190 VDD 2 GND 4

The board contains the connector for SWD bus to implement SWD method of programming. Fig. K190 VDD 2 GND 4 3. Programming Once the machine code containing the user program is prepared on a personal computer, the user must load the code into the memory of the processor. Several methods for loading are available.

More information

; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for assembly entry point

; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for assembly entry point **************************************************************** * This program for CMPEN 472, Flash Memory Writing * * By Kyusun Choi, ID=0000 * * Date: 11/15/2017 * * Freescale CodeWarrior, for the HCS12C128

More information

Programming in the MAXQ environment

Programming in the MAXQ environment AVAILABLE The in-circuit debugging and program-loading features of the MAXQ2000 microcontroller combine with IAR s Embedded Workbench development environment to provide C or assembly-level application

More information

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud. Chapter 1 Microprocessor architecture ECE 3130 Dr. Mohamed Mahmoud The slides are copyright protected. It is not permissible to use them without a permission from Dr Mahmoud http://www.cae.tntech.edu/~mmahmoud/

More information

ME 4447/6405 Introduction to Mechatronics Instructor: Professor Charles Ume

ME 4447/6405 Introduction to Mechatronics Instructor: Professor Charles Ume ME 4447/6405 Introduction to Mechatronics Instructor: Professor Charles Ume Lecture on Codewarrior Integrated Development Environment Contents Overview of C Compliers for HCS12 CodeWarrior Pointers Interrupts

More information

Using and Installing: HCS12C128 Board, USB-to-Serial port driver, and HyperTerminal

Using and Installing: HCS12C128 Board, USB-to-Serial port driver, and HyperTerminal Using and Installing: HCS12C128 Board, USB-to-Serial port driver, and HyperTerminal CMPEN 472, Kyusun Choi Summary: Install the USB-to-Serial port driver. This should be done automatically when you plug-in

More information

Chapter 1. Solutions Solution 1.1. Most RAMs are volatile, meaning the information is lost if power is removed then restored.

Chapter 1. Solutions Solution 1.1. Most RAMs are volatile, meaning the information is lost if power is removed then restored. Chapter 1. Solutions Solution 1.1. Most RAMs are volatile, meaning the information is lost if power is removed then restored. Solution 1.2. The bus signals of the MC9S12C32 are AD15-0, R/W, LSTRB and E.

More information

Section 1 AVR Studio User Guide

Section 1 AVR Studio User Guide Section 1 AVR Studio User Guide 1.1 Introduction Welcome to AVR Studio from Atmel Corporation. AVR Studio is a Development Tool for the AVR family of microcontrollers. This manual describes the how to

More information

Introduction to the 9S12 Microcontroller

Introduction to the 9S12 Microcontroller Introduction to the 9S12 Microcontroller o Harvard architecture and Princeton architecture o Memory map for a Princeton architecture microprocessor o 68HC12 Address Space o 68HC12 ALU o 68HC12 Programming

More information

LAB #1: The CSM12C32 Module and PBMCUSLK Project Board

LAB #1: The CSM12C32 Module and PBMCUSLK Project Board CS/EE 5780/6780 Handout #1 Spring 2007 Myers LAB #1: The CSM12C32 Module and PBMCUSLK Project Board Lab writeup is due to your TA at the beginning of your next scheduled lab. Don t put this off to the

More information

Go Gators! Relax! May the Schwartz be with you!

Go Gators! Relax! May the Schwartz be with you! Page 1/12 Exam 1 Instructions: Turn off cell phones beepers and other noise making devices. Show all work on the front of the test papers. If you need more room make a clearly indicated note on the front

More information

COMP2121 Introductory Experiment

COMP2121 Introductory Experiment COMP2121 Introductory Experiment Objectives: In this introductory experiment, you will: Learn how to use AVR studio, an Integrated Development Environment (IDE) for developing AVR applications in Windows

More information

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers IAR EWARM Quick Start for Holtek s Microcontrollers Revision: V1.10 Date: August 25, 2011 Table of Contents 1 Introduction... 5 About the Quick Start Guide... 5 About the IAR EWARM... 6 2 System Requirements...

More information

C Programming in Atmel Studio 7 Step by Step Tutorial

C Programming in Atmel Studio 7 Step by Step Tutorial C Programming in Atmel Studio 7 Step by Step Tutorial Sepehr Naimi NicerLand.com 1/1/017 Contents Introduction... Downloading and Installing Atmel Studio... 3 Opening Atmel Studio... 3 Creating the first

More information

Familiarity with data types, data structures, as well as standard program design, development, and debugging techniques.

Familiarity with data types, data structures, as well as standard program design, development, and debugging techniques. EE 472 Lab 1 (Individual) Introduction to C and the Lab Environment University of Washington - Department of Electrical Engineering Introduction: This lab has two main purposes. The first is to introduce

More information

ToolStick-EK TOOLSTICK USER S GUIDE. 1. Kit Contents. 2. ToolStick Overview. Green and Red LEDs. C8051F321 provides USB debug interface.

ToolStick-EK TOOLSTICK USER S GUIDE. 1. Kit Contents. 2. ToolStick Overview. Green and Red LEDs. C8051F321 provides USB debug interface. TOOLSTICK USER S GUIDE 1. Kit Contents The ToolStick kit contains the following items: ToolStick Silicon Laboratories Evaluation Kit IDE and Product Information CD-ROM. CD content includes: Silicon Laboratories

More information

Chapter 7 Central Processor Unit (S08CPUV2)

Chapter 7 Central Processor Unit (S08CPUV2) Chapter 7 Central Processor Unit (S08CPUV2) 7.1 Introduction This section provides summary information about the registers, addressing modes, and instruction set of the CPU of the HCS08 Family. For a more

More information

8051 Microcontroller Interrupts

8051 Microcontroller Interrupts 8051 Microcontroller Interrupts There are five interrupt sources for the 8051, which means that they can recognize 5 different events that can interrupt regular program execution. Each interrupt can be

More information

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING CHAPTER 2 8051 ASSEMBLY LANGUAGE PROGRAMMING Registers Register are used to store information temporarily: A byte of data to be processed An address pointing to the data to be fetched The vast majority

More information

ET2640 Microprocessors

ET2640 Microprocessors ET2640 Microprocessors Unit -2 Processor Programming Concepts Basic Control Instructor : Stan Kong Email : skong@itt-tech.edu Figure 2 4 Bits of the PSW Register 8051 REGISTER BANKS AND STACK 80 BYTES

More information

Lecture test next week

Lecture test next week Lecture test next week Write a short program in Assembler doing. You will be given the print outs of all the assembler programs from the manual You can bring any notes you want Today: Announcements General

More information

The University of Texas at Arlington Lecture 3

The University of Texas at Arlington Lecture 3 The University of Texas at Arlington Lecture 3 CSE 3442/5442 Tuesday, We Began Chapter 2, Architecture & Assembly Language Programming, Introduced the PIC WREG (Working Register) 8 bit register in PIC

More information

Using the stack and the stack pointer

Using the stack and the stack pointer Using the stack and the stack pointer o The Stack and Stack Pointer o The stack is a memory area for temporary storage o The stack pointer points to the last byte in the stack o Some instructions which

More information

Codewarrior for ColdFire (Eclipse) 10.0 Setup

Codewarrior for ColdFire (Eclipse) 10.0 Setup Codewarrior for ColdFire (Eclipse) 10.0 Setup 1. Goal This document is designed to ensure that your Codewarrior for Coldfire v10.0 environment is correctly setup and to orient you to it basic functionality

More information

CodeWarrior Development Studio for Freescale 68HC12/HCS12/HCS12X/XGATE Microcontrollers Quick Start SYSTEM REQUIREMENTS Hardware Operating System 200

CodeWarrior Development Studio for Freescale 68HC12/HCS12/HCS12X/XGATE Microcontrollers Quick Start SYSTEM REQUIREMENTS Hardware Operating System 200 CodeWarrior Development Studio for Freescale 68HC12/HCS12/HCS12X/XGATE Microcontrollers Quick Start SYSTEM REQUIREMENTS Hardware Operating System 200 MHz Pentium II processor or AMD-K6 class processor,

More information

Sample Problem Set #1

Sample Problem Set #1 Sample Problem Set #1 Notes: These problems are typical exam problems; most are drawn from previous homeworks and exams. This exam is open book, open notes. It may help to have a calculator. For partial

More information

SOFTWARE RELEASE GUIDE FOR THE MOTOROLA "MCUez SDI FOR HC12" SOFTWARE APPLICATION PACKAGE

SOFTWARE RELEASE GUIDE FOR THE MOTOROLA MCUez SDI FOR HC12 SOFTWARE APPLICATION PACKAGE M68MCUezSW/D FEBRUARY 1998 SOFTWARE RELEASE GUIDE FOR THE MOTOROLA "MCUez SDI FOR HC12" SOFTWARE APPLICATION PACKAGE Important Notice to Users MOTOROLA Inc., 1997-1998 All Rights Reserved While every effort

More information

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

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio ECE2049 Embedded Computing in Engineering Design Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio In this lab, you will be introduced to the Code Composer Studio

More information

M16C/62P QSK QSK62P Plus Tutorial 1. Software Development Process using HEW4

M16C/62P QSK QSK62P Plus Tutorial 1. Software Development Process using HEW4 M16C/62P QSK QSK62P Plus Tutorial 1 Software Development Process using HEW4 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW4 (Highperformance Embedded

More information

EXPERIMENT NUMBER 5 Creating a Single Chip Memory Space for the 8051

EXPERIMENT NUMBER 5 Creating a Single Chip Memory Space for the 8051 5-1 EXPERIMENT NUMBER 5 Creating a Single Chip Memory Space for the 8051 INTRODUCTION: The 8031 microcontroller on the XS40 board is an 8051-type microcontroller, but unlike the 8051 it contains no on-chip

More information

Using the KD30 Debugger

Using the KD30 Debugger ELEC3730 Embedded Systems Tutorial 3 Using the KD30 Debugger 1 Introduction Overview The KD30 debugger is a powerful software tool that can greatly reduce the time it takes to develop complex programs

More information

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

SKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc. SKP16C26 Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance

More information

A Quick Introduction to MPLAB SIM

A Quick Introduction to MPLAB SIM A Quick Introduction to MPLAB SIM Welcome to this web seminar, A Quick Introduction to MPLAB SIM. My name is Darrel Johansen and I m a manager in the Development Tools group at Microchip. Page 1 What Is

More information

Mechatronics Laboratory Assignment #1 Programming a Digital Signal Processor and the TI OMAPL138 DSP/ARM

Mechatronics Laboratory Assignment #1 Programming a Digital Signal Processor and the TI OMAPL138 DSP/ARM Mechatronics Laboratory Assignment #1 Programming a Digital Signal Processor and the TI OMAPL138 DSP/ARM Recommended Due Date: By your lab time the week of January 29 th Possible Points: If checked off

More information

C Language Programming, Interrupts and Timer Hardware

C Language Programming, Interrupts and Timer Hardware C Language Programming, Interrupts and Timer Hardware In this sequence of three labs, you will learn how to write simple C language programs for the MC9S12 microcontroller, and how to use interrupts and

More information

indart -HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01027

indart -HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01027 indart -HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01027 SofTec Microsystems E-mail (general information): info@softecmicro.com

More information

Introduction to C/C++ Programming

Introduction to C/C++ Programming Chapter 1 Introduction to C/C++ Programming This book is about learning numerical programming skill and the software development process. Therefore, it requires a lot of hands-on programming exercises.

More information

Assembly Programming in Atmel Studio 7 Step by Step Tutorial

Assembly Programming in Atmel Studio 7 Step by Step Tutorial Assembly Programming in Atmel Studio 7 Step by Step Tutorial Sepehr Naimi BIHE University 12/1/2017 Contents Introduction... 2 Downloading and Installing Atmel Studio... 3 Opening Atmel Studio... 3 Creating

More information

ECE L A B 1 Introduction ASSEMBLY PROGRAMMING WITH MINIIDE

ECE L A B 1 Introduction ASSEMBLY PROGRAMMING WITH MINIIDE L A B 1 Introduction ASSEMBLY PROGRAMMING WITH MINIIDE The purpose of this lab is to introduce you to the layout and structure of Assembly Language programs and their format. You will write your own programs

More information

Subroutines and the Stack

Subroutines and the Stack 3 31 Objectives: A subroutine is a reusable program module A main program can call or jump to the subroutine one or more times The stack is used in several ways when subroutines are called In this lab

More information

W7100A / W7100. Version WIZnet Co., Inc. All Rights Reserved. For more information, visit our website at

W7100A / W7100. Version WIZnet Co., Inc. All Rights Reserved. For more information, visit our website at W7100A / W7100 Debugger Guide Version 1.1 2012 WIZnet Co., Inc. All Rights Reserved. For more information, visit our website at http://www.wiznet.co.kr Copyright 2012 WIZnet Co., Inc. All rights reserved.

More information

ECE 3610 MICROPROCESSING SYSTEMS

ECE 3610 MICROPROCESSING SYSTEMS 24.361 Lab. 4 31 ECE 3610 MICROPROCESSING SYSTEMS Laboratory 4 LAB 4: ASSEMBLER DIRECTIVES, THE STACK, SUBROUTINES, AND BUBBLE SORTING 1 INTRODUCTION This lab deals with the use of the stack and subroutines

More information

EE319K Final Fall 2005 Solution C. (3) Question 1. (3) Question 2. short function(const short in){ return in+5; } const

EE319K Final Fall 2005 Solution C. (3) Question 1. (3) Question 2. short function(const short in){ return in+5; } const EE319K Final Fall 2005 Solution C. Jonathan Valvano (3) Question 1. Consider a matrix with 4 rows and 6 columns, stored in column-major zero-index format. Each element is 16 bits. Which equation correctly

More information

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

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family Getting Started with Renesas Development Tools R8C/3LX Family Description: The purpose of this lab is to allow a user new to the Renesas development environment to quickly come up to speed on the basic

More information

Quick Start Guide for TWR-S08LL64 TOWER SYSTEM MC9S08LL64. S08 ultra-low-power LCD segment MCU

Quick Start Guide for TWR-S08LL64 TOWER SYSTEM MC9S08LL64. S08 ultra-low-power LCD segment MCU Quick Start Guide for TWR-S08LL64 TOWER SYSTEM MC9S08LL64 S08 ultra-low-power LCD segment MCU TOWER SYSTEM Get to know the TWR-S08LL64 Tower Card Connector (Secondary) LCD Display Potentiometer Mini-B

More information

An ability to program a microcontroller to perform various tasks

An ability to program a microcontroller to perform various tasks Learning Outcome #1 An ability to program a microcontroller to perform various tasks How? A. Architecture and Programming Model B. Instruction Set Overview C. Assembly Control Structures D. Control Structure

More information

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING. Principles of Computer Operation

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING. Principles of Computer Operation UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING Experiment PCO: Principles of Computer Operation Location: Part I Lab., CYC 102. Objective: The objective is to learn the basic

More information

Parallel I/O and Keyboard Scanning

Parallel I/O and Keyboard Scanning 4 4.1 Objectives: Microprocessors can monitor the outside world using input ports. They can also control it using output ports. The TM4C123G (Tiva) performs I/O using 6 ports. Computer keyboards are typically

More information

indart -HCS08 In-Circuit Debugger/Programmer for Freescale HCS08 Family FLASH Devices User s Manual Rev. 2.0

indart -HCS08 In-Circuit Debugger/Programmer for Freescale HCS08 Family FLASH Devices User s Manual Rev. 2.0 indart -HCS08 In-Circuit Debugger/Programmer for Freescale HCS08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01028 We want your feedback! SofTec Microsystems is always

More information

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

More information

This chapter introduces how to use the emulator of TOPICE quickly.

This chapter introduces how to use the emulator of TOPICE quickly. Quick Starting Summarization This chapter introduces how to use the emulator of TOPICE quickly. Compiling Source and Debugging Creating a New Project Select main menu Project, then choose the submenu New

More information

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software. Introduction to Netbeans This document is a brief introduction to writing and compiling a program using the NetBeans Integrated Development Environment (IDE). An IDE is a program that automates and makes

More information

Module 8: Atmega32 Stack & Subroutine. Stack Pointer Subroutine Call function

Module 8: Atmega32 Stack & Subroutine. Stack Pointer Subroutine Call function Module 8: Atmega32 Stack & Subroutine Stack Pointer Subroutine Call function Stack Stack o Stack is a section of RAM used by the CPU to store information temporarily (i.e. data or address). o The CPU needs

More information

HandsOn Technology -- HT-MC-02 MODEL: HT-MC-02

HandsOn Technology -- HT-MC-02 MODEL: HT-MC-02 HandsOn Technology 8051 μcontroller Starter Kits FLASH μcontroller PROGRAMMER/DEVELOPMENT SYSTEM MODEL: HT-MC-02 8051 is one of the most popular 8-bit µcontroller architectures in use today, learn it the

More information

CHAPTER 8. Solutions for Exercises

CHAPTER 8. Solutions for Exercises CHAPTER 8 Solutions for Exercises E8.1 The number of bits in the memory addresses is the same as the address bus width, which is 20. Thus the number of unique addresses is 2 20 = 1,048,576 = 1024 1024

More information

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

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET Chapter. 03 9/17/01 6:08 PM Page 35 Visual Studio.NET T H R E E Although it is possible to program.net using only the command line compiler, it is much easier and more enjoyable to use Visual Studio.NET.

More information

How to use CodeWarrior ASM with Adapt9S12 and Serial Monitor.doc

How to use CodeWarrior ASM with Adapt9S12 and Serial Monitor.doc How to use CodeWarrior ASM with Adapt9S12 and Serial Monitor.doc This document assumes that CW is already been installed. It further assumes that the user has all the necessary hardware and just need assistance

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 8, 2016 Controller vs Processor Controller vs Processor Introduction to 8051 Micro-controller In 1981,Intel corporation

More information

1. Memory Mapped Systems 2. Adding Unsigned Numbers

1. Memory Mapped Systems 2. Adding Unsigned Numbers 1 Memory Mapped Systems 2 Adding Unsigned Numbers 1 1 Memory Mapped Systems Our system uses a memory space Address bus is 16-bit locations Data bus is 8-bit 2 Adding Unsigned Numbers 2 Our system uses

More information

TRACE32 Debugger Getting Started... ICD Tutorial About the Tutorial... 2

TRACE32 Debugger Getting Started... ICD Tutorial About the Tutorial... 2 ICD Tutorial TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Debugger Getting Started... ICD Tutorial... 1 About the Tutorial... 2 Working with the Debugger... 3 Set up the Program Environment

More information

P&E Microcomputer Systems, Inc. PKGPPCNEXUS

P&E Microcomputer Systems, Inc. PKGPPCNEXUS P&E Microcomputer Systems, Inc. PKGPPCNEXUS Quick Start Guide for the PHYTEC phycore-mpc5554 Rapid Development Kit Visit us on the web: www.pemicro.com 2006 P&E Microcomputer Systems, Inc. All Rights Reserved

More information

Microcontrollers. Microcontroller

Microcontrollers. Microcontroller Microcontrollers Microcontroller A microprocessor on a single integrated circuit intended to operate as an embedded system. As well as a CPU, a microcontroller typically includes small amounts of RAM and

More information

COSC345 Software Engineering. Basic Computer Architecture and The Stack

COSC345 Software Engineering. Basic Computer Architecture and The Stack COSC345 Software Engineering Basic Computer Architecture and The Stack Outline Architectural models A little about the 68HC11 Memory map Registers A little bit of assembly (never did us any harm) The program

More information

Introduction to Assembly language

Introduction to Assembly language Introduction to Assembly language 1 USING THE AVR MICROPROCESSOR Outline Introduction to Assembly Code The AVR Microprocessor Binary/Hex Numbers Breaking down an example microprocessor program AVR instructions

More information

CEG 411/611 Laboratory 1. Laboratory Familiarization

CEG 411/611 Laboratory 1. Laboratory Familiarization CEG 411/611 Laboratory 1 PURPOSE Laboratory Familiarization The purpose of this lab is to introduce you to the equipment and procedures used in the CEG 411/611 Laboratory. This is a one-week project. The

More information