Phytec phyCORE-ADuC812 Programming manual

A product of a PHYTEC Technology Holding company
phyCORE-ADuC812
QuickStart Instructions
Using PHYTEC FlashTools98 for Windows and the Keil µVision2
Software Evaluation Development Tool Chain
Note: The PHYTEC Spectrum CD includes the electronic version of
the phyCORE-ADuC812 English Hardware Manual
Hinweis: Die PHYTEC Spectrum CD beinhaltet die elektronische
Version des deutschen phyCORE-ADuC812 Hardware Manuals
Edition: July 2002

phyCORE-ADuC812
© PHYTEC Meßtechnik GmbH 2002 L-462e_2
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 Meßtechnik GmbH assumes no
responsibility for any inaccuracies. PHYTEC Meßtechnik 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 Meßtechnik
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 Meßtechnik GmbH offers no guarantee nor accepts any
liability for damages arising from the improper usage or improper installation of
the hardware or software. PHYTEC Meßtechnik 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 2002 PHYTEC Meßtechnik 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 Meßtechnik 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
info@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
2nd Edition: July 2002

Table of Contents
PHYTEC Meßtechnik GmbH 2002 L-462e_2
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-ADuC812............................................4
1.5 The Keil Software Evaluation Development Tool Chain.............7
2 Getting Started...................................................................................11
2.1 Installing Rapid Development Kit Software...............................11
2.2 Interfacing the phyCORE-ADuC812 to a Host-PC....................18
2.3 Starting PHYTEC FlashTools98 for Windows ..........................20
2.4 Downloading Example Code with FlashTools...........................21
2.4.1 "Blinky".........................................................................26
2.4.2 "Hello"...........................................................................28
3 Getting More Involved......................................................................33
3.1 Starting the Keil µVision2 Tool Chain.......................................33
3.2 Creating a New Project and Adding an Existing Source File.....35
3.3 Modifying the Source Code........................................................41
3.4 Saving the Modifications............................................................42
3.5 Setting Tool Chain Options ........................................................42
3.6 Building the Project....................................................................45
3.7 Downloading the Output File .....................................................46
3.8 “Hello2”......................................................................................47
3.8.1 Creating a New Project..................................................47
3.8.2 Modifying the Example Source.....................................48
3.8.3 Setting Tool Chain Options...........................................48
3.8.4 Building the New Project ..............................................48
3.8.5 Downloading the Output File........................................49
3.8.6 Starting the Terminal Emulation Program.....................50
4 Debugging...........................................................................................51
4.1 Preparing the Target Hardware to Communicate with
µVision2 Target Monitor............................................................52
4.2 Creating a Debug Project and Preparing the Debugger..............53
4.2.1 Creating a New Project..................................................53

phyCORE-ADuC812
© PHYTEC Meßtechnik GmbH 2002 L-462e_2
4.2.2 Setting Options for Target.............................................54
4.3 Preparing the Debugger..............................................................59
4.4 Starting the Debugger.................................................................61
4.5 Keil µVision2 Debug Features...................................................64
4.6 Using the Keil µVision2 Debug Features..................................66
4.6.1 Serial Window...............................................................66
4.6.2 Breakpoints....................................................................67
4.7 Single Stepping and Watch Window..........................................68
4.8 Running, Stopping and Resetting...............................................70
4.9 Changing Target Settings for the "Final Version" .....................71
5 Advanced User Information.............................................................75
5.1 FlashTools98 ..............................................................................75
5.2 STARTUP.A51 ..........................................................................77
5.3 Linking and Locating .................................................................78
Index of Figures
Figure 1: Keil Tool Chain Overview ...........................................................8
Figure 2: Mounting the phyCORE-ADuC812 onto the
phyCORE Development Board LD 5V......................................18
Figure 3: Important Connectors, Buttons and Suitable Jumper Settings
on the phyCORE Development Board LD 5V...........................19
Figure 4: Power Connector........................................................................19
Figure 5: Memory Model for Use with the Keil Monitor
(64 kByte RAM).........................................................................55

