Phytec phyCORE-AT91M55800A Programming manual

A product of a PHYTEC Technology Holding company
phyCORE-
AT91M55800A
QuickStart Instructions
Using Keil's ULINK and the Keil ARM7/µVision3
Software Development Tool Chain
Note: The PHYTEC Spectrum CD includes the electronic version of
the English phyCORE-AT91M55800A Hardware Manual
Edition: July 2005

phyCORE-AT91M55800A QuickStart Instructions
© PHYTEC Messtechnik GmbH 2005 L-642e_3
In this manual are descriptions for copyrighted products that are not explicitly
indicated as such. The absence of the trademark () and copyright () symbols
does not imply that a product is not protected. Additionally, registered patents and
trademarks are similarly not expressly indicated in this manual.
The information in this document has been carefully checked and is believed to be
entirely reliable. However, PHYTEC Messtechnik GmbH assumes no
responsibility for any inaccuracies. PHYTEC Messtechnik GmbH neither gives
any guarantee nor accepts any liability whatsoever for consequential damages
resulting from the use of this manual or its associated product. PHYTEC
Messtechnik GmbH reserves the right to alter the information contained herein
without prior notification and accepts no responsibility for any damages which
might result.
Additionally, PHYTEC Messtechnik GmbH offers no guarantee nor accepts any
liability for damages arising from the improper usage or improper installation of
the hardware or software. PHYTEC Messtechnik GmbH further reserves the right
to alter the layout and/or design of the hardware without prior notification and
accepts no liability for doing so.
Copyright 2005 PHYTEC Messtechnik GmbH, D-55129 Mainz.
Rights - including those of translation, reprint, broadcast, photomechanical or
similar reproduction and storage or processing in computer systems, in whole or in
part - are reserved. No reproduction may occur without the express written
consent from PHYTEC Messtechnik GmbH.
EUROPE NORTH AMERICA
Address: PHYTEC Technologie Holding AG
Robert-Koch-Str. 39
D-55129 Mainz
GERMANY
PHYTEC America LLC
203 Parfitt Way SW, Suite G100
Bainbridge Island, WA 98110
USA
Ordering
Information: +49 (800) 0749832
order@phytec.de 1 (800) 278-9913
sales@phytec.com
Technical
Support: +49 (6131) 9221-31
support@phytec.com
Fax: +49 (6131) 9221-33 1 (206) 780-9135
Web Site: http://www.phytec.de http://www.phytec.com
3rd Edition: July 2005

Contents
© PHYTEC Messtechnik GmbH 2005 L-642e_3
1 Introduction to the Rapid Development Kit.....................................1
1.1 Rapid Development Kit Documentation ......................................1
1.2 Overview of this QuickStart Instruction.......................................2
1.3 System Requirements ...................................................................3
1.4 The PHYTEC phyCORE-AT91M55800A...................................4
1.5 The Keil ARM7/µVision3 Software Development Tool Chain...7
2 Getting Started.....................................................................................9
2.1 Installing Rapid Development Kit Software.................................9
2.2 Interfacing the phyCORE-AT91M55800A to a Host-PC ..........15
2.3 Downloading Example Code with µVision3..............................18
2.3.1 "Blinky".........................................................................19
2.3.2 "Hello"...........................................................................22
3 Getting More Involved......................................................................27
3.1 Creating a New Project and Adding an Existing Source File.....27
3.1.1 Configure the Project Components................................29
3.1.2 Adding Source Files to the Project................................33
3.2 Modifying the Source Code........................................................36
3.3 Setting Options for Flash Target ................................................37
3.4 Building the Project....................................................................47
3.5 Downloading Code into Flash Memory......................................48
4 Debugging...........................................................................................49
4.1 Creating a Debug Project and Preparing the Debugger..............50
4.1.1 Creating a New Project..................................................50
4.1.2 Setting Options for Target.............................................51
4.2 Starting the Debugger.................................................................59
4.3 Keil µVision3 Debug Features ...................................................61
4.4 Using the Keil µVision3 Debug Features...................................63
4.4.1 Breakpoints....................................................................63
4.4.2 Single Stepping and Watch Window.............................65
4.5 Running, Stopping and Resetting...............................................66
4.6 Changing Target Settings for the "Executable Version"............67

