Hitchhiker's Guide to CodeWarrior EE371, EE475 Fall 2005



Similar documents
CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

Using the HCS12 Serial Monitor on Wytec Dragon-12 boards. Using Motorola s HCS12 Serial Monitor on Wytec s Dragon-12 boards

EMBEDDED C USING CODEWARRIOR Getting Started Manual

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

Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board

Freescale Semiconductor, I

2. PMP New Computer Installation. & Networking Instructions

Lab: Data Backup and Recovery in Windows XP

ProjectWise Explorer V8i User Manual for Subconsultants & Team Members

Virtual Office Remote Installation Guide

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

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

Using Example Projects, Code and Scripts to Jump-Start Customers With Code Composer Studio 2.0

Introduction to the use of the environment of Microsoft Visual Studio 2008

Windows 7 for beginners

Lab - Data Backup and Recovery in Windows XP

QUICK START GUIDE. SG2 Client - Programming Software SG2 Series Programmable Logic Relay

Appendix A How to create a data-sharing lab

Programing the Microprocessor in C Microprocessor System Design and Interfacing ECE 362

Code Composer Studio Development Tools v3.3. Getting Started Guide

Getting Started with the Student Learning Kit Featuring the Freescale HCS12 Microcontroller Application Module

An Introduction to MPLAB Integrated Development Environment

Code::Block manual. for CS101x course. Department of Computer Science and Engineering Indian Institute of Technology - Bombay Mumbai

Working with SQL Server Integration Services

Operating Systems. and Windows

ELECTRONIC DATA PROCESSOR (EDP) QUICKSTART FOR DATA PROVIDERS

Chapter 3 Create an EasyBuilder Project... 2

Assignment 09. Problem statement : Write a Embedded C program to switch-on/switch-off LED.

Outlook Web Access. PRECEDED by v\

DEPLOYING A VISUAL BASIC.NET APPLICATION

Table of Contents. 1. Overview Materials Required System Requirements User Mode Installation Instructions..


Using an Automatic Back Up for Outlook 2003 and Outlook 2007 Personal Folders

BSDI Advanced Fitness & Wellness Software

WSDOT ProjectWise V8i Training 101

Installing Global Logger USB Drivers

Where Are My Primary Documents?

Managing Contacts in Outlook

Help File. Version February, MetaDigger for PC

First Time On-Campus VLab Setup Windows XP Edition

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

How to Install Applications (APK Files) on Your Android Phone

WebEx Remote Access User s Guide

3. USB DRIVER Installation of USB driver Driver for Infinity SD Data Logger. INFINITY Series Acquisition Tools Manual

STANDARD OPERATING PROCEDURE FOR USE OF LOG TAG ANALYZERS AS PART OF THE INTER HOSPITAL TRANSFER PROGRAM

Local Caching Servers (LCS): User Manual

APPENDIX B: FEMA 452: Risk Assessment Database V5.0. User Guide

DRV8312-C2-KIT How to Run Guide

S PT-E550W ELECTRONIC E C LABELING L SYSTEM

When upgrading your TAPIT software make sure that all call accounting data has been exported before you begin the installation process.

CLEARONE DOCUMENT (REVISION 1.0) October, with Converge Pro Units