Introduction
© PHYTEC Meßtechnik GmbH 2002 L-462e_2 1
1Introduction to the Rapid Development Kit
This QuickStart provides:
•general information on the PHYTEC phyCORE-ADuC812 Single
Board Computer (SBC)
•an overview of Keil’s µVision2 software evaluation development
tool chain, and
•instructions on how to run example programs on the
phCORE-ADuC812, mounted on the PHYTEC
phyCORE Development Board LD 5V, in conjunction with
µVision2 IDE
Please refer to the phyCORE-ADuC8xx 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 phCORE-ADuC8xx 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-ADuC8xx Hardware Manual and
phyCORE Development Board LD 5V Hardware Manual
•controller User's Manuals and Data Sheets
•this QuickStart Instruction with general “Rapid Development Kit”
description, software installation hints and four example programs
enabling quick out-of-the box start-up of the phyCORE-ADuC812
in conjunction with the Keil software development tools

phyCORE-ADuC812
2© PHYTEC Meßtechnik GmbH 2002 L-462e_2
1.2 Overview of this QuickStart Instruction
This QuickStart Instruction gives a general “Rapid Development Kit”
description, as well as software installation hints and four example
programs enabling quick out-of-the box start-up of the
phyCORE-ADuC812 in conjunction with the Keil software
development tools. It is structured as follows:
1) The “Getting Started” section uses three example programs:
•"Hello" and "Blinky" to demonstrate the download of user code
to the Flash device using PHYTEC FlashTools98 for Windows.
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-ADuC812 using the Keil tool chain and
FlashTools98.
3) The "Debugging” section provides a fourth example
program - “Debug” - to demonstrate monitoring of the board and
simple debug functions using the µVision2 debug environment.
In addition to dedicated data for this Rapid Development Kit, this
CD-ROM contains supplemental information on embedded
microcontroller design and development.

Introduction
© PHYTEC Meßtechnik GmbH 2002 L-462e_2 3
1.3 System Requirements
Use of this “Rapid Development Kit” requires:
•the phyCORE-ADuC812 SBC module
•the phyCORE Development Board LD 5V with the included DB-9
serial cable and AC adapter supplying 5 VDC / min. 500 mA
•the PHYTEC Spectrum CD
•an IBM-compatible host-PC (486 or higher running at least
Windows95/98)
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

phyCORE-ADuC812
4© PHYTEC Meßtechnik GmbH 2002 L-462e_2
1.4 The PHYTEC phyCORE-ADuC812
The phyCORE-ADuC represents an affordable, yet highly functional
Single Board Computer (SBC) solution in subminiature dimensions
(60 x 55 mm). The standard board is populated with a Analog Device
ADuC812 controller. The ADuC812 features an 8-channel 12-bit
resolution A/D-converter, two 12-bit D/A-converters, integrated
reference voltage source and a temperature sensor.
All applicable data/address lines and applicable signals extend from
the underlying logic devices to standard-width (2.54 mm / 0.10 in.)
pin headers lining the circuit board edges. This enables the
phyCORE-ADuC812 to be plugged like a “big chip” into target
hardware.
The standard memory configuration of the phyCORE-ADuC812
features 128 kByte external SRAM and 128 kByte external Flash for
code storage (64 kByte for FlashTools firmware and 64 kByte for
storage of user code). The Flash device allows direct on-board
programming. Three Chip Select signals are available for external
I/O connectivity.
The module communicates by means of an RS-232 transceiver and
operates within a standard industrial range of 0 to +70 degrees C. It
requires only a 150 mA power source.
PHYTEC FlashTools98 enables easy on-board download of user
programs.

Introduction
© PHYTEC Meßtechnik GmbH 2002 L-462e_2 5
phyCORE-ADuC812 Technical Highlights
•subminiature Single Board Computer (55 x 60 mm) achieved
through advanced SMD technology
•populated with an Analog Device microcontroller featuring
8 kByte of on-chip Flash for Code and 640 Bytes of EEPROM
Flash for data, an integrated reference voltage and a temperature
sensor
•ADuC812 microcontroller provides two 12-bit D/A-converters and
an 8-channel 12-bit resolution A/D-converter
•all digital ports as well as data and address lines extend to pin
header rows available at the edge of the board
•the analog inputs and outputs can be accessed over their specific
pin header connector
•128 kByte to 1 MByte SRAM on-board (SMD)1
•128 kByte to 512 kByte external Flash on-board(SMD)1
•on-board Flash programming with FlashTools
•flexible address decoding, configurable with software via complex
logic devices
•Bank latches for the Flash are integrated into the address decoder
•linear access to 16 MByte data via an additional pointer in the
microcontroller
•selectable RS-232 or RS-485 interface
•optional CAN interface with SJA1000 and CAN transceiver
82C251
•I²C Real-Time Clock
•optional 2 to 8 kByte I²C-EEPROM
•three Chip Select signals for connection of external peripheries
•requires only a 5 V /typ. <150 mA power source
1: Please contact PHYTEC for more information about additional modul configurations.