phyCORE-AT91M55800A QuickStart Instructions
© PHYTEC Messtechnik GmbH 2005 L-642e_3
Index of Figures
Figure 1: Default Jumper Settings of the phyCORE Development
Board HD200 with phyCORE-AT91M55800A........................15
Figure 2: JTAG Connector X2 on the phyCORE-AT91M55800A
(Bottom View)...........................................................................16
Figure 3: ULINK and JA-002 Connected to the phyCORE Module........17
Figure 4: Power Connector.......................................................................17

Introduction
© PHYTEC Messtechnik GmbH 2005 L-642e_3 1
1Introduction to the Rapid Development Kit
This QuickStart provides:
•general information on the PHYTEC phyCORE-AT91M55800A
Single Board Computer (SBC),
•an overview of Keil's ARM7/µVision3 software development tool
chain evaluation version, and
•instructions on how to run example programs on the
phyCORE-AT91M55800A , mounted on the PHYTEC phyCORE
Development Board HD200, in conjunction with the Keil ULINK
and software tools
Please refer to the phyCORE-AT91M55800A Hardware Manual for
specific information on such board-level features as jumper
configuration, memory mapping and pin layout. Selecting the links on
the electronic version of this document links to the applicable section
of the phyCORE-AT91M55800A Hardware Manual.
1.1 Rapid Development Kit Documentation
This "Rapid Development Kit" (RDK) includes the following
electronic documentation on the enclosed "PHYTEC Spectrum
CD-ROM":
•the PHYTEC phyCORE-AT91M55800A Hardware Manual
•controller User's Manuals and Data Sheets
•this QuickStart Instruction with general "Rapid Development Kit"
description, software installation hints and three example programs
enabling quick out-of-the box start-up of the
phyCORE-AT91M55800A in conjunction with the Keil
ARM7/µVision3 software development tool chain

phyCORE-AT91M55800A QuickStart Instructions
2© PHYTEC Messtechnik GmbH 2005 L-642e_3
1.2 Overview of this QuickStart Instruction
This QuickStart Instruction gives a general "Rapid Development Kit"
description, as well as software installation hints and three example
programs enabling quick out-of-the box start-up of the
phyCORE-AT91M55800A in conjunction with the Keil ULINK and
ARM7/µVision3 software tools. It is structured as follows:
1) The "Getting Started" section uses two example programs:
Blinky and Hello to demonstrate the download of user code to
the Flash device using the Keil ULINK and ARM7/µVision3
software tools
2) The "Getting More Involved" section provides step-by-step
instructions on how to modify both examples, create and build
new projects and generate and download output files to the
phyCORE-AT91M55800A using the Keil tools.
3) The "Debugging" section provides a third example
program - "Debug" - to demonstrate simple debug functions
using the Keil µVision3 debug environment.
In addition to dedicated data for this Rapid Development Kit, the
PHYTEC Spectrum CD-ROM contains supplemental information on
embedded microcontroller design and development.

Introduction
© PHYTEC Messtechnik GmbH 2005 L-642e_3 3
1.3 System Requirements
Use of this "Rapid Development Kit" requires:
•the PHYTEC phyCORE-AT91M55800A
•the phyCORE Development Board HD200 with the included DB-9
serial cable and AC adapter supplying 5 VDC /min. 500 mA
•the Keil ULINK JTAG-USB adapter, not included in the standard
Rapid Development Kit version1
•the PHYTEC Spectrum CD for ARM7
•an IBM-compatible host-PC (486 or higher running at least
Windows95/NT)
For more information and example updates, please refer to the
following sources:
http://www.phytec.com - or - http://www.phytec.de
support@phytec.com - or - support@phytec.de
http://www.keil.com
1: The Keil ULINK is included in the Rapid Development Kit version with the part number
KPCM-014-SK-Keil.

