Keil C166 V4 Product Brochure · EasyCASE Right-click to open context sensitive menus in local...
Transcript of Keil C166 V4 Product Brochure · EasyCASE Right-click to open context sensitive menus in local...
TM
Keil C166 unlocks the features and the performance of the
Infineon 166 and ST Microelectronics ST10 microcontroller
families. C166 is fully integrated into the µVision2 IDE that
combines Compiler, Assembler, Real-Time OS, project manager,
and debugger in a single, intelligent environment. Extensions
incorporated into the C166 compiler give you full access to all
CPU resources.
C166 Version 4 is the most efficient and flexible 166/ST10
development tool set available today. With support for all
derivatives and full compatibility with emulators and other third
party development tools, C166 Version 4 is clearly the best choice
for your 166 and ST10 projects.
True Integration
This Brochure Contains Information About:
µVision2 Integrated Development Environment...................Page 2
C166 Optimizing ANSI C Compiler ......................................Page 4
RTX166 Real-Time Kernel.....................................................Page 6
Program Debugging and MCB167/NET CPU Board.............Page 7
Versatile
Debugger Interfaces
Global Code Optimization
and MAC support
The µVision2 IDE truly integrates project management and debugging.
www.keil.com
166 & ST10 Development Tools
Project Management
Build Project
Integrated Utilities
Targets
File Groups
Device Database
Tool Options Target
Group
Find in Files
DAvE
let you create several programs
from a single project. Each target has its
own tool settings. With you
organize source files into functional blocks.
Select the microcontroller you use from the
and µVision2 sets all
necessary options automatically. Set
memory parameters in the Target Tab and
µVision2 configures the basic tool options
including the linker/locater settings and the
debugger simulation driver.
You may set for a ,
of files, or a single source module.
During the make process, include file and
source file dependencies are analyzed and
only those files that have changed are built.
Incremental re-translations are performed
when global register optimization is enabled.
µVision2 contains powerful features that
help you complete your projects on time:
performs a global text
search in all specified files.
Infineon’s assists you with CPU
and peripheral programming. DAvE
projects can be directly imported into
µVision2.
�
�
�
�
�
�
�
The integrated uses a
symbol database for quick navigation
through your source files. Use the
detailed symbol information to optimize
the memory types of your variables.
The allows you to start user
utilities within the µVision2 IDE.
A configurable interface provides
access to Version Control Systems.
The interface gives you
advanced syntax analysis of your
application code.
The Infineon interface
integrates block level code generation.
Source Browser
Tools Menu
SVCS
PC-Lint
EasyCASE
Right-click to open context
sensitive menus in local windows.
In the Editor Window, you can
access browser information or
debugger commands.
The simplifies tool configuration and
provides options that are relevant for the selected CPU.
Device Database
The Edit, Build, and Debug toolbar gives you quick access to
important editor, IDE, and debugger commands.
2 166 & ST10 Development Tools
µVision2 IDE
Use the Source Browser for fast navigation to definitions and references.
Source Code Editor
Breakpoints
Debug Function Language
Variables and Memory
The µVision2 editor includes all the editing
features to which you are accustomed.
Color syntax highlighting and text
indentation are optimized for C source
code. The editor is available while
debugging your program. This gives you a
natural debugging environment that lets you
quickly test and correct your application.
µVision2 lets you set program breakpoints
while editing (even before the source code
is compiled or assembled). Breakpoints are
activated when you start the µVision2
Debugger and may be set on conditional
expressions or variable and memory
accesses. Debugger commands or debug
functions may be executed when
breakpoints are triggered.
The column provides a quick
overview of the current breakpoint settings
and the source line status. Code coverage
information lets you distinguish between
executed and unexecuted program sections.
µVision2 incorporates a C-like function
language that lets you generate and use:
You can point to a variable in the editor to
show its value. Two docking windows
display and allow the modification of:
Attributes
�
�
�
�
�
�
�
Built-in functions like printf, memset,
rand, and other useful routines.
Signal functions to simulate analog and
digital inputs to the CPU.
User functions to extend the command
scope and combine repetitive actions.
Local variables of the current function.
User-specified variables in two different
pages of the Watch Window.
Program call tree in the Call Stack page.
Up to four memory areas each in a
different format.
Workbook bar for quick document selection
Bookmark
Code already executed
No Executable Code
Enabled Breakpoint
Attributes
Current PC, next statement
Disabled Breakpoint
Selected line from Output Window
Code is not executed
Debug functions are created with the built-in editor and invoked
by breakpoints, by toolbox buttons, or from the command line.
Watch and Memory Windows allow review and modification of variables.
The Call Stack Window shows the function invocation in the editor.
Editor & Debugger
3
The C166 compiler conforms to the ANSI
standard and is designed specifically for the
166 and ST10 microcontroller families.
Extensions incorporated into the compiler
give you full access to all resources in your
embedded hardware.
Warning Messages
Memory and SFR Access
Interrupt Functions
PEC, FLASH, and More
Keil C166 performs extensive program flow
and syntax checking and generates detailed
warning messages that indicate:
Mismatches in data types, pointers, and
function arguments;
Use of uninitialized variables;
Dead code and dead assignments;
Unused variables, labels, and functions;
Constant expressions in conditions;
and Missing return values.
Your program variables may be assigned to
any address space supported by your target.
The memory model determines the default
memory selector used for variables. Note
that you may always explicitly specify the
memory selector for a particular variable.
Even though the 166 is a 16-bit architecture,
compiler options support byte-aligned
access to int or long variables (even in C
structures).
Access to special function registers is
provided by the and keywords.
C166 lets you create interrupt service
routines in C. Up to 128 interrupt functions
may be included in each source module.
Fast entry/exit code and register bank
switching make C interrupt functions
extremely efficient.
The PEC may be directly accessed in your C
programs. Detailed examples for each
166/ST10 peripheral can be found in the
documentation. Application Notes describe
the extensions for in-system FLASH
programming and the on-chip CAN.
�
�
�
�
�
�
sfr sbit
C166 Highlights�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
Ten basic data types including single and double precision IEEE
floating-point numbers
Flexible variable allocation with memory selectors
Fully reentrant code (including floating-point math) and library
routines
Access to registers including bit parameters and bit-addressable
variables
Sophisticated syntax checking and detailed warning messages
Direct C support for interrupts, register banks, and PEC
C-level access to all special function registers
Register parameters and variables with global optimization
64KB near data area available in all memory models
Support for the MAC unit
Optimum bit-field access with 166 bit and BFLD instructions
C support for byte-aligned int, long, float, and struct variables
Built-in interface for the RTX166 real-time operating system
Extremely efficient use of the extended instruction set
Supports all variants of the 166 and ST10 family
Complete debugging information included in object modules
Supported by all emulator vendors
bit
Selector Address Space
near
idata
bdata
sdata
far
huge
xhuge
. . . . . . . 16-bit address, up to 64KB DATA and CONST space
. . . . . . . On-chip RAM, fastest variable access.
. . . . . . Bit-addressable RAM.
. . . . . . System page (0xC000 to 0xFFFF) for XRAM objects.
. . . . . . . . . 32-bit pointer with 14-bit address calculation.
. . . . . . . 32-bit pointer with 16-bit address calculation, generates optimalcode on current devices with extended instruction set.
. . . . . . 32-bit pointer/address calculation, unlimited object size.
Memory Variable FunctionModel Selector Selector
TINYSMALLCOMPACTHCOMPACTMEDIUMLARGEHLARGE
near nearnear nearfar near
huge nearnear farfar far
huge far
In every memory model the L166
linker allows flexible assignment of
the four DPP registers to the NEAR
DATA and NEAR CONST areas.
This provides up to 64KB for fast near
variable access.
In the HLARGE and HCOMPACT
memory models, the memory appears
as a linear 16MB address space.
4 166 & ST10 Development Tools
C166 Compiler
Memory Selectors
Memory Models
The C166 compiler optimizes your C code
with the expertise of an experienced
assembly programmer and uses the
following optimizations:
Constant Folding
Common Subexpression Elimination
Strength Reduction
Control Flow Optimization
Global Constant Propagation
Register Variable Usage
Parameter Passing in Registers
Loop Rotation
Dead Code Elimination
Common Tail Merging
Peephole Optimization
Switch-Case Optimization
NOP/DPP Load Optimization
Bit-field Access Optimization
The Multiply/Accumulate Co-processor that
is available in some 166/ST10 variants is fully
supported by the Keil tool chain (using the
MAC compiler and assembler directive).
The C166 compiler improves execution
speed of DSP algorithms by replacing the
MUL and MUL/ADD instruction
combinations as well as structure copy
operations with MAC co-processor
instructions.
You may use C166 intrinsic functions to
write DSP algorithms that use the MAC
instruction set at the C program level.
The C166 run-time libraries consist of over
100 functions all of which are reentrant.
The libraries support all of the ANSI C
routines that are consistent with the
limitations of embedded applications.
Intrinsic routines are provided for the
following 166-specific instructions: ,
, , , , , ,
, , , , , and .
�
�
�
�
�
�
�
�
�
�
�
�
�
�
einit
diswdt idle nop prior pwrdn srvwdt
trap bfld testbit testclear ror rol
General Code Optimizations
166-Specific Code Optimizations
MAC Unit Support
C Run-Time Library
Arithmetic Long Execution Float Execution Double ExecutionOperation Max. Avg. Max. Avg. Max.
addition..........................0.41 .............................8.77.......29.60 ...............16.49 .......30.40subtract .........................0.41 .............................8.89.......30.40 ...............17.99 .......29.60multiply ..........................2.81 ...........................10.99.......12.80 ...............24.04 .......27.20divide.............................7.34 ...........................14.08.......16.80 ...............42.10 .......49.60unsigned divide .............5.03square root .......................................................11.19.......15.20 ...............65.84 .......76.80exponential ........................... .........................180.58.....304.80 .............506.77 .....802.40logarithm .............................. .........................174.20.....213.60 .............351.90 .....419.20sine....................................... .........................144.43.....184.40 .............448.17 .....509.60cosine................................... .........................142.68.....206.00 .............449.14 .....491.20tangent ................................. .........................255.62.....303.20 .............465.14 .....516.80arc sine................................. .........................237.14.....298.40 .............561.32 .....658.40arc cosine............................. .........................257.01.....294.80 .............602.40 .....673.60arc tangent ........................... .........................176.05.....244.00 .............376.24 .....480.80
The C166 Tab shows compiler options and lets you select
the level of optimization. Global register coloring performs
incremental re-translations that enhance register usage.
Timing is in µsec. Code was executed on
C167 20MHz CPU clock, 16-bit non-mux BUS.
A166 Macro AssemblerThe A166 assembler supports all 166 / ST10 and MAC
instructions and provides the following functions:
Standard and MPL macros with conditional assembly.
64-bit arithmetic; jmp & call instruction optimization.
Extensive section directives and use of DPP registers.
With the directive, the C166 compiler generates assembly
source files. Inline assembly may be included using the and
pragmas.
�
�
�
SRC
asm
endasm
Code Optimization
5
Arithmetic Execution Timings
The RTX166 multitasking real-time kernel
makes implementing complex, time-critical
software projects easy. RTX166 is royalty
free and is fully integrated into the C166
tool chain using the standard 166 stacks.
RTX166 adds no overhead to your C code
and requires no run-time libraries.
supports fast tasks, standard
tasks, and includes CAN support. Flexible
mailboxes may be used with memory pools
for inter-task communication.
is a reduced functionality
kernel that fits on single-chip systems.
Both let you create and delete tasks, send
and receive signals and messages, and
perform other management operations.
RTX166 Full
RTX166 Tiny
Task (Context) Switching
Events and Interrupts
CAN Interface
�
�
�
�
�
�
�
�
Round-Robin:
Preemptive :
Timeouts:
Intervals:
Signals:
Messages :
Interrupts :
Semaphores :
Each task runs for a
defined time slice. When a task’s time
slice is up, the next task starts.
The task with the highest
priority runs until it is preempted by a
higher priority task or until it delays
waiting for an event.
RTX166 supports the following events:
Interrupt functions are supported and may
send signals and messages to and from tasks.
Since RTX166 Full never disables interrupts,
there is no impact on the response time of
interrupt service routines.
A CAN Library supports the on-chip CAN
controller of the 166 devices and allows you
to send and receive messages via a CAN
network. Using the CAN interface, you can
easily implement multiprocessor designs.
†
†
†
†
†
Delay for specified timer ticks.
Delay for an interval of time.
Coordinate inter-task operations.
Pass messages between tasks.
Handle hardware interrupts.
Share limited resources.
Overview of RTX166 Routines�
�
�
�
�
�
�
�
Task Management Routines
Interrupt Management Routines
Signal Functions
Semaphore Functions
Mailbox Functions
Memory Management Functions
System Clock Routines
CAN Communication Routines
:
:
:
:
:
:
:
:
create-task, delete-task, change-
priority , pass-task , running-task-id, and running-task-priority .
attach-interrupt, detach-
interrupt, enable-interrupt, disable-interrupt, and wait-interrupt.
send-signal, clear-signal, wait-signal, and isr-send-
signal.
create-semaphore, delete-semaphore, send-
token, and wait-token.
create-mailbox, delete-mailbox, check-mailbox,
send-message, wait-message, isr-send-message, and isr-recv-message.
create-pool, check-pool, get-
block, and free-block.
set-slice , delay-task, set-timeout , and
check-timeout .
task-create, hw-init, def-obj, def-
obj-extd, undef-obj, stop, start, write, receive, def-buf-size, bind-obj,
unbind-obj, wait, request, read, get-status, and get-errors.
†
† † †
†
†
†
†
† †
†
Technical Data RTX166 Full RTX166 Tiny
Number of tasks . . . . . . . . . 256 max. . . . . . . . . . . . . . 32 max.Number of mailboxes. . . . . . 256 max. . . . . . . . . . . . . . Not supportedNumber of semaphores. . . . 256 max. . . . . . . . . . . . . . Not supportedNumber of signals . . . . . . . . 256 max. . . . . . . . . . . . . . 32 max.
RAM Requirements . . . . . . . Min. 2-3 KBytes. . . . . . . . 8 + 4 * BytesCode requirements . . . . . . . 6-35 KBytes. . . . . . . . . . . Less than 1.5 KBytesHardware Requirements . . . One on-chip timer . . . . . . One on-chip timer
User task priorities. . . . . . . . 0-127 . . . . . . . . . . . . . . . . Not supportedContext switch time . . . . . . . Less than 40 µsec. . . . . . 40-100 µsec.Interrupt lockout time. . . . . . 0 usec.. . . . . . . . . . . . . . . Less than 4 µsec.
tasks
†Available only in RTX166 Full.
The µVision2 Debugger supports Kernel-Aware debugging and
displays detailed status information for RTX166 resources such as
task lists, timers, memory pools, mailboxes, and stack usage.
Breakpoints may include the TaskRunning function to halt
program execution when a specific task is running.
6 166 & ST10 Development Tools
RTX166 Real-Time Kernel
The µVision2 Debugger provides all the
usual source-level, symbolic debugging
features and includes trace history, code
coverage, and complex breakpoints. The
DDE interface and script language support
automated test batches.
µVision2 integrates high-speed CPU
simulation with on-chip peripheral
simulation for the 166 and its derivatives.
Even the MAC unit is fully simulated. I/O
values may be reviewed and modified
directly in peripheral dialogs. Dynamic input
values may be generated with user signal
functions that you write using the built-in C-
like macro language.
µVision2 comes with a configurable Monitor
that lets you test your software in hardware.
The Monitor operates in different modes:
The Monitor downloads into
RAM of the target system. The best mode
to start with (baud rate is auto-adjusted).
Two un-used I/O pins
are used for PC communication. Requires
that the Monitor is loaded into ROM.
This new, high-speed
interface uses the On-Chip Debugging
System available in new 166 variants. The
Monitor is only 50 Bytes!
The µVision2 debugger interfaces directly to
the Hitex DProbe emulator. All emulator
features are available in the IDE. You do not
need to learn any other environment.
Bootstrap:
Simulated UART:
OCDS/JTAG:
CPU & Peripheral Simulator
Target Monitor
Emulator Interface
µVision2 gives you the choice between Simulator, Monitor, and Emulator.
MCB167/NET is a high-speed single-board
computer that supports all C167 variants
while providing both a dual CAN interface
and an Ethernet controller for TCP/IP
applications. The board is in-system
programmable with 167 Flash versions or
off-chip Flash ROMs.
A Performance Analyzer provides detailed timing statistics of your code.
Serial communication, A/D converter, and Port I/O are all fully simulated.
The Monitor Setup Dialog provides a number of monitor
variants and configurations for popular evaluation boards.
Monitor Requirements inthe Target Hardware
�
�
�
�
�
5KB code space.
256 bytes data space.
10 bytes of stack spacein the user program.
Serial port for PC interface.
NMI trap for breakpoints.
Technical Information
�
�
�
�
�
�
Supports all 167/168 variantsup to 50 MHz CPU clock
1 MByte high-speed RAM(access time < 25 ns)
1 MByte Flash ROM (opt.)
Ethernet controller CS8900A
Dual CAN interface
Prototyping area 3.75” x 2”(95mm x 50mm)
MCB167/NET CPU Board with Ethernet and CANMCB167/NET is designed with high-speed
parts and allows you to use future 167
versions at up to 50 MHz. A large 1 MByte
RAM may be used in bootstrap mode to
download the µVision2 Monitor and your
program. This allows you to test even the
largest applications.
Testing Your Programs
7
8 166 & ST10 Development ToolsCopyright © 1992-2000 Keil Elektronik GmbH & Keil Software, Inc. All rights reserved.
Information in this data sheet is subject to change without notice and does not represent a commitment on the part of Keil Software, Inc.
Europe:
Support ++49 89 / 45 60 40 - 24
FAX ++49 89 / 46 81 62
Email [email protected]
United States:
972-312-1107
FAX 972-312-1159
Email [email protected]
Keil Elektronik GmbH
Bretonischer Ring 15
85630 Grasbrunn
Germany
Keil Software, Inc.
1501 10th Street, Suite 110
Plano, TX 75074
USA
Phone ++49 89 / 45 60 40 - 0 Phone 800-348-8051
TM
www.keil.com
Keil Elektronik GmbH Keil Software, Inc.and , have representatives in the following countries:
Contact Keil Elektronik GmbH or Keil Software, Inc., for the distributor nearest you.
Australia, Austria, Belgium, Brazil, Canada, Czech Republic, China, Denmark, Finland, France, Germany, Hong Kong, India, Ireland, Israel, Italy, Japan, Korea, Mexico, Netherlands,
Norway, Poland, Portugal, Russia, Singapore, Slovenia, South Africa, Sweden, Switzerland, Taiwan, United Kingdom, and United States.Spain,
Evaluation software and detailed technical information are available from your distributor and our World Wide Web site (www.keil.com).
Advantages of C166 and Tools
Advantages of µVision2
�
�
�
�
�
�
�
�
�
�
�
C166 offers flexible use of DPP registers in all
memory models and allows 64KB NEAR DATA and
NEAR CONST areas.
C166 and L166 provide fast compile-link-locate
cycles. The compiler generates object files directly.
Linking and locating are performed in a single step.
Very fast interrupt code may be created with or
without register bank context switching.
and memory models enable
optimum use of extended instructions.
Detailed warning messages are generated by all tools.
C166 automatically assigns register variables and can
perform global register optimization over an entire
application.
Support is provided for true preemptive, real-time
operating systems. C166 generates fully reentrant
code (including floating-point operations).
High-speed CPU and peripheral simulator supports
drivers for the various 166 and 167 derivatives.
Provides C-style user and signal functions, integrated
performance analyzer, and code coverage features.
Interfaces to Target Monitor and Emulators.
HLARGE HCOMPACT
Memory selectors and enable optimum
code efficiency with extended instructions.
Easy-to-use Integrated Development Environment
intelligently configures tool options.
huge xhuge
�
Technical Support
At Keil Software, we are dedicated to providing you with
the best development tools and the best technical support.
In addition to extensive user guides, we make Application
Notes available on our web site at .www.keil.com
No. Keil Application Notes for 166 / ST10 Microcontrollers
Programming the C167CR CAN Interface:
Definitions for the C16x:
C16x Memory Models:
C16x Classes and Sections:
Using DPPs:
Stacks in C16x:
In-System Flash Programming:
Using the MAC Unit:
Bypassing Chip Problems:
Accessing Classes and Sections:
115 Sample CANroutines; allow CAN connection of two Keil MCB167 boards.
120 Terms used with Keil C166.
121 Code segments and classes.
122 Detailed description of NDATA,NCODE, NDATA0, and other classes.
123 Teaches how to use the four DPP registers of the166 architecture to maximize code efficiency.
124 Discusses the two stacks (user and system)and how to best use them in your applications.
138 Shows flash programmingtechniques and provides sample code for C167CS.
140 Discusses the tool extensions for theST10 MAC unit and provides programming examples.
141 Techniques and directives tobypass problems in the silicon.
142 Allows you to accesssection and class addresses from your C Code.
CAN Library
CANLIB is an embedded API that supports the on-chip
CAN controller in the C167 and ST10. The library
structure and
functionality of your embedded application.
handles
all interfacing and communication with the CAN controller
leaving you free to concentrate on the
Benefits & Support