phyCORE-ADuC812
6© PHYTEC Meßtechnik GmbH 2002 L-462e_2
The phyCORE Development Board LD 5V, 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 PHYTEC
phyCORE series Single Board Computers with standard width
(2.54 mm/ 0.10 in.) pin header connectors. Simple jumper
configuration readies the Development Board’s connection to any
phyCORE module (standard header pins), which plug pins-down into
the contact strips mounted on the phyCORE Development
Board LD 5V.
phyCORE Development Board LD 5V Technical Highlights
•Reset signal controlled by push button or RS-232 control line
CTS0
•Boot signal controlled by push button or RS-232 control line
DSR0
•low voltage socket for supply with regulated input voltage 5 VDC
•additional supply voltage 3.3 V
•two DB-9 sockets (P1A, P1B) configurable as RS-232 interfaces
•two additional DB-9 plugs (P2A, P2B) configurable as
CAN interfaces, connector P2B optionally configurable as RS-485
interface
•simple jumper configuration allowing use of the
phyCORE Development Board LD 5V with various PHYTEC
phyCORE SBC’s
•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 Meßtechnik GmbH 2002 L-462e_2 7
1.5 The Keil Software Evaluation Development Tool Chain
The Keil software evaluation development tool chain fully supports
the entire 8051 and 8051-derivative microcontroller family, including
the Analog Device ADuC8xx family. This includes a C compiler,
macroassembler, linker/locator and the simulator and target monitor
within the µVision2 IDE.
The Keil tool chain consists of the following executables:
•C Compiler c51. exe
•Assembler a51. exe
•Linker bl51. exe
•Converter oh51. exe
•µVision2 Uv2. exe (a Windows-based application)
Once installed, the default destination location for the DOS-based
files is the C:\Keil\C51\Bin directory while µVision2 is in
C:\Keil\Uv2. Access to these programs from Windows is accom-
plished within µVision2. The entire tool set can be run from µVision2
or directly from DOS with batch files. The evaluation version of the
Keil tool chain is restricted to a manipulable code size of 2 kByte. In
addition the code will automatically be located at 0x4000 in order to
prevent unauthorized use of this version for programming of common
devices with internal code memory less or equal than 2 kByte. Other
than these restrictions, the evaluation tool chain functions exactly as
the full version does, enabling full evaluation of the features and
functionality of Keil development tools. The full version has no such
restrictions, both are fully ANSI compliant.

phyCORE-ADuC812
8© PHYTEC Meßtechnik GmbH 2002 L-462e_2
µVision2 IDE
µVision2 is a Windows-based Graphical User Interface for the
C compiler and assembler. All compiler, assembler and linker options
are set with simple mouse clicks. µVision2 runs under
Windows 95/98/ME/NT and 2000. This Integrated Development
Environment (IDE) has been expressly designed with the user in mind
and includes a fully functional editor.
All IDE commands and functions are accessible via intuitive pull-
down menus with prompted selections. An extensive Help utility is
included. External executables can be run from within µVision2,
including emulator software.
Figure 1: Keil Tool Chain Overview

Introduction
© PHYTEC Meßtechnik GmbH 2002 L-462e_2 9
C51 C Compiler
The C51 ANSI compiler is specifically designed for the
8051 microcontroller family. The compiler can be run either in a DOS
box under Windows or directly from µVision2.
A51 Macroassembler
The assembler can be run either in a DOS box under Windows or
directly from µVision2.
BL51 Code Banking Linker/Locator
The BL51 linker/locator is used to join re-locatable object modules
and library files together and to locate them to fixed memory
locations. It supports Code Banking for easy management of multiple
code-banks to allow applications with more than 64 kByte of code.
The library and object files created with the C51 compiler or the
A51 assembler are provided by Keil. This process results in absolute
object modules. The BL51 is DOS-based and can be run within a
DOS box under Windows or directly from µVision2. A map file
(*.m51) can be produced, giving details of the memory structure. The
object file may be specified to contain debugging information as
required by simulators, debuggers and emulators. The BL51 also
supports an overlay mechanism for variables to optimize the use of
the size-restricted internal RAM.
OH51 Object-Hex Converter
The Keil OH51 object-to-hex converter transforms an absolute object
file produced by the BL51 Banking Linker into a standard Intel *.hex
file. This file is suitable as an input to the PHYTEC FlashTools98 or
for programming into an EPROM or an emulator. OH51 can be run in
a DOS box under Windows or directly from µVision2.