phyCORE-AT91M55800A QuickStart Instructions
4© PHYTEC Messtechnik GmbH 2005 L-642e_3
1.4 The PHYTEC phyCORE-AT91M55800A
The phyCORE-AT91M55800A represents an affordable yet highly
functional Single Board Computer (SBC) solution in sub-miniature
dimensions (60 x 53 mm). The standard module is populated with an
Atmel AT91M55800A controller.
All applicable data/address lines and signals extend from the
underlying logic devices to two high-density Molex SMT pin header
connectors (pin width is 0.635 mm/25 mil) lining the circuit board
edges. This enables the phyCORE-AT91M55800A to be plugged like
a "big chip" into target hardware.
The standard module runs at a 32 MHz internal clock speed
(delivering 31.25 ns instruction cycle) and offers 512 kByte (up to
8 MByte) SRAM and 1 MByte (up to 16 MByte) Flash on-board for
DATA and CODE storage.
The module communicates by means of three RS-232 transceivers,
two CAN bus interfaces, and a CS8900A 10Base-T Ethernet
controller which enables implementation of the module in embedded
Internet applications. The phyCORE-AT91M55800A operates within
a standard temperature range of 0 to +70°C and requires only a
220 mA power source.
The Keil ARM/µVision3 software tools, in conjunction with the Keil
ULINK adapter, enables easy on-board download of user programs.

Introduction
© PHYTEC Messtechnik GmbH 2005 L-642e_3 5
The phyCORE-AT91M55800A offers the following features:
•subminiature Single Board Computer (60 x 53 mm) achieved
through modern SMD technology
•populated with the Atmel AT91M55800A microcontroller (BGA-
176 package)
•improved interference safety achieved through multi-layer PCB
technology and dedicated Ground pins
•controller signals and ports extend to two 100-pin high-density
(0.635 mm) Molex connectors aligning two sides of the board,
enabling it to be plugged like a “big chip” into target application
•16-bit, de-multiplexed bus mode
•32 MHz clock frequency (31.25 ns instruction cycle)
•128 MByte address space
•1 MByte (up to 16 MByte) on-board Flash1
•on-board Flash programming, no dedicated Flash programming
voltage required through use of 3.3 V Flash devices
•512 kByte (up to 8 MByte) RAM on-board, max. 2 MByte at
0 wait states1
•RS-232 transceiver for three serial interfaces
•CS8900A Ethernet controller with EEPROM
•2 kByte (up to 8 kByte) SPI-EEPROM1
•up to 6 free Chip Select signals for easy connection of peripherals
•one operating voltage for core & peripherals, 3.3 V, typ. <150 mA
1: Please contact PHYTEC for more information about additional module configurations.

phyCORE-AT91M55800A QuickStart Instructions
6© PHYTEC Messtechnik GmbH 2005 L-642e_3
The phyCORE Development Board HD200, in EURO-card
dimensions (160 x 100 mm) is fully equipped with all mechanical and
electrical components necessary for the speedy and secure insertion
and subsequent programming of most PHYTEC phyCORE high-
density series Single Board Computers. Simple jumper configuration
readies the Development Board’s connection to the
phyCORE-AT91M55800A, which plugs into the receptacle contact
strips mounted on the Development Board HD200.
phyCORE Development Board HD200 Technical Highlights
•low voltage socket for supply with regulated input voltage 5 VDC
•additional supply voltages 3.3 VDC or 2.5 VDC
•two DB-9 sockets (P1A, P1B) configurable as RS-232 interfaces
•two additional DB-9 plugs (P2A, P2B) configurable as
CAN interfaces
•simple jumper configuration allowing use of the
phyCORE Development Board HD200 with various PHYTEC
phyCORE high-density SBC’s
•socket for RJ45 Ethernet transformer module
•one control LED D3 for quick testing of user software
•2 x 160-pin Molex connector (X2) enabling easy connectivity to
expansion boards (e.g. PHYTEC GPIO Expansion Board)

