- •Preface
- •Document Conventions
- •Contents
- •Chapter 1. Introduction
- •Manual Topics
- •Changes to the Documentation
- •Evaluation Kits and Production Kits
- •Types of Users
- •Requesting Assistance
- •Software Development Cycle
- •Product Overview
- •Chapter 2. Installation
- •System Requirements
- •Installation Details
- •Folder Structure
- •Chapter 3. Development Tools
- •C51 Optimizing C Cross Compiler
- •A51 Macro Assembler
- •BL51 Code Banking Linker/Locator
- •LIB51 Library Manager
- •OC51 Banked Object File Converter
- •Chapter 4. Creating Applications
- •Creating Projects
- •Project Targets and File Groups
- •Overview of Configuration Dialogs
- •Code Banking
- •µVision2 Utilities
- •Writing Optimum Code
- •Tips and Tricks
- •Chapter 5. Testing Programs
- •µVision2 Debugger
- •Debug Commands
- •Expressions
- •Tips and Tricks
- •Chapter 6. µVision2 Debug Functions
- •Creating Functions
- •Invoking Functions
- •Function Classes
- •Chapter 7. Sample Programs
- •HELLO: Your First 8051 C Program
- •Introduction
- •RTX51 Technical Data
- •Overview of RTX51 Routines
- •TRAFFIC: RTX-51 Tiny Example Program
- •RTX Kernel Aware Debugging
- •Chapter 9. Using On-chip Peripherals
- •Special Function Registers
- •Register Banks
- •Interrupt Service Routines
- •Interrupt Enable Registers
- •Parallel Port I/O
- •Timers/Counters
- •Serial Interface
- •Watchdog Timer
- •D/A Converter
- •A/D Converter
- •Power Reduction Modes
- •Chapter 10. CPU and C Startup Code
- •Caveats
- •Hardware and Software Requirements
- •Serial Transmission Line
- •µVision2 Monitor Driver
- •µVision2 Restrictions when using Monitor-51
- •Monitor-51 Configuration
- •Troubleshooting
- •Debugging with Monitor-51
- •Chapter 12. Command Reference
- •µVision 2 Command Line Invocation
- •A51 / A251 Macro Assembler Directives
- •C51/C251 Compiler
- •LIB51 / L251 Library Manager Commands
- •OC51 Banked Object File Converter
- •Index
54 Chapter 3. Development Tools
|
LIB51 Library Manager |
|
The LIB51 library manager lets you create and maintain library files. A library |
|
file is a formatted collection of object modules (created by the C compiler and |
|
assembler). Library files provide a convenient method of combining and |
|
referencing a large number of object modules that may be accessed by the |
|
linker/locator. |
|
To build a library with the µVision2 project manager enable Options for Target |
|
– Output – Create Library. You may also call LIB51 from a DOS box. Refer |
3 |
to “LIB51 / L251 Library Manager Commands” on page 218 for command list. |
There are a number of benefits to using a library. Security, speed, and |
|
minimized disk space are only a few of the reasons to use a library. |
Additionally, libraries provide a good vehicle for distributing a large number of useful functions and routines without the need to distribute source code. For example, the ANSI C library is provided as a set of library files.
The µVision2 project C:\KEIL\C51\RTX_TINY\RTX_TINY.UV2 allows you to
modify and create the RTX51 Tiny real-time operating system library. It is easy to build your own library of useful routines like serial I/O, CAN, and FLASH memory utilities that you may use over and over again. Once these routines are written and debugged, you may merge them into a library. Since the library contains only the object modules, the build time is shortened since these modules do not require re-compilation for each project.
Libraries are used by the linker when linking and locating the final application. Modules in the library are extracted and added to the program only if they are required. Library routines that are not specifically invoked by your program are not included in the final output. The linker extracts the modules from the library and processes them exactly as it does other object modules.
Getting Started and Creating Applications |
55 |
|
|
OC51 Banked Object File Converter |
|
|
The OC51 banked object file converter creates absolute object modules for each |
|
|
code bank in a banked object module. Banked object modules are created by the |
|
|
BL51 code banking linker/locator when you create a bank switching application. |
|
|
Symbolic debugging information is copied to the absolute object files and can be |
|
|
used by the µVision2 Debugger or an in-circuit emulator. |
|
|
You may use the OC51 banked object file converter to create absolute object |
|
|
modules for the command area and for each code bank in your banked object |
|
|
module. You may then generate Intel HEX files for each of the absolute object |
|
|
3 |
||
modules using the OH51 object-hex converter. |
||
OH51 Object-Hex Converter |
||
|
||
|
||
The OH51 object-hex converter creates Intel HEX files from absolute object |
|
|
modules. Absolute object modules can be created by the BL51 code banking |
|
|
linker or by the OC51 banked object file converter. Intel HEX files are ASCII |
|
|
files that contain a hexadecimal representation of your application. They can be |
|
|
easily loaded into a device programmer for writing EPROMS. |
|
56 |
Chapter 3. Development Tools |
|
|
3