Keil MCB251 User Manual

MCS®251 Microcontroller Target Board
for Intel 251SB, Temic 251G1/A1,
and Intel 151 and 8051 Derivatives
User’s Guide 07.97
ii Keil Software
retrieval systems, for any purpose other than for the purchaser’s personal use, without written permission.
Copyright © 1995-1997 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved.
Keil C51™ and dScope™ are trademarks of Keil Elektronik GmbH.
®
Microsoft
, MS-DOS®, and Windows™ are trademarks or registered trademarks
of Microsoft Corporation.
®
, PC®, and PS/2® are registered trademarks of International Business
IBM
Machines Corporation.
®
, MCS® 51, MCS® 251, ASM-51®, and PL/M-51® are registered
Intel trademarks of Intel Corporation.
Every effort was made to ensure accuracy in this manual and to give appropriate credit to persons, companies, and trademarks referenced herein.
MCB251 Evaluation Board User’s Guide iii
Preface
This manual describes the Keil Software MCB251 Evaluation Board and the
®
MCS are included:
“Chapter 1. Introduction” gives an overview of this user’s guide and provides a quick start table.
“Chapter 2. Setup” describes how to connect and configure the board and provides detailed information about the DIP switches and configuration jumpers.
“Chapter 3. Hardware” provides detailed information about hardware including the schematic drawings for the MCB251 board, the logic equations for the PLD and the memory locations of the different Monitor versions contained in the EPROM.
“Chapter 4. Programming” gives details about how to use our tools to generate programs for the MCB251 evaluation board.
251 microcontroller software development tools. The following chapters
“Chapter 5. Using the 251 Monitor” gives a quick overview about the MON251 terminal program.
NOTE
This manual assumes that you are familiar with Microsoft Windows and the hardware and instruction set of the 8051 and 251 microcontrollers.
iv Preface
Document Conventions
This document uses the following conventions:
Examples Description
README.TXT
Courier
Variables
Elements that
repeat… Omitted code
. . .
Optional Items
Bold capital text is used for the names of executable programs, data files, source files, environment variables, and commands you enter at the MS-DOS command prompt. This text usually represents commands that you must type in literally. For example:
CLS DIR L251.EXE
Note that you are not required to enter these commands using all capital letters.
Text in this typeface is used to represent information that displays on screen or prints at the printer.
This typeface is also used within the text when discussing or describing command line items.
Text in italics represents information that you must provide. For example,
projectfile
file name. Occasionally, italics are also used to emphasize words in the text.
Ellipses (…) are used to indicate an item that may be repeated.
Vertical ellipses are used in source code listings to indicate that a fragment of the program is omitted. For example:
in a syntax string means that you must supply the actual project
void main (void) { . . . while (1);
Optional arguments in command-line and option fields are indicated by double brackets. For example:
C251 TEST.C PRINT (
{
opt1
|
opt2
} Text contained within braces, separated by a vertical bar represents a
group of items from which one must be chosen. The braces enclose all of the choices and the vertical bars separate the choices. One item in the list must be selected.
Keys
Text in this sans serif typeface represents actual keys on the keyboard. For example, “Press Enter to continue.”
filename
)
MCB251 Evaluation Board User’s Guide v
Contents
Chapter 1. Introduction..................................................................................... 1
Quick Start.....................................................................................................................2
Chapter 2. Setup................................................................................................. 3
Using the MCB251........................................................................................................4
Configuring the MCB251..............................................................................................5
DIP Switches.................................................................................................................6
Configuration Jumpers..................................................................................................9
CPU Selection.............................................................................................................10
Monitor Modes............................................................................................................11
Monitor Status Display................................................................................................11
Chapter 3. Hardware....................................................................................... 13
Schematics...................................................................................................................18
Printed Board Assembly..............................................................................................22
Technical Data.............................................................................................................23
PAL Equations ............................................................................................................23
Monitor EPROM Addresses........................................................................................26
Chapter 4. Programming................................................................................. 27
Monitor Memory Map.................................................................................................27
Monitor Data & Interrupt Vectors...............................................................................28
Writing Programs for the 251 Monitor........................................................................30
BLINKY Example Program........................................................................................31
External UART Example ............................................................................................46
Chapter 5. Using the 251 Monitor .................................................................. 49
MON251 Terminal Program.......................................................................................49
Index................................................................................................................... 53
vi Contents
MCB251 Evaluation Board User’s Guide 1
Chapter 1. Introduction
Thank you for letting Keil Software provide you with the MCB251 evaluation
®
board and software for the MCS
251 microcontroller family. With this kit you can generate code and then operate it on the MCB251 evaluation board. This hands-on process helps you determine hardware and software needs for current and future product development.
The MCB251 evaluation board supports all operating modes of the 8051, 151, and 251 microcontrollers and lets you become familiar with the different modes of these devices. You may use a standard 8051 or the Dallas Semiconductor 80C320 or 8xC520 with this board. By generating and testing code for the various operating modes of the 8051, 151, and 251, you can evaluate code and processor performance. These factors can be weighed against other production parameters to help you choose the optimum code and processor combination. Alternatively, you may choose just to play with the board, make it flash the LEDs, and write “Hello World” out the serial port.
This user’s guide describes the hardware of the MCB251 evaluation board and contains the operating instructions for the monitor programs (MON251, MON51) and the terminal programs (MON251.EXE, MON51.EXE). Several different configurations of Monitor 251 and Monitor 51 are installed in the EPROM on the MCB251 board. The monitor programs let you communicate between your PC and the MCB251 evaluation board and let you download and run your 251 or 8051 programs.
The MCB251 kit includes the following items:
n MCB251 Evaluation Board User’s Guide (this manual), n MCB251 Evaluation Board, n MCB251 Evaluation Board Software, n 9-pin Serial Cable, n 9 VDC, 500mA wall adapter power supply, n and a 251 Evaluation Kit which includes a 2K compiler.
2 Chapter 1. Introduction
Quick Start
Use the following list to quickly locate important information about the MCB251 evaluation board.
To… See…
Connect power to the MCB251 board. “Using the MCB251” on page 4. Connect the MCB251 to your PC. “Using the MCB251” on page 4. Read about the default configuration settings. “Configuring the MCB251” on page 5. Create a simple program to blink the LEDs. “BLINKY Example Program” on page 31. Write code to use the external UART. “External UART Example” on page 46. Learn more about the µVision IDE. “Using µVision to Create the BLINKY Program”
on page 32.
Learn more about the dScope debugger. “Using dScope to Debug the BLINKY Program”
on page 42.
Learn about the MON251 terminal program. “Chapter 5. Using the 251 Monitor” on page 49. Read about the DIP switch settings. “DIP Switches” on page 6. Read about the configuration jumpers. “Configuration Jumpers” on page 9. Configure the RAM/ROM memory. “Monitor Memory Map” on page 27. See the MCB251 schematics. “Schematics” on page 18. See the MCB251 PAL equations. “PAL Equations” on page 23.
MCB251 Evaluation Board User’s Guide 3
Chapter 2. Setup
The MCB251 evaluation board requires power and a serial connection to a PC running the MON251 terminal program. Before you start, make sure you have satisfied the following hardware and software requirements.
Hardware Requirements
n The MCB251 Evaluation Board. n A serial cable, 9-pin male to 9-pin female, 1-2 meters long, wired one-to-one. n A PC with an available RS-232 port. If the port has a 25-pin connector, a
9-pin male to 25-pin female adapter may be required.
n A device programmer is required to program any EPROMs or other
programmable devices.
Software Requirements
n The Keil MON251 terminal program (MON251.EXE) or the Keil dScope for
Windows with the MON251.DLL driver. The Keil MON251 software/firmware is already programmed into the EPROM provided on the MCB251 board.
n Microsoft Windows version 3.1, 3.11, Windows 95, or Windows NT.
4 Chapter 2. Setup
Using the MCB251
To use the MCB251 evaluation board, you must:
n Connect the external serial port jack (EXT RS232) to a serial port on your PC
using the supplied serial cable.
n Connect power using a power supply provided.
The serial cable lets your PC download program code and debug your target applications. The power cable provides power to the MCB251 evaluation board. The MCB251 does not get power from the PC via the serial cable.
The following illustration shows MCB251 board and the important interface and hardware components.
Prototyping
Area
Bus
Signals
Configuration
Jumpers
Port
Signals
Intel 251SB / Temic 251G1
Dallas 320 or Standard 8051
Monitor EPROM
Port 1 Status
LED’s
DIP Switches
251 on-chip Serial Jack
External Serial Jack
Interrupt Button
Reset Button Power
Supply
Socket for Temic 251A1
MCB251 Evaluation Board User’s Guide 5
Configuring the MCB251
You configure the MCB251 evaluation board with the DIP switches and the configuration jumpers. The MCB251 evaluation board is shipped with the following configuration:
n Intel 87C251SB or Temic 251G1 microcontroller, n Source Mode with 0 Wait States, n Non-Page Mode.
The default DIP switch settings are shown in the following table.
Switch Uart
Int
ON X X X X X X
OFF X X X X
ext
Uart
SRC/D2Page Moni
tor
51/
MAP1MAP2LED A17
151
The default settings of the configuration jumpers are shown in the following figure. The NONP jumper selects the Non-Page Mode of the 251 CPU. The INT1 and NMI jumpers are set to connect the Interrupt Button to the INT1 source.
6 Chapter 2. Setup
DIP Switches
The following sections describe each of the DIP switches of the MCB251 board.
Uart_INT: Default ON
The Uart_INT switch selects whether or not the external 16550 UART generates an interrupt on the microcontroller. If Uart_INT is ON, the interrupt output from the 16550 is connected to port pin 3.2. If Uart_INT is OFF, the interrupt output from the 16550 is not connected to the microcontroller. This switch is useful when using interrupt-driven serial I/O with the external UART. You must set Uart_INT to ON, if you want to halt execution of a user program within dScope.
ext_Uart : Default ON
The ext_Uart switch determines whether or not the chip select signal for the external 16550 UART is generated. If ext_Uart is ON, the chip select signal is generated and the Monitor program uses the external serial interface for communication. The communication baud rate is 57600 BPS. If ext_Uart is OFF, the UART chip select is not generated and the Monitor program uses the on-chip serial interface for communication. In this case, the communication baud rate is 19200 BPS.
SRC/D2: Default ON
The SRC/D2 switch selects either SOURCE mode or BINARY mode on the 251 CPU. If SRC/D2 is ON, SOURCE mode is selected. If SRC/D2 is OFF, BINARY mode is selected.
When you use a 151 or 8051 device, the SRC/D2 must be OFF. When you use the Dallas 320/520 device, the SRC/D2 must be ON to select a Monitor version
which supports the Dual DPTR registers of that CPU. Refer to “CPU Selection” on page 10 for a complete description on how to select the CPU type and the related Monitor version
If you operate the MCB251 with a user application in EPROM, you must set the SRC/DP2 switch to OFF.
MCB251 Evaluation Board User’s Guide 7
PAGE: Default OFF
The PAGE switch selects whether or not the 251 or 151 Monitor operates in page mode or non-page mode. When PAGE is ON, a page mode Monitor version is selected. When PAGE is OFF, a non-page mode Monitor version is enabled. For correct operation of the MCB251 board, you must also set the configuration jumpers to the correct position: PAGE for page mode or NONP for non-page mode.
If you operate the MCB251 with a user application in EPROM, you must set the PAGE switch OFF. However, you may still use the jumpers to select page mode or non-page mode.
Monitor: Default ON
The Monitor switch selects if the Monitor is used for debugging or if the MCB251 operates with a user application EPROM at IC13. When Monitor is ON, the Monitor Memory Mapping is enabled and you must operate the MCB251 board with the supplied Monitor EPROM. When Monitor is OFF, the User Memory Mapping is selected and you may insert an EPROM with your target application.
51/151: Default ON
The 51/151 switch selects whether a 251 or a 151/8051 compatible microcontroller is installed in the IC1 socket. If a 151/8051 compatible device is installed, 51/151 should be ON. If a 251 compatible device is installed, 51/151 should be OFF (unless the 251 is emulating an 8051 or 151 device).
A17: Default ON
The A17 switch selects whether the 251 CPU uses P1.7 as the A17 address line or whether P1.7 is used as I/O port line. When A17 is ON, the A17 line is used and you can address up to 256KB memory with the 251 device. When A17 is OFF P1.7 can be used as I/O port line. Note that the CONFIG BYTES of the 251 CPU must be programmed correctly to use this feature.
8 Chapter 2. Setup
The Monitor EPROM which is supplied in the MCB251 board is configured for 256KB memory. Refer to the 251 or 151 Microcontroller User’s Manual for more information.
If you use the MCB251 board with an 8051 compatible device, such as the Intel 151 or Dallas 320, the A17 DIP switch must be OFF.
MAP1, MAP0: Default OFF, OFF
The MAP1 and MAP0 switches select the memory map for the MCB251. The memory map used on the MCB251 board depends on the setting of the Monitor DIP switch. The memory for both settings are shown in the following tables.
Monitor Memory Mapping (Monitor DIP Switch is ON)
Map1 Map0 RAM Monitor EPROM UART CS & USER CS
OFF OFF
251 Mode
OFF ON illegal illegal illegal
ON OFF illegal illegal illegal ON ON
8051 Mode
00:0000h–01: FFFFh
FE:0000h–FF: DFFFh
X:0000h–X:DFFFh C:0000h-C:DFFFh
(von Neumann mapped)
FF:E800h–FF:FFFFh UART: FF:E400h–FF:E7FFh
USER: FF:E000h–FF:E3FFh
C:E800h–C:FFFFh UART: X:E400h–X:E7FFh
USER: X:E000h–X:E3FFh
(von Neumann mapped)
User Memory Mapping (Monitor DIP Switch is OFF)
Note: DIP Switch 51/151, Page and SRC/D2 must be also OFF
Map1 Map0 RAM User EPROM UART CS & USER CS
OFF OFF
251 Mode
OFF ON
251 Mode
ON OFF
251 Mode
ON ON
8051 Mode
00:0000h–01:FFFFh
FE:0000h–FE:FFFFh
00:0000h–01:FFFFh FE:0000h–FF:DFFFh
00:0000h–00:7FFFh 00:8000h–01:FFFFh
X:0000h–X:DFFFh C:0000h–C:FFFFh UART: X:E400h–X:E7FFh
FF:0000h–FF:DFFFh FF:E800h–FF:FFFFh
FF:E800h–FF:FFFFh
FE:0000h–FF:DFFFh FF:E800h–FF:FFFFh
UART: FF:E400h–FF:E7FFh USER: FF:E000h–FF:E3FFh
UART: FF:E400h–FF:E7FFh USER: FF:E000h–FF:E3FFh
UART: FF:E400h–FF:E7FFh USER: FF:E000h–FF:E3FFh
USER: X:E000h–X:E3FFh
LED: Default ON
The LED switch selects whether or not Port 1 is connected to the 8 LEDs in the upper right portion of the board. When LED is ON, the LEDs on port 1 are enabled. When LED is OFF, the LEDs are not connected to port 1. If the Monitor DIP switch ON and LED is OFF, the Monitor does not modify the port 1 lines on power-up.
MCB251 Evaluation Board User’s Guide 9
Configuration Jumpers
The following sections describe each of the configuration jumpers of the MCB251 board.
NMI: Default ON
The NMI configuration jumper selects whether or not the INT push-button is connected to the NMI pin on the Temic 251G1 microcontroller. If NMI is OFF, the INT push-button is connected to the NMI pin on the Temic 251G1. If NMI is ON, pin 34 is connected to GND.
INT1: Default ON
The INT1 configuration jumper selects whether or not the INT push-button is connected to port pin 3.3 on the microcontroller. If the INT1 switch is ON, the INT push-button is connected to port 3.3. If INT1 is OFF, the INT push-button is not connected to port 3.3.
PAGE / NONP: Default NONP
These nine configuration jumpers select whether the MCB251 board operates in page mode or non-page mode. When these jumpers are in the PAGE position, the address/data bus is configured for 251/151 page mode. When the jumpers are in the NONP position, the standard 8051 bus or 251/151 non-page mode is selected.
In page mode the data and upper address byte are multiplexed on port 2 (this mode is available only on the 251/151). In non-page mode the data and lower address byte are multiplexed on port 0 (this mode is available on the 251, 151, and 8051). This jumper setting should be set to coincide with the CPU CONFIG BYTE settings. Refer to the 251 or 151 Microcontroller User’s Manual for more information about these modes.
10 Chapter 2. Setup
CPU Selection
The MCB251 board can operate with various CPU types. The following table gives you an overview of the various CPU operating modes. It lists values for the configuration bytes of the 251 / 151 CPU used by the Monitor program. For more information about the configuration registers, refer to the 251 or 151 Microcontroller User’s Manual.
NOTE
The settings in the following table are only relevant only for the Monitor EPROM (Monitor DIP switch ON). When the Monitor DIP switch is OFF, you may select the Memory Mapping and the CPU type with the MAP0 and MAP1 DIP switches.
CPU Type DIP Switch Setting CPU Config Bytes
and Operating Mode Page Src/D2 Map0 Map1 A17 Config0 Config1
251SB, 251G1 or 251A1
Page Mode, Source Mode
251SB, 251G1 or 251A1
Page Mode, Binary Mode
251SB, 251G1 or 251A1
Non-page Mode, Source Mode
251SB, 251G1 or 251A1
Non-page Mode, Binary Mode
Intel 151, Page Mode ON OFF ON ON OFF 0FCh 0E7h
Intel 151, Non-page Mode OFF OFF ON ON OFF 0FEh 0E7h
Standard 8051 Derivatives OFF OFF ON ON OFF N/A N/A
Dallas 320/520 OFF ON ON ON OFF N/A N/A
ON ON OFF OFF ON 0F1h 097h
ON OFF OFF OFF ON 0F0h 097h
OFF ON OFF OFF ON 0F3h 097h
OFF OFF OFF OFF ON 0F2h 097h
NOTE
The Temic 251A1 and 251G1 are currently available only as A-step devices. The operating mode of this device is programmed inside the CPU and cannot be changed in an external EPROM. If you use one of these devices you must set the PAGE DIP switch OFF and the SRC/D2 DIP switch ON. This restriction does not apply when the 251A1 and 251G1 are available in C-step technology.
The Intel 251SB CPU may be used to emulate the Intel 151 CPU. This lets you test 151 applications without replacing the 251SB CPU.
MCB251 Evaluation Board User’s Guide 11
Monitor Modes
The MCB251 board comes with a Monitor EPROM which contains several different Monitor configurations. Most of the Monitor configurations are required to run the different CPU types on the board. The following Monitor settings are independent of the CPU type used in the MCB251 board.
DIP Switch Monitor Mode
ext_Uart ON: use EXT RS232 interface @ 57600 BPS. for Monitor communication.
OFF: use INT RS232 interface @ 19200 BPS. for Monitor communication.
LED ON: display Monitor status on Port 1 LED’s (see below).
OFF: Monitor status is not displayed and Port 1 is not affected.
Monitor ON: use Monitor program for debugging
OFF: User EPROM as IC13. Refer to “MAP1 and MAP0 DIP Switch” on
page 7 to for the User EPROM Memory Map.
NOTE
Some derivatives of the 8051 and 251 microcontroller family do not have a compatible serial interface or baud rate generator for the internal serial interface. For such devices it is impossible to use the INT RS232 interface. Currently, the Temic 251A1 and standard 8051 CPU are not compatible. With these devices you can only use the Monitor with the EXT RS232 interface—the
ext_Uart DIP switch must be ON.
Monitor Status Display
During the reset phase the Monitor program displays status information on the Port 1 LEDs. This status information reflects the board configuration and signals that the board is working correctly. The status byte is shifted to the left, which
flashes LED’s during the reset phase. The following table lists the first phase of the LED pattern.
Monitor Version P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0
Monitor 251 and 251 CPU A17 OFF OFF OFF OFF OFF OFF ON† Monitor 51 for 151 or 8051 CPU ON ON ON ON ON ON ON Monitor 51 for Dallas 320/520 ON OFF ON OFF ON OFF ON
† The P1.0 status LED is ON when the INT RS232 interface is used for the Monitor/PC interface
and OFF when the EXT RS232 interface is used for the Monitor/PC interface.
12 Chapter 2. Setup
Loading...
+ 42 hidden pages