How To Archive s On Groupwise On A Pc Or Mac Or Mac (For Mac) On A Mac Or Ipad (For Pc Or Ipa) On An Ipa Or Mac) (For Ipa).Com (For Pb

IT Quick Reference Guides Using Windows 7

Getting Started with Embedded System Development using MicroBlaze processor & Spartan-3A FPGAs. MicroBlaze

Surf it Easy. User Guide

SA-9600 Surface Area Software Manual

Using USB Flash Drives

Using HiTOP with the HOT16x Hands-On Training Materials

1.5 MONITOR. Schools Accountancy Team INTRODUCTION

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

JAVS Scheduled Publishing. Installation/Configuration... 4 Manual Operation... 6 Automating Scheduled Publishing... 7 Windows XP... 7 Windows 7...

Waspmote IDE. User Guide

Frog VLE Update. Latest Features and Enhancements. September 2014

3. Programming the STM32F4-Discovery

Filtering with Microsoft Outlook

Installing Java 5.0 and Eclipse on Mac OS X

Backing up IMail Server using Altaro Backup FS

Installation Windows Next Linux Mac Navigator Navigator Help Show Navigator at Startup PR Wizard New PR Campaign PR Manager

About Kobo Desktop Downloading and installing Kobo Desktop Installing Kobo Desktop for Windows... 5 Installing Kobo Desktop for Mac...

Cart Interface Installation & Control Board Manual for M38 XP and RX Carts and Legacy M39 Carts

Firmware & Software update procedures Amicroe TouchTAB IV.

USER MANUAL SlimComputer

Rogue RE-CONN Utility

Installing the Software... 1 Using the System Tray Icon... 5 Restoring the System Tray Icon... 6

Appendix K Introduction to Microsoft Visual C++ 6.0

Introduction to Windows XP

7-1. This chapter explains how to set and use Event Log Overview Event Log Management Creating a New Event Log...

Time Stamp. Instruction Booklet

Updates Click to check for a newer version of the CD Press next and confirm the disc burner selection before pressing finish.

Chapter 12. Development Tools for Microcontroller Applications

File Management and File Storage

User Manual for Data Backups

Embroidery Fonts Plus ( EFP ) Tutorial Guide Version

Vess A2000 Series. NVR Storage Appliance. Windows Recovery Instructions. Version PROMISE Technology, Inc. All Rights Reserved.

Start A New Project with Keil Microcontroller Development Kit Version 5 and Freescale FRDM-KL25Z

How To: Upload a Custom Tune to Your Predator or Trinity PREP:

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

BACKUP UTILITY FOR TIMEFORCE

Capacitive Touch Lab. Renesas Capacitive Touch Lab R8C/36T-A Family

Personal Portfolios on Blackboard

Guide to Installing BBL Crystal MIND on Windows 7

Outlook 2003 User Guide. April 15, 2004

Installation of IR under Windows Server 2008

What is OneDrive for Business at University of Greenwich? Accessing OneDrive from Office 365

Software Installation and Creating a New Company

IAR Embedded Workbench

such as USB drives, connected servers, DVDs, CDs, configure file labels, and the information that appears in the Finder window sidebar.

Primavera P6 Professional Windows 8 Installation Instructions. Primavera P6. Installation Instructions. For Windows 8 Users

Installing Remote Desktop Connection

Transcription:

Hitchhiker's EE371, EE475 Fall 2005 Building an HC12 executable relocatable assembly or C program: 1. Launch CodeWarrior IDE. a) From Windows desktop, click Start > Programs > Metrowerks CodeWarrior > CW12 V3.1 > CodeWarrior IDE. 2. Create New Project. a) From IDE main menu bar, select File > New New window appears. b) Highlight HC(S)12 New Project Wizard. c) Enter a Project Name that makes sense to you (like lab_x). d) Enter a Location for the project. This should be on your Z drive or wherever you want to keep your HC12 projects. (Don't keep it on the C:/ drive.) e) Click OK. 3. In the New Project Wizard Page 1: Select MC9S12C32 as the derivative you want to use and click Next. Page 2: Check the language support you want (Assembly or C) and click Next. If Assembly: Page 3: Check Relocatable Assembly and click Next. Page 4: Check Metrowerks Full Chip Simulator and P&E Hardware Debugging and click Finish. If C: Page 3: Check No for Processor Expert. Page 4: Check No for PC-lint. Page 5: Select None for Floating Point Format. Page 6: Select Small Memory Model. Page 7: Check Metrowerks Full Chip Simulator and P&E Hardware Debugging and click Finish. In the Project Manager Window 4. Switch to the P&E ICD for debugging by clicking the pull down arrow and selecting P&E ICD. (This uses the hardware for debugging. If you want to use the simulator, choose Simulator.) 5. If you want to create listing files Open Simulator Settings panel clicking the icon shown above. a) Click on + next to Target in the Target Settings. b) Highlight Assembler for HC12 or Compiler for HC12 and in that panel click on Options i) Check Generate a listing file. ii) Click OK. 1