phyCORE-ADuC812
10 © PHYTEC Meßtechnik GmbH 2002 L-462e_2
Debug Environment
µVision2 contains a software simulator supporting debugging either
via software on a host-PC or in target hardware. When operated in
conjunction with the Keil monitor resident in target hardware
µVision2 enables the following debugging functions:
•run/halt
•set breakpoints
•examine/change memory
•view the stack
•view/set peripheral information
•apply virtual external signals
µVision2 has a performance analysis feature to ensure your code runs
efficiently. In addition, µVision2 has a disassembler/assembler that
allows the modification of user code without recompiling.

Getting Started
© PHYTEC Meßtechnik GmbH 2002 L-462e_2 11
2Getting Started
What you will learn with this Getting Started example:
•installing Rapid Development Kit software
•starting PHYTEC FlashTools98 for Windows download utility
•interfacing the phyCORE-ADuC812, mounted on the phyCORE
Development Board LD 5V, to a host-PC
•downloading example user code in Intel hexfile format from a
host-PC to the external Flash memory using FlashTools98
2.1 Installing Rapid Development Kit Software
•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-ADuC812
12 © PHYTEC Meßtechnik GmbH 2002 L-462e_2
The following window appears:
•Choose the 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 Meßtechnik GmbH 2002 L-462e_2 13
•In the next window, select your Rapid Development Kit of choice
from the list of available products. By using the Change button,
advanced users can select in detail which options should be
installed for a specific product.
All Kit-specific content will be installed to a Kit-specific subfolder of
the Rapid Development Kit root folder that you have specified at the
beginning of the installation process.

phyCORE-ADuC812
14 © PHYTEC Meßtechnik GmbH 2002 L-462e_2
All software and tools for this phyCORE-ADuC812 RDK will be
installed to the \PHYBasic folder 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.
If you decide to copy the electronic documentation to your hard drive,
the documentation for this phyCORE-ADuC812 RDK will also be
installed to the kit-specific subfolder. The manuals of the phyCORE
Development Board LD 5V are copied to their own specific subfolder
(e.g. \PHYBasic\DevBLD5V) because each Development Board is
suitable for multiple SBC’s and is not dedicated to a specific RDK.
Setup will now add program icons to the program folder, named
PHYTEC.
•Click on Finish to complete the installation of PHYTEC products.

Getting Started
© PHYTEC Meßtechnik GmbH 2002 L-462e_2 15
•In the next window, you choose the Keil EK51 software
development tool chain1.
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 µVision2 from the Spectrum
CD-ROM even if other versions of µVision2 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 another.
•After accepting the Welcome window and license agreement,
select the destination location for installation of the Keil
evaluation development tool chain. The default location is C:\Keil.
1: If installing the Tasking tool chain, please refer to the corresponding QuickStart manual.

phyCORE-ADuC812
16 © PHYTEC Meßtechnik GmbH 2002 L-462e_2
Depending on the Rapid Development Kit software you have se-
lected, the Keil evaluation development tool chain will be installed to
your hard drive. Additional software, such as Adobe Acrobat Reader,
will also be offered for installation.
In the following windows you can decide to install FlashTools98
software and the Acrobat Reader.
The applicable FlashTools software 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.
Other manuals for phyCORE-ADuC812
1
Table of contents
Other Phytec Single Board Computer manuals

Phytec
Phytec phyCORE-AM65x User manual

Phytec
Phytec phyCORE-P8xC51Mx2 User manual

Phytec
Phytec PhyBOARD-Mira i.MX6 User manual

Phytec
Phytec phyCORE-XC167 User manual

Phytec
Phytec phyCORE-AM64xx User manual

Phytec
Phytec phyCORE-TC1796 User manual

Phytec
Phytec phyCORE-OMAP44 Series User manual

Phytec
Phytec phyCORE-AM64 Series User manual

Phytec
Phytec phyBoard Wega AM335x User guide

Phytec
Phytec phyCORE-i.MX7 User manual