Keil Uvision3 Quick Start
Keil Uvision3 Quick Start
The Keil µVision3 IDE supports over 700 devices including ARM-powered,
XC16x, C16x, ST10, 251, and 8051-based microcontrollers.
www.keil.com
Project Management
Co ge nts
St ild t
Se ect
Bu late
Re Ta urre
Fl
M po
Tr
Ta Do oce
Pr
Co
as d Pr
op Ta
an n e
an
lec Ta
rg w
oj
bu rge nt
nf Pro
ild c
m
h
a
s
et nl s
igu je
Bu ge
t c rge
O oa
re ct
ur ts
il t
pt d
re
Ed
r
io
nt
ito
ns
r
s
file
Development Tool Options
µVision3 allows you to set tool options by
target, group, and source file. The options
dialog opens via the context menu of the
Project Workspace and provides tabs for:
+ Device: Allows you to view and change
the selected target CPU.
+ Target: Allows you to specify CPU and
memory options. These are used to
configure basic tool settings including those
of the linker, debugger, and simulator.
Typically, these are the only settings you
must make to begin a new project.
+ Output/Listing: Allow you to configure
the generated object and listing files. The Device Database™ pre-configures tool settings for the selected CPU.
+ Compiler/Assembler/Linker: Allow you Only few dialogs pages are required for complete tool setup.
to view and change tool-specific options.
+ Debug: Allows you to configure the
µVision3 Simulator and Debugger.
+ Utilities: Allows you to configure project-
specific tools (like Flash programming).
Build Process
The Build Target command runs the
Compiler and Assembler. The tools The Configuration Wizard provides a graphical editor for startup files,
automatically generate file dependencies so configuration code, debugger INI files, and linker scripts.
only those files that have changed are re-
translated. You may enabled additional Global
Code Optimizations which are performed by
incremental re-compilations of C modules.
Flash Download
Flash Download features are included in some
Target Drivers (like the EPM900 LPC
Emulator/Programmer and the Keil ULINK
USB JTAG-Adapter).
Additionally, you may integrate external Flash
utilities (and their command-line options) into
the µVision3 project setup. The Utilities tab adds Flash Download Utilities configuration to the project.
3
Source Code Editor
Editor Toolbar
Execution Profiling
U
nin
O file
Cu ll fil
Co
Cl in Boo rk
O
Sa file
Sa file
Se
In
In
In
Ki Br k
N
Pa
Re
N gle
Pr t B ok
Fi iou km ark
Fi
D ent
Pr
Pr
En ll Br kpo
D le/D ks
U
To
To ut W ow
pe
ut
nd s a
nd
nd
eb
isa is
de
ea Fil k
cr
se rea w
ew
ex Bo
ll a ea
ve
ve
de
ar
ev oo m
in
oj
ste
t
do
gg i
ab ea int
py
p
em
rt
n
ec
r a es ma
ch
o
ug l Fin
nt
b l ab
nt
le n d
a
e
tW
ll B
B o
Te
all le
es
xt
oo
in
a
d
km
d
ar
rk
ks
The µVision3 editor offers many standard and
advanced software editing features. Color
syntax highlighting and text indentation are
optimized for editing C source code. Most
editor functions may be quickly accessed from
the toolbar or the context menu. Program
debugging is directly controlled in the editor.
This natural environment allows you to quickly
integrate and test source code changes.
Advanced Features
µVision3 adds many new editor features like:
+ Incremental Find positions the cursor
while you type the search phrase. µVision3 includes all standard editor features. Advanced Features provide t
+ Active Brace Checking shows nesting an overview of source files and help you complete your task faster. :
and highlights mismatches while entering
parentheses, braces, or brackets. .
Active Brace Checking provides an overview of
+ Text Block Functions that Comment, complex statements. When editing source files,
Indent, Uppercase, Tabify, and Remove matching parentheses, braces, or brackets are
Whitespace from text blocks. marked in grey—mismatches are shown in red.
+ 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.
-
Functions and Templates
The Functions Tab in the Project Workspace
displays all functions in either your project or
open editor files. You may click on a function ,
to jump to its definition.
The Templates Tab shows user-defined text Define templates under
blocks (templates). To insert a template into Edit - Configuration.
your source file, type the first few letters of Insert them from the
The Function Tab alphabetically lists Templates Tab or by entering
the name followed by Ctrl+Space or click
functions in your project. the first few letters of the name
the item in the Templates Tab. followed by Ctrl+Space.
Click to jump to the function definition.
4 µVision3 - Quick Start
Editor Utilities
Source Browser
The integrated Source Browser (available for
Keil Cx51, C251, and C166) maintains a
database of your program symbols for quick
navigation through your source files. You may
use the detailed information to optimize the
memory types of variables.
St St
ep ep
Co ch W y W s
H
Sin xec
Sh ill C
Sh le T tat
Se e C do dow
Re
Ru PU
Ru
En ne or
D Tra Re nt
M Win rage
Pe or ow
To ic A nce ow
Lo orm in 1
W sem eco ding
alt
isa ce co
em d
ria ov w
ow ur
ow rac em
O O
a t bl
rf y W #
se
o l na A
ab xt line
n
d
gle uti
g a d
ve ut
b o ly n
t
E
tC
l e
St on
r
x zs aly
ep
in n
s
In
e e
R r
to
er ze
i
rd .
r
The µVision3 IDE/Simulator/Debugger
accelerates your learning efforts by providing a
single environment for editing, simulating, and
testing target hardware. Most debugger and
editor functions may be quickly accessed from
the toolbar.
You may use the context menu or the Editor
Toolbar to insert breakpoints. Breakpoints
you set while editing are activated when you
start your debugging session.
µVision3 marks the status of each source line
in the Attributes column of the editor
window. This provides a quick overview of
the current breakpoint and execution status. The Disassembly Window includes a trace history that shows the
last CPU instructions executed prior to a breakpoint.
Attributes
Complex Breakpoints Bookmark
In addition to simple breakpoints, the µVision3 No Executable Code
Enabled Breakpoint
Debugger supports complex breakpoints (with Code already executed
conditional or logical expressions) and Current PC, next statement
memory access breakpoints (with read and/or Disabled Breakpoint
write access from an address or range). Selected line from Output Window
Code is not executed
Complex breakpoints may be defined in the
Breakpoint dialog (available from the Debug
menu). For each breakpoint, you may include
a command to execute and a count before the
breakpoint is triggered. Commands which are
executed when the breakpoint is triggered
may even invoke debug functions.
Memory and Watch Window The Breakpoints Dialog allows you to define complex breakpoints on
conditional expressions or different memory access types.
The Memory Window displays various
memory areas. You may select the output
format or change values via the context menu.
The Watch Window display and allows you to 2
change variables values. The variables of the
current functions are shown under the Locals 2
tab whereas the Call Stack tab lists the
program call tree. The Watch and Memory Windows allow you to view variables and memory. .
Select display formats with context menu commands.
6 µVision3 - Quick Start
Debugger CPU and Peripheral Simulation
Communication Interfaces
µVision3 supports simulation of I/O interfaces
like CAN, I2C, and UARTs. Serial Windows
provide terminal simulators for the on-chip
UARTs. CAN and I2C Windows show message
. traffic and bus configuration details.
Serial windows display UART output from your applications.
You may type characters to receive into the selected serial window.
7
Debug Scripts and Signal Functions
VTREG Description
CANxID CAN Message Identifier
CANxL Length of the CAN Message
CANxBx Data bytes of the CAN Message The CAN controller status can be reviewed in dialog pages. The CAN
CANxIN Status of incoming Message Communication Page is an analyser which displays all CAN message. Remote Control Interface
CANxOUT Status of outgoing Message
CANTIMING Adjust CAN bus timing
)
Using these VTREGs you may create a user
function that sends a CAN message with 3
l
data bytes to the application. For example:
This function may be called from a signal You may use debug scripts to analyse CAN messages. A breakpoint on write
access to the VTREG CANxOUT may be used to trigger a user function.
function to repeatedly send this CAN External Tools
message. You may create user functions that
generate automated replies to CAN messages.
This is shown in application notes provided at
www.keil.com/appnotes.
The Output Window displays printf status information of debug scripts.
8 µVision3 - Quick Start
Source Code Editor Advanced Simulation Features
Execution Profiling
µVision3 for ARM provides an execution
profiler that records execution statistics for
each CPU instruction. You may review the
execution count or execution time in editor
and disassembly windows. Editor outlining
provides an overview of the source code.
You may use the information gathered by the
execution profiler to determine where your
program spends most of its time. Then, you
can concentrate your efforts on making that Execution Profiling shows how many times
section run faster. each line of code has executed and the total execution time.
Logic Analyzer
The Logic Analyzer records the values of
variables and peripheral I/O signals over time
and displays them in the Logic Analyzer
Window. The cursor line allows you to set a
reference time and review delta values.
The Logic Analyzer provides three different
display formats:
+ Bit: Shows output as a logic level (0 or 1).
+ State: Shows state changes of a value.
+ Analog: Shows a graphical display.
You can easily generate complex digital or
analog input signal patterns using signal
The Logic Analyzer records signals you select. The above recording shows a
functions you define using the debugger’s C PWM output, A/D input, and analog signal generated by a signal function.
script language. This allows detailed testing of
.
signal processing algorithms at simulation level FUNC float sine_wave (float f) {
without using extensive hardware equipment. return __sin (f * (STATES / CLOCK) * 2 * PI);
}
Product Highlights
µVision3 reduces your learning curve, shortens the
development/testing cycle, and helps you build reliable,
stable applications. To accomplish this, µVision3 offers:
+ The Device Database™ (available on Internet and in
µVision3) to pre-configure the tools. This minimizes
mistakes in project setup and gets you started quickly.
+ A full-featured Editor (integrated into the Debugger)
that allows source code changes at any time.
+ The Debugger which accurately simulates target
systems including instructions and on-chip peripherals.
Test application code before hardware is available.
Optimize your hardware design prior to production.
+ Chip-specific dialogs which allow you to review status The Device Database™ on www.keil.com/dd provides detailed
information and rapidly configure peripherals. information about the chips supported by Keil development tools.
+ Identical Simulator and Target Debugger interfaces.
+ Integration with third-party tools like SVCS, CASE, and
Flash/Device Programming utilities. All configuration
details are saved in a single, consistent project.
+ The µVision3 Debugger which interfaces to the Keil
ULINK USB-JTAG Adapter and other third-party
diagnostic tools.
Keil Elektronik GmbH and Keil Software, Inc., have representatives in the following countries:
Australia, Austria, Belgium, Brazil, Canada, China, Czech, Denmark, Finland, France, Germany, India, Ireland, Israel, Italy, Japan, Korea, Malaysia, Mexico, Netherlands,
New Zealand, Norway, Poland, Portugal, Russia, Romania, Singapore, Slovenia, Slovakia, Spain, South Africa, Sweden, Switzerland, Taiwan, Turkey, Thailand,
United Kingdom, and United States.