Introduction
© PHYTEC Messtechnik GmbH 2005 L-642e_3 7
1.5 The Keil ARM7/µVision3 Software Development Tool
Chain
Keil Software development tools for the ARM7 TDMI Architecture
support every level of developer from the professional applications
engineer to the student just learning about embedded software
development. The Keil ARM7 compiler supports all ARM7-
compatible devices including the Atmel AT91xxxx devices. For a
complete list of supported ARM7 derivatives go to:
http://www.keil.com/dd/arm7chips.asp
µVision3, the latest version of Keil's popular IDE, combines project
management, source code editing, program debugging, and Flash
programming in a single, powerful environment. This QuickStart
provides an overview of the most commonly used µVision3 features
including:
•Project management, device setup, and tool configuration
•Integrates Keil ARM development tools in a single graphical user
interface (GUI)
•Editor facilities for creating, modifying, and correcting programs
•JTAG/target debugging or CPU & peripheral simulation
Once installed, the default destination location for all ARM7 tools;
executables; include, header and example files; as well as online help
and documentation is the C:\Keil\Arm folder, while the µVision3 IDE
is located at C:\Keil\Uv3. You can start Keil µVision3 by selecting it
from the Programs menu using the Windows Start button. The Keil
µVision3 icon will also be placed on your desktop for easy startup of
the development tools.

phyCORE-AT91M55800A QuickStart Instructions
8© PHYTEC Messtechnik GmbH 2005 L-642e_3
The new µVision3 editor offers many standard and advanced software
editing features like:
•Incremental Find positions the cursor while you type the search
phrase.
•Active Brace Checking shows nesting and highlights mismatches
while entering parentheses, braces, or brackets.
•Text Block Functions that comment, indent, uppercase, tabify,
and remove whitespace from text blocks.
•Document-Selective Settings for tab spacing and syntax coloring
in Assembler, C, and other file types.
•Detailed Syntax Highlighting that allows you to define a user
keyword list. Colors are used in printed output.
•Document Outlining that provides a quick overview of complex
source files.
The ARM7 evaluation version, as provided on the PHYTEC
Spectrum CD, has the following limitations:
•The µVision Debugger is limited to 16 kBytes.
•You may not use the Evaluation Version of the µVision
IDE/Debugger to create commercial products.
•The GNU ARM tools (compiler, assembler, and so on) that are
provided are not limited or restricted in any way.
The full DKARM Developer's Kit can be purchased through
PHYTEC. Please contact our sales representatives for a quote.
For more information on Keil ARM7/µVision3 tools visit their
website at:
http://www.keil.com/arm/

Getting Started
© PHYTEC Messtechnik GmbH 2005 L-642e_3 9
2Getting Started
What you will learn with this Getting Started example:
•installing Rapid Development Kit software
•interfacing the phyCORE-AT91M55800A, mounted on the
Development Board, to a host-PC using the Keil ULINK
•downloading example machine readable user code from a host-PC
to the external Flash memory using ARM7/µVision3 tools
2.1 Installing Rapid Development Kit Software
When you insert the PHYTEC Spectrum CD into the CD-ROM drive
of your host-PC, the PHYTEC Spectrum CD should automatically
launch a setup program that installs the software required for the
Rapid Development Kit as specified by the user. Otherwise the setup
program start.exe can be manually executed from the root directory of
the PHYTEC Spectrum CD.

phyCORE-AT91M55800A QuickStart Instructions
10 © PHYTEC Messtechnik GmbH 2005 L-642e_3
The following window appears:
•Choose Install Basic Product Files Button.
•After accepting the Welcome window and license agreement select
the destination location for installation of Rapid Development Kit
software and documentation.
The default destination location is C:\PHYBasic. All path and file
statements within this QuickStart Instruction are based on the
assumption that you accept the default install paths and drives. If you
decide to individually choose different paths and/or drives you must
consider this for all further file and path statements.
We recommend that you accept the default destination location.

Getting Started
© PHYTEC Messtechnik GmbH 2005 L-642e_3 11
•In the next window select your Rapid Development Kit of choice
from the list of available products.
All Kit-specific content will be installed to a Kit-specific subdirectory
of the Rapid Development Kit root directory that you have specified
at the beginning of the installation process.