6. Open the Sources folder (click on the + if it is not open). 7. Double click on main.asm or main.c and edit it to be the source file you want. 8. Save it to whatever name you want: File > Save As. (Make sure you give it an.asm filename, or you can just use the main.asm file if you want.) 9. Check to make sure debugging information is going to be generated. a) In the Project Manager Files window, check to see that there is a in the rightmost column under the bug icon. 10. Assemble the file to check for errors: a) Click on Project > Compile b) Correct any errors 11. Have a look at your list file. a) File > Open and position to the bin folder in your project and open the.lst file. 12. Add other source files to the relocatable files in the project: a) Click on the Add New Text File icon. b) Edit the file c) File > Save As (use.asm as the extension for assembler file) d) Add it to the project: Project > Add *.asm to the project. In Add Files check both Simulator and Monitor. e) Compile it: Project > Compile 13. View the linker parameter file a) Click the + next to Prm and double click the P&E_ICD_linker.prm file to open it in the editor. b) For assembly applications make sure the default parameter file looks like this: (Note: The linker is CASE SENSITIVE. Things that are shown capitalized must be capitalized.) NAMES SEGMENTS RAM = READ_WRITE 0x0800 TO 0x0FFF; /* unbanked FLASH ROM */ ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF; ROM_C000 = READ_ONLY 0xC000 TO 0xFEFF; /* banked FLASH ROM */ /* PAGE_3E = READ_ONLY 0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */ /* PAGE_3F = READ_ONLY 0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */ PLACEMENT _PRESTART, start */ /* Used in HIWARE format: jump to _Startup at the code 2

the STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ NON_BANKED, /* runtime routines which must not be banked */ DEFAULT_ROM, COPY /* copy down information: how to initialize variables */ /* in case you want to use ROM_4000 here as well, make sure that all files (incl. library files) are compiled with DEFAULT_RAM STACKSIZE 0x100 option: -OnB=b */ INTO ROM_C000/*, ROM_4000*/; INTO RAM; //VECTOR 0 _Startup /* reset vector: default entry point for a C/C++ application. */ VECTOR 0 Entry /* reset vector: default entry point for a Assembly application. */ INIT Entry /* initialisation entry point for assembly applications */ c) For C applications, the vector links at the bottom of the file should be: VECTOR 0 _Startup /* reset vector: Default entry point for a C/C++ application. */ //VECTOR 0 Entry /* reset vector: Default entry point for a Assembly application. */ //INIT Entry /* This is used for assembly applications also */ 14. Make the project. a) Project > Make or click on the icon b) Correct any linking errors. 15. Inspect the Linker Map file. a) Click the + on Linker Map and open P&E_ICD.map b) Check the OBJECT-ALLOCATION SECTION section to see where the Entry label is located. This will be the starting address for your program. 16. Running the program. a) Make sure the SLK board is powered up, the CSM-12C32 is in the proper place, and that the USB cable is connected. b) Launch the True-Time Simulator and Debugger by Project > Debug, F5, or clicking on the icon When the loader warning appears click OK. True-Time Simulator and P&E ICD target: 17. Running the program using CodeWarrior and the P&E ICD target. a) Make sure the SLK board is powered up, the CSM-12C32 is in the proper place, and that the USB cable is connected. b) If your program is not loaded or it needs to be reloaded, click ICD12 > Load and load bin\p&e_icd.abs. c) You can use all the features of the debugger on the actual code on the microcontroller. 3

True-Time Simulator and Simulator Target: 18. Run the program using CodeWarrior True-Time Simulator target. a) Choose Simulator instead of P&E_ICD as shown in step 4. b) If Simulator is not the debug target, click on Component > Set Target and chose Simulator Target Interface and click OK. c) If your program has not been loaded, or you want to reload it, click Simulator > Load and load bin\simulator.abs. d) You can use all the features of the simulator on the code. CodeWarrior File Handling Path Display: The full path of the file currently in the editor window is shown at the top of the window. If it is not displayed, click the little box in the upper right-hand corner of the window, just above the right margin scroll bars. Adding Files To Your Project: Project -> Add Files... This does NOT copy a file to your project. Instead it creates a link to the file you add. When you do this you get the following message: The following access path has been added to target "Simulator" of project "test4.mcp": {Project}..\blinky_1\Sources Any editing changes you make will be made in the original file. Do not use Project -> Add Files to copy a file from some other project to your project (unless you want to update a file in use for all projects using it.) File -> Open This allows you to position to a directory and open a file in that directory. The editor path display should show the original path. If you File -> Save, Editing changes take place in that file. File -> Save As This allows you to save the open file in whatever directory you want, including your current project. The default is the directory that was opened for the file originally. You can position to the sources directory of the current project and save it there. Copying Files from One Project to Another using Explorer You can use Explorer to copy files from one directory to another. This is probably the easiest way to add a file from some other project to your current project. Project -> Add to Project After saving or copying a file to your project sources directory, you must activate Project -> Add <filename> to Project. If it is a source file, the colors will change appropriately. File -> Find and Open File This command allows you to highlight a filename in the editor, e.g. switches.inc, and the system will find the file and open it in the editor. File -> Save a Copy As... Use this to save a copy of your file as a backup. The filename will be "Copy of ". 4

File -> Revert This will remove any editing changes made since the last time you saved the file. Debugging Information: Warning, no debug information If you get this error when launching the debugger, it means one of the files you have copied into your project does not have the debug information being generated when it is being compiled. To fix this, double click in the column under the little green bug in the files window. See Step 9. Removing Files from a Project: If you choose to remove a file from the project, either by highlighting it and pressing Del or Edit > Remove you get an error message saying removing the file from the project cannot be undone. Rubbish! This does not actually "remove", as in delete, the source file. It simply removes it from the list of files in the project. You can always go back and add it back in later. F:\1wpdocs\Book\Revision\CodeWarrior\CW_hitchhikers_f05.doc 5