⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot51.doc

📁 该应用软件可以实现大多数单片机的仿真实验
💻 DOC
📖 第 1 页 / 共 3 页
字号:




              MCS-51 Microcontroller Family Bootstrap Program






           BBBBBB    OOOOO    OOOOO  TTTTTTTT       5555555   11
           BB   BB  OO   OO  OO   OO    TT          55       111
           BB   BB  OO   OO  OO   OO    TT          55        11
           BBBBBB   OO   OO  OO   OO    TT    ====  555555    11
           BB   BB  OO   OO  OO   OO    TT               55   11
           BB   BB  OO   OO  OO   OO    TT               55   11
           BBBBBB    OOOOO    OOOOO     TT          555555   1111









                         U S E R ' S    M A N U A L

                                Version  1.0




                              January 20, 1996

















                   copyright (c) 1996  by  W.W. Heinz



                          TABLE OF CONTENTS
                          -----------------



I.    Introduction

II.   BOOT-51 Installation

      II.1   Files
      II.2   Customizing BOOT-51
      II.3   Tayloring the Cables

III.  BOOT-51 Operation

      III.1  Interactive Operation
      III.2  Batch File Operation
      III.3  The BLINK Program

IV.   Troubleshooting


Appendix A:     CUSTOMIZ Error Messages

                A.1 Parameter Errors
                A.2 Baudrate Errors
                A.3 Runtime Errors

Appendix B:     RESET Error Messages

Appendix C:     BOOT-51 Error Messages

Appendix D:     Trademarks

Appendix E:     Tables of Baudrates


I. Introduction
---------------
Usually an 8051 application program is not running correctly at once, and
it is not quite easy to debug it without suitable test equipment.
It is very unconvenient, to blow the program into an EPROM after every
change. Instead it would be nice to load the program into the external
RAM of the target board and then start it. This would dramatically speed
up the turn-around cycles. However, three problems must be solved first:

  1. There must be a suitable interface to transmit the application
     program from the host (PC) to the target (8051) system.

  2. The target board needs a suitable firmware that can receive a
     program from the host computer, store it in the external RAM,
     and finally execute it.

  3. Once loaded, the application program must be executable, although
     it is stored in the external RAM, which is usually mapped into the
     XDATA address space.
     (Programs can only be executed in the CODE address space!)

The corresponding three solutions are:

  1. an RS-232 interface between the PC and the 8051 board
  2. a bootstrap program
  3. external RAM that is mapped into both the CODE and XDATA address space

Nearly all evaluation boards for 8051 derivatives are meeting requirements
1 and 3. In most cases it is easy to establish a memory map according to
requirement 3, even on target boards that do not originally support it:
The -OE input of the (usually static) RAM must be driven by a logic AND of
the -RD and -PSEN signals of the MCU, rather than by -RD alone. That's all!

Requirement 2 can be met by blowing a customized version of BOOT-51 into
the EPROM of the target board. After system reset, it can receive an
Intel-HEX file over the serial interface, store it in the external RAM,
and finally jump to the program start address.
BOOT-51 itself doesn't need any external RAM, and it is by no means
restricted to a PC-based host system. BOOT-51 requires only 1 kB of EPROM.
Sure, a bootstrap program cannot replace a target debugger, but it's a start.


II. BOOT-51 Installation
------------------------
Before blowing BOOT-51 into an EPROM, it must be customized for the target
board, and one or two cables must be taylored for local requirements.



II.1 Files
----------
The BOOT-51 package consists of the following files:

  BOOT51.DOC            BOOT-51 user's manual    (this file)
  BOOT51.A51            BOOT-51 assembler source (requires ASEM-51 V1.2)
  CUSTOMIZ.EXE          BOOT-51 customization utility
  BOOT.BAT              batch file for application program upload
  LOAD.BAT              called by BOOT.BAT only
  RESET.EXE             program to reset target system via PC printer port
  BLINK.A51             sample test program for BOOT-51



II.2 Customizing BOOT-51
------------------------
BOOT-51 must be customized for the target board, before it is ready for
assembly. This is performed with an include file BOOT51.INC, containing
the required configuration data. BOOT51.INC is generated with the utility
program CUSTOMIZ.EXE provided.
There are two major groups of configuration parameters:

  -  baudrate generation
  -  memory addresses

CUSTOMIZ is invoked as shown below:


  CUSTOMIZ <baudrate> [<timer> [<accuracy> [<clock> [<start> [<user>]]]]]


The first four parameters are for baudrate generation, and the last two
parameters are memory addresses. Parameters in brackets are optional.

<baudrate> is the desired nominal baudrate (in Baud), BOOT-51 should use
           for communication with the host system.

<timer>    is the on-chip timer or baudrate generator that is used for
           baudrate generation. Legal values are:

           T1 = timer 1, available on nearly all 8051 derivatives (default)
           T2 = timer 2, available on 8052/32 and all true compatibles
           BG = internal baudrate generator on 80C515/35 and 80C517/37
           BA = internal baudrate generator on 80C515A and 80C517A
           D1 = timer 1 with clock/12 or clock/4 prescaler on 80C320