phyCORE-AT91M55800A QuickStart Instructions
12 © PHYTEC Messtechnik GmbH 2005 L-642e_3
All software and tools for this phyCORE-AT91M55800A RDK will
be installed to the \PHYBasic directory on your hard-drive.
•In the next dialog you must choose whether to copy the selected
documentation as *.pdf files to your hard drive or to install a link
to the file on the Spectrum CD.
If you decide not to copy the documentation to your hard-drive you
will need the PHYTEC Spectrum CD-ROM each time you want to
access these documents. The installed links will refer to your
CD-ROM drive in this case.

Getting Started
© PHYTEC Messtechnik GmbH 2005 L-642e_3 13
If you decide to copy the electronic documentation to your hard-drive,
the documentation for this phyCORE-AT91M55800A Kit will also be
installed to the Kit-specific subdirectory.
•Setup will now add program icons to the program folder, named
PHYTEC.
•In the next window, choose the Keil ARM7/µVision3 Software
Development Tool Chain.
The applicable Keil tool chain must be installed to ensure successful
completion of this QuickStart Instruction. Failure to install the proper
software could lead to possible version conflicts, resulting in
functional problems.
We recommend that you install the Keil ARM7 tools resp. µVision3
from the Spectrum CD-ROM even if other versions of µVision3 are
already installed on your system. These QuickStart Instructions and
the demo software included on the CD-ROM have been specifically
tailored for use with one another1.
1: Note: If you have a full version of the Keil ARM7 tools already installed on your host-PC we
recommend installing this evaluation version on a different desktop or laptop computer. If this
is not possible we recommend to use the same version of the Keil ARM7 tools that we use in
this QuickStart manual. PHYTEC can not guarantee successful completion of these
QuickStart instructions if a different version of the Keil ARM7 tools is used.

phyCORE-AT91M55800A QuickStart Instructions
14 © PHYTEC Messtechnik GmbH 2005 L-642e_3
•After accepting the Welcome window and license agreement select
the destination location for installation of the Development Tool
Chain.
The applicable Keil ARM7/µVision3 evaluation development tool
chain will be installed to your hard-drive. Additional software, such
as Adobe Acrobat Reader, will also be offered for installation.
•Decide if you want to begin the QuickStart Instruction
immediately by selecting the appropriate checkbox and click on
Finish to complete the installation.

Getting Started
© PHYTEC Messtechnik GmbH 2005 L-642e_3 15
2.2 Interfacing the phyCORE-AT91M55800A to a Host-PC
Connecting the phyCORE-AT91M55800A, mounted on the
phyCORE Development Board HD200, to your computer is simple.
•Ensure proper jumper settings on the phyCORE Development
Board as shown in Figure 1.
Figure 1: Default Jumper Settings of the phyCORE Development Board
HD200 with phyCORE-AT91M55800A
•The ULINK JTAG adapter comes with various flat-band cables. In
order to connect this device to the phyCORE-AT91M55800A
module you need to connect the flat-band cable with a 2.0 mm
connector. If such a cable is not already connected to your ULINK,
open the enclosure and connect the correct 2.0 mm cable to the
applicable header connector inside the ULINK. Make sure that
pin #1 on the cable (black wire) matches pin #1 on the connector.

phyCORE-AT91M55800A QuickStart Instructions
16 © PHYTEC Messtechnik GmbH 2005 L-642e_3
•Connect the other 2.0 mm cable connector onto pin header rows
X2 on the phyCORE module. Make sure that pin #1 on the ULINK
cable (black wire) is correctly connected to pin #1 on the JTAG
connector X2 (located on the connector side of the PCB) of the
phyCORE-AT91M55800A (refer to Figure 2).
JTAG-Connector X2
Figure 2: JTAG Connector X2 on the phyCORE-AT91M55800A (Bottom View)
•Mount the phyCORE module onto the Development Board’s
receptacle footprint (X6) as shown in Figure 3 below. Ensure that
pin 1 of the module, designated by the hash stencil mark, matches
pin 1 of the receptacle on the Development Board.
Ensure that there is a solid connection between the module’s pins and
the Development Board receptacle. Also take precautions not to
damage the connectors when the phyCORE is removed from and
inserted onto the Development Board.
Table of contents
Other Phytec Controllers manuals