Note: The PHYTEC Spectrum CD includes the electronic version of
the English phyCORE-LPC2292/94 Hardware Manual
Edition: June 2005
A product of a PHYTEC Technology Holding company
Page 2
phyCORE-LPC2294QuickStart Instructions
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.
EUROPENORTH AMERICA
Address:PHYTEC Technologie Holding AG
Robert-Koch-Str. 39
D-55129 Mainz
GERMANY
Ordering
Information:
Technical
Support:
Fax:+49 (6131) 9221-331 (206) 780-9135
Web Site:http://www.phytec.dehttp://www.phytec.com
•an overview of Keil's ARM7/µ Vision3 software development tool
chain evaluation version, and
• instructions on how to run example programs on the
phyCORE
-LPC2294, mounted on the PHYTEC phyCORE
Development Board HD200, in conjunction with the Philips
LPC2000 Flash Utility for internal Flash, the Keil ULINK and
software tools
-LPC2294 Single
Please refer to the phyCORE
-LPC2292/94 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
-LPC2292/94 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
• 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
in conjunction with the Keil ARM7/µVision3 software
development tool chain
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
ARM7/µVision3 software tools. It is structured as follows:
1) The "Getting Started" section uses three examples:
2) The "Getting More Involved" section provides step-by-step
-LPC2294 in conjunction with the Keil ULINK and
Blinky to demonstrate the download of user code to the internal
Flash device using the Philips LPC2000 Flash Utility
Blinky and Hello to demonstrate the download of user code to
the external Flash device using the Keil ULINK and
ARM7/µVision3 software tools
instructions on how to modify both examples, create and build
new projects and generate and download output files to the
phyCORE
-LPC2294 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.
The phyCORE-LPC2294 represents an affordable yet highly
functional Single Board Computer (SBC) solution in sub-miniature
dimensions (60 x 53 mm). It is intended for use in memory-intensive
applications running within a multi-node CAN bus system. The
standard module is populated with a Philips LPC2294 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
"big chip" into target hardware.
The standard module runs at a 60 MHz internal clock speed
(delivering 50/10 ns instruction cycle) and offers 1 MByte (up to
8 MByte) SRAM and 2 MByte (up to 16 MByte) Flash on-board for
DATA and CODE storage.
-LPC2294 to be plugged like a
The module communicates by means of two RS-232 transceivers,
two (four optional) CAN bus interfaces, and a SMSC LAN91C111
10/100BaseT Ethernet controller which enables implementation of the
module in embedded Internet applications. The
phyCORE
-LPC2294 operates within a temperature range of -40°C to
+85°C and requires only a 300 mA power source.
The Keil ARM/µVision3 software tools, in conjunction with the Keil
ULINK adapter, enables easy on-board download of user programs.
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
highdensity series Single Board Computers. Simple jumper configuration
readies the Development Board’s connection to the
phyCORE
-LPC2294, 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
phyCORE
Development Board HD200 with various PHYTEC
high-density SBCs
• socket for RJ45 Ethernet transformer module
• one control LED (D3) for quick testing of user software
• 2x 160-pin Molex connector (X2) enabling easy connectivity to
1.5 Keil ARM7/µVision3 Software Development Tool C hain
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 ARM7compatible devices including the Philips LPC2000 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:
Introduction
• 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.
What you will learn with this Getting Started example:
• installing Rapid Development Kit software
• interfacing the phyCORE-LPC2294, mounted on the
Development Board, to a host-PC using the Keil ULINK
• downloading example user code in hex-file format from a host-PC
to the internal Flash memory using the Philips LPC2000 Flash
Utility
• downloading example user code from a host-PC to the external
Flash memory using ARM7/µVision3 tools
2.1 Installing Rapid Development Kit Software
Getting Started
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.
• 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.
• In the next window select your Rapid Development Kit of choice
from the list of available products.
Getting Started
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.
All software and tools for this phyCORE-LPC2294 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.
If you decide to copy the electronic documentation to your hard-drive,
Getting Started
the documentation for this phyCORE
-LPC2294 RDK 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 and µ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 another
1
.
1
:Note: If you have a full version of the Keil ARM7 tools already installed on your host-P C 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.
• 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.
In the following windows you can decide to install Philips LPC2000
Flash Utility software and the Acrobat Reader. The LPC2000 Flash
Utility 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.
• Click OK and follow the Flash Utility Setup instructions.
• Decide if you want to begin the QuickStart Instruction
immediately by selecting the appropriate checkbox and click on
Finish to complete the installation.
Connecting the phyCORE-LPC2294, mounted on the phyCORE
Development Board HD200, to your computer is sim ple.
• 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-LPC2294
Note:
If you do not have a Keil ULINK adapter, skip the following two
bullet points.
• The ULINK JTAG adapter comes with various flat-band cables. In
order to connect this device to the phyCORE
-LPC2294 module
you need to install a flat-band cable with a 2.0 mm connector. If
such a cable is not already installed on your ULINK open the
enclosure and connect the correct 2.0 mm to 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.
• Connect the other 2.0 mm cable connector onto pin header rows
X701 on the phyCORE
module. Make sure that pin #1 on the
ULINK cable (black wire) is correctly connected to pin #1 on
JTAG connector X701 (located on the connector side of the PCB)
of the phyCORE
-LPC2294 (refer to Figure 2).
19
1
X701
Figure 2:JTAG Connector X701 on the phyCORE-LPC2294 (Bottom View)
• Mount the phyCORE module, pins-down, 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 De velopment 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.
• The red power LED D2, located next to the power socket at X1,
should light. This indicates that proper voltage is supplied to the
phyCORE
module/Development Board combination (which is
also referred to as "target hardware" within this document).
• The phyCORE
-LPC2294 should now be properly connected to a
host PC via the Development Board and, if available, Keil ULINK .
You are now ready to use the Keil ARM7/µVision3 tools to
establish communication between the host-PC and target
hardware.
2.3 Downloading Example Code with Philips LPC2000 F l ash
Utility
The Philips LPC2000 Flash Utility should have been installed during
the initial setup procedure as described in section 2.1. If not, you can
manually install it using the setup.exe file located in the folder
\Software\Philips\LPC2000 Flash Utility.
Among other tasks, the LPC2000 Flash Utility program downloads
user code in Intel *.hex file format from a host-PC to on-chip Flash
on an LPC229x device populating a PHYTEC SBC via an RS-232
connection.
Note:
Successful completion of this section requires that any user code
residing in external Flash be erased. This is because, upon reset, the
user code in external Flash will execute rather than user code in
internal Flash. For instruction on erasing the external Flash refer tothe instructions for Erasing Flash insection 2.4.1. Typically
PHYTEC Rapid Development Kits are shipped with a blank external
Flash.
• Be sure the correct Device is selected as LPC2294 and XTAL Freq
is set to 10000 kHz.
• Be sure that the correct Communication Port is set for your
host-PC and select a 9,600 baud rate.
• Click on the Upload to Flash button.
1
:NOTE: PHYTEC typically refers to the process of loading a machine readable file from a
host-PC into a Flash device populating a PHYTEC Single Board Computer as "download". In
this section we will use the term "Upload to Flash" as defined within the Philips LPC2000
Flash Utility for reasons of being consistent with their terminology. In all other sections of
this manual we will use the term "Flash download".
The µVision3 evaluation software development tool chain should
have been installed during the install of the PHYTEC Rapid
Development Kit Software from the Spectrum CD, as described in
section 2.1.
You can also manually install the ARM7/µVision3 tools by executing
KARM220.EXE from within the \Software\Keil\Arm directory of
your PHYTEC Spectrum CD. Follow the instructions displayed by the
setup program for manual installation.
Note:
It is recommended to use the Keil tool chain provided on the
accompanying Spectrum CD in order to complete this QuickStart
Instruction successfully. Use of a different version could lead to
possible version conflicts, resulting in functional problems1.
Getting Started
Start the tool chain by selecting Keil µVision3 from within the
µ
programs group: Start\Programs\Keil
Vision3 or by double-clicking
on the Keil µVision3 icon on your desktop.
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 DK-ARM 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 DK-ARM tools is used.
After you start µVision3, the window shown below appears. From
this window you can create projects, edit files, configure tools,
assemble, link and start the debugger. Close all projects that might be
open by selecting Project / Close Project.
2.4.1 "Blinky"
The "Blinky" example downloads a program to external Flash that,
when executed, manipulates the LED D3 on the phyCORE
Development Board HD200.
•Open the Blinky project from the µVision3 menu Project / Open
Project.
• Browse to C:\PHYBasic\pC-LPC2294\Demos\Keil\Blinky.
• Build the target by either selecting the Build Target icon on
the build toolbar or in the main menu bar select Project / Build
target.
• If any source file of the project contains any errors, they will be
shown in the Output Window - Build tab. Use the editor to
correct the error(s) in the source code, save the file and repeat the
build.
• If there are no errors, the code is ready to be downloaded into the
external Flash memory.
Download to Flash
• Download the code into Flash memory by either selecting the
Download to Flash Memory icon
on the build toolbar or in the
main menu bar select Flash / Download.
• The individual steps of the Flash download procedure can be
viewed at the bottom of the µVision3 Output Window - Build
tab.
• Wait until the programming is complete. This is indicated by the"Verify OK" message. The download utility will perform a reset
and the code will execute without further user interaction.
Successful execution of the program will flash the LED D3 with equal
on and off duration.
Erase Flash
• To erase Flash, select Flash/Erase from the uVision toolbar. This
requires that a project with an XFLASH target is open.
The "Hello" example downloads a program to the external Flash that,
when executed, sends a character string from the target hardware back
to the host-PC. The character string can be viewed with a terminal
emulation program. This example program provides a review of the
Flash download procedure using the Keil ULINK and µVision3.
Monitoring the execution of the Hello demo requires use of a terminal
program, such as the HyperTerminal program included within
Windows.
•Start the HyperTerminal program within the Programs
/Accessories/Communications bar.
• The Connection Description window will now appear. Enter
• Next click on OK. This creates a new HyperTerminal session
named "COM Direct" and advances you to the next
HyperTerminal window. Specify COM1 under the Connect Using
pull-down menu (be sure to indicate the correct COM setting for
your system).
• Click OK to advance to the next window (COM1 Properties).
• Then set the following COM parameters: Bits per second = 9,600;
Data bits = 8; Parity = None; Stop Bits = 1; Flow Control = None.
• If any source file of the project contains any errors, they will be
shown in the Output Window - Build tab. Use the editor to
correct the error(s) in the source code, save the file and repeat the
build.
• If there are no erorrs, the code is ready to be downloaded into the
Flash memory.
Download to Flash
• Click on the Download to Flash Memory icon
in the build
toolbar to download the code into Flash memory.
• Wait until the programming is complete. This is indicated by the
"Verify OK" message. The download utility will perform a reset
and the code will execute without further user interaction.
•Successful program execution will send the character string "Hello
World" from the target hardware to the HyperTerminal window.
• If no output appears in the HyperTerminal window check the
power supply, the COM parameters and the RS-232 connection.
The code within the demo application Hello initializes the serial port
of your phyCORE-LPC2294 to 9600 baud. The initialization values
are based on the assumption that the microcontroller runs at a 60 MHz
internal clock frequency. If your phyCORE-LPC2294 is equipped
with a different speed oscillator, the demo application might transmit
using another baud rate. This may lead to incoherent characters
appearing in the HyperTerminal window following execution of code.
• Click the disconnect icon in HyperTerminal toolbar and exit
• The Select Device for Target ’Target1’ window will automatically
appear. Select Philips as manufacturer for the CPU. The
phyCORE
-LPC2294 is populated with an LPC2294 CPU.
Choose the controller type from the list as shown below. This
selection sets necessary tool options for the LPC2294 device and
simplifies in this way the project configuration.
• Click on OK to save the settings.
• The uVision3 dialog box "Copy Philips LPC2100 Startup Code to
Project Folder and Add File to Project?" will appear.
• Click on No to not include this default startup code! The default
startup code provided by Keil does not match the
phyCORE-LPC2294 hardware properties. The correct startup file
called startup_phyCORE-LPC2294.s will be added to the project
later.
• The Project Workspace window should appear as follows:
Getting More Involved
At this point you have created a project called Blinky2.uv2 and added
an existing C source file called Blinky2.c and Time2.c and an existing
assembly source file called Startup_phyCORE-LPC2294.s. The next
step is to modify the C source file before building your project. This
includes compiling, linking, locating and creating the machinereadable file.
NOTE:
Always use the Startup_phyCORE-LPC2294.s file provided by
PHYTEC in your application project. This startup file contains the
correct controller setting for access to external memory and other
on-board components. Using other startup code, e.g. the default Keil
startup code that is offered when creating a new project will lead to
functional problems and may cause your application code to not
execute as desired.
Keil includes a Make utility that can control compiling and linking
source files in several programming languages. Before building your
project you must configure the target options. Most of the options are
set when specifying the target device for the project.
Enter the changes as indicated below and leave all other options set to
their default values. µVision3 allows you to set various options with
mouse clicks and these are all saved in your project *.opt file.
•Configure options for target by selecting the Options for Target
Getting More Involved
icon
on the build toolbar or right-click on the
phyCORE-LPC2294 XFLASH target in the Project Workspace
window and select Options for Target ‘phyCORE-LPC2294
•In the Target tab be sure that the Xtal is set to 10 MHz and Use
On-chip ROM(0x0-0x3FFFF) as well as Use On-chip
RAM(0x40000000-0x40003FFF) are not checked. Set the External
Memory #1 to ROMand #2 to RAM and set the Start and Size as
• In the main µVision3 menu select File / Save All.
3.4 Building the Project
You are now ready to run the compiler and linker using the Make
utility.
• Build the desired target by either selecting the build icon
the build toolbar or in the main menu select Project / Build target.
If any source file of the project contains any errors, they will be
shown in the Output Window - Build tab. Use the editor to correct
the error(s) in the source code and save the file and repeat the build.
If there are no errors, the code is ready to be downloaded into the
Flash memory.
This Debugging section provides a basic introduction to the debug
functions included in the Keil ARM7/µ Vision3 evaluation tool chain.
Using an existing example, the more important features are described.
For a more detailed description of the debugging features, please
refer to the appropriate manuals provided by Keil.
The µVision3 Debugger offers two operating modes that can be
selected in the Project|Options for Target phyCORE-LPC2292/94
dialog:
• The Simulator allows PC-based simulation of most features of the
LPC2294 microcontroller without actually having target hardware.
You can test and debug your embedded application before the
hardware is ready. µVision3 simulates a wide variety of
peripherals, including external I/O and timers. The peripheral set is
configured when you select a CPU from the device database for
your target.
Debugging
•USB-JTAG debugging interface adapters such as the Keil
ULINK, allow target-based debugging. With the ULINK interface
you may connect directly to the target hardware using the JTAG
interface. Debugging on the target hardware also enables the
testing of peripheral components of the application and real-time
program execution.
The following examples utilize the ULINK ARM Debugger
environment.
• Go to Project / Components, Environment, Books… from the
Debugging
menu or select the
icon on the toolbar. Select the
Folders/Extensions tab and be sure that Use Keil ARM Tools
under Select ARM Development Tools box is selected.
• Save the project.
• Double-click on the Debug.c file to open the source code window.
At this point you have created a project called Debug.uv2, consisting
of the C source files called Debug.c and Serial.c and the assembler
file Startup_phyCORE-LPC2294.s.
4.1.2 Setting Options for Target
•In the Select Target pull-down menu make sure the
phyCORE-LPC2294 XRAM target is selected.
• Configure options for target by selecting the Options for Target
icon
on the build toolbar or right-click on the
phyCORE-LPC2294 XRAM target in the Project Workspace
window and select Options for Target ’phyCORE-LPC2294
•In the Target tab be sure that Xtal is set to 10 MHz, and
Use On-chip ROM (0x0-0x3FFFF) as well as Use On-chip RAM
(0x40000000-0x40003FFF) are not checked. Set the External
Memory #1 to ROMand #2 to RAM and set the Start and Size as
You are now ready to run the compiler and linker using the Make
utility.
Debugging
• Build the target by either selecting the build icon
on the build
toolbar or in the main menu select Project / Build target.
If there are no errors, the code is ready to be downloaded into the
external SRAM for further debugging steps. Before starting the
debugger first open HyperTerminal again using the same settings as
described in section 2.4.2. This allows you to monitor the
printf
outputs over the RS-232 port.
4.2 Starting the Debugger
• To start the ARM7/µVision3 debug environment, click on the
debugger icon
• You will see a blue status bar from left to right at the bottom of
your screen indicating the download process of the debug
program.
If a problem occurs during data transfer, an error message will be
displayed. If this should occur, make sure the target hardware is
properly connected to a power supply and the host-PC using the Keil
ULINK device (refer to section 2.2).
If the data transfer was successful, a screen similar to the one shown
below will appear. The Project window changes to the Register page
and the Disassembly window becomes active. The debug toolbar is
also displayed. In the lower part of the debug screen you will see the
Comm and and Watch windows.
You may need to open, resize and /or move some windows to make
your screen look similar to the screen capture. You can open inactive
windows by choosing the desired window from the View pull-down
menu.
• Change to the Debug.c source window by clicking on the
corresponding tab.
The debugger will run to the ’main’ function and stop automatically.
Notice the yellow arrow pointing to the first command in the ’main’
function. Also notice the program counter (PC $) within the ProjectWindow – Register page showing the start address of the ’main’
function.
• The Debugger window toolbar gives access to the following
debug commands: Reset, Run, Stop, Step Into, Step Over, Step Out
and Run to Cursor line .
Reset
Run
Stop
Step Into
Step Over
Step Out
Run to Cursor lin e
• The first button on the debugger toolbar is the Reset
button.
The Reset command sets the program counter to 0.
• The button to the right of the Reset button starts the Run
comma nd.
Clicking this button runs the program without active debug
functions. To stop program execution at a desired point, a
breakpoint can be placed before the Run button is pushed.
• The next button on the debugger toolbar is the Stopbutton.
The Stop button interrupts and stops the running program at an
• The first button allowing exact control of the program execution is
the Step Intobutton.
The Step Into command performs the execution of the command
line to which the Current-Statement Arrowpoints. This can
be a C command line or a single assembler line, depending on the
current display mode. If the command line is a function call, StepInto jumps to the C function or subroutine, enabling you to explore
the code contained in the accessed subroutine.
• The StepOverbutton is next on the debugger toolbar.
The StepOver command executes the command line, to which the
Current-Statement Arrowpoints. This can be a C command
line or a single assembler line, depending on the current display
mode. If the command line is a function call, the function will be
executed without single stepping into the function.
•The next button is the Step Out button..
Step Out is used to exit a function you are currently in. Step Out is
very useful if you find yourself in a function you are not interested
in and need to return quickly to your intended function.
•The last button on the debugger toolbar performs the Run to
Cursor line command.
The Run to Cursor line command executes the program to the
current cursor position within the code window. This allows use of
the cursor line as a temporary breakpoint.
• Activate the Debug.c file by clicking on the Debug tab.
Debugging
• Click in the source code, line 37,
for (x = 0; x < rhythm[blink]; x++)
at
•Click on Insert/Remove Breakpointto set a breakpoint here.
The red marker on the left-hand side of the selected line indicates
the breakpoint. You can also set a breakpoint by double-clicking
in the desired code line.
•Click on the Runicon and the program will run and stop at
the breakpoint.
•Notice that the LED (D3) on the Development Board now
illuminates.
•Also notice the output message in HyperTerminal that comes from
the
printf statement in line # 30 and #36.
•Click again on Insert/Remove Breakpointto remove the
•Open the Watch and Call Stack Window from the View pull-
down menu.
•Click on the Step Intoicon to enter the
for{}
loop.
•The Watch window – Locals tab automatically shows the value
of the local variable x. Change the number base from hexadecimal
to decimal by right-clicking on the variable.
• Click Step Over several times and watchthe value of x count up.
• As you can see in the source code, the
for{}
loop will end if x
becomes equal to the first element of the constant field rhythm[]
which has the value of 180,000. To leave the wait function,
change the value of x by typing x=179996 in the command line
and press <Enter>. Now repeat clicking on Step Over until you
leave the wait function.
•Click in the source code, line 44, at blink++ and choose Run to
Cursor line from the debug toolbar. Your program will be
executed until it reaches this line.
•Notice that the LED D3 on the Development Board is off now and
a new output message appeared in your H yperTerminal window.
• As a last example, the constant "rhythm[]" will be evaluated. Go
to source code line #18 where the constant "rhythm[]" is declared.
Right-click on "rhythm[]" and choose the "ADD rhythmtowatch window" -> #1 option. Select the "Watch #1" tab at the
bottom of the watch window. The constant is shown with its
address and a smallsign in front which indicates that
"rhythm[]" is an array with a group of array elements. Click the
sign to expand the view and to see all array elements of
"rhythm[]".
Debugging
4.5 Running, Stopping and Resetting
• To run your program without stopping at any time, delete all
breakpoints by clicking on thebutton.
• Click the Runbutton.
The LED now blinks at changing on/off intervalls.
You can use the Stopbutton to stop program execution at any
time.
4.6 Changing Target Settings for the "Executable V ersion"
After successfully debugging the program, next change the project
and the target settings in order to create an executable file that can
then be downloaded to and executed out of the Flash memory on the
phyCORE
• Make sure the program execution is stopped.
• Exit the current debug session by selecting Debug|Start|Stop
Debug Session.
• We recommend adding a new target to the debug project. This
allows you to use the same C source files but different target
settings to be used for debugging (XRAM) and Flash download
(XFLASH).
-LPC2294.
• Click on the
• Add another target by selecting the New(Insert) icon
icon in the build toolbar.
in the
Project targetswindow. Name the new target
phyCORE-LPC2294 XFLASH .
• Click OK to return to the µVision3 window.
• In the Select Target pull down menu select
phyCORE-LPC2294 XFLASH.
• Configure options for target by selecting the Options for Target
icon
on the build toolbar.
• Set all target options as described in section 3.3 and build the
project.
• Download the created Debug file to the external Flash memory.
For general download procedure information refer to section 3.5.
• Start the HyperTerminal program as described in section 2.4.2.
• The Debug code will start automatically at the end of the
download.
Now you can watch your final debug example execute. The
HyperTerminal will display the status of the LED.