<accuracy> is the required relative precision of the baudrate in %.
           The default precision is 1.0 %.

<clock>    is the system clock frequency in MHz. (11.0592 MHz default)

<start>    is the start address of BOOT-51 on the target system in hex
           representation. (default is 0000H)

<user>     is the usual hex start address of the application programs
           in the external memory. (default is 8000H)

Baudrate:
---------
For the serial interface, the standard UART is used that is available on
almost every 8051 derivative. BOOT-51 is always running the UART in mode
1, that is asynchronuous mode, 8 data bits, 1 stop bit, no parity.
However, depending on the derivative, there may be various timers or
prescalers that can be used for baudrate generation.
If the desired baudrate cannot be generated or the precision is too bad,
CUSTOMIZ will display a corresponding error message. In this case, try
another baudrate generator that is also available on your derivative.
When this fails, too, try another baudrate that may also do, or think of
using another oscillator crystal that suits better for the task.
You should play around with CUSTOMIZ, to explore how to get best results.
The tables in Appendix E show the precisions of the most frequently used
baudrates that can be generated with the supported timers and baudrate
generators, for some standard clock frequencies.
In most cases baudrate deviations of 2 to 3 % are no problem for the
communication with a PC. Whenever in doubt, try it!
BOOT-51 can receive data at very high baudrates without the need for a
handshake protocol. Output is done more slowly with short pauses between
the characters, to avoid a data overrun of the PC UART. The maximum
effective output speed of BOOT-51 is corresponding to 9600 Baud.
In general, speed is rather a problem for the PC than for the micro.

Example 1:   CUSTOMIZ 9600 BG 0.1 12
----------
             will generate an include file for BOOT-51 that configures it
             for 9600 Baud, generated with the internal baudrate generator
             of a SAB80C535 or SAB80C537 that is clocked with 12.0 MHz.
             The required precision is 0.1 %.
             The bootstrap and application program start addresses are
             set to their default values.

Addresses:
----------

<start>:
An 8051 starts program execution at CODE address 0000H after reset.
Thus there must always be ROM at CODE address 0000H to execute the first
instructions. On most 8051 boards there is EPROM in the range 0000H-7FFFH,
and RAM in the range 8000H-FFFFH. However, the final application programs
will usually start at address 0000H, and the 8051 interrupt addresses start
at address 0003H. When application programs can be loaded into RAM at 8000H,
this is normally not quite realistic for testing.
Hence it would be nice to have CODE/XDATA-RAM at address 0000H to load
and test application programs. That is why some evaluation boards remap the
EPROM from address 0000H to 8000H, and the RAM from 8000H to 0000H, when the
first memory access to a CODE address > 7FFFH is made.
To support this, BOOT-51 starts with a long jump to its entry point, to
eventually remap the memory. If you own a corresponding evaluation board,
specify the <start> address of BOOT-51 to the location, where it resides
after memory remapping!

<user>:
In principle, BOOT-51 can load an application program at any location in
the external RAM and start it there. However, the interrupt addresses
should be redirected to the location, where application programs usually
start, e.g. the start address of the external RAM.
Hence the <user> address should point to the location, where the CODE/XDATA-
RAM starts. If it starts at 8000H, interrupt 0003H is redirected to 8003H,
interrupt 000BH to 800BH, and so on.
If the CODE/XDATA-RAM starts at 0000H (after remapping), the <user> address
has no practical meaning and can be left default.

Example 2:   CUSTOMIZ 19200 T2 1 11.0592 0 C000
----------
             will generate an include file for BOOT-51 that configures it
             for 19200 Baud, generated with timer 2 of an 80C52 or 80C32
             that is clocked with 11.0592 MHz. The required precision is 1 %.
             BOOT-51 is located at address 0000H in the EPROM, and the
             interrupt addresses are redirected to location 0C000H.

If CUSTOMIZ aborts with an error message, it returns ERRORLEVEL 1 on para-
meter- and baudrate-errors, and ERRORLEVEL 2 on fatal runtime errors.
When CUSTOMIZ terminates without error message, it returns ERRORLEVEL 0, and
a customization header file BOOT51.INC should be present in the default
directory. With this file, BOOT-51 can be assembled as usual with

              ASEM BOOT51

Remember that BOOT-51 requires ASEM-51 V1.2 or later!
Now there should be an Intel-Hex file BOOT51.HEX, which may serve directly
as input for the EPROM blower. We may also convert it to a binary image file
with the HEXBIN utility:

             HEXBIN BOOT51/LENGTH:4000

would generate a binary image file BOOT51.BIN for a 16 kB EPROM (27C128).
(Note: Only 1 kB of EPROM is required for the BOOT-51 program code.)
Once in an EPROM, BOOT-51 should be ready to run on the target system.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -