Advertisement

Quick Links

®
MCS
251 Microcontroller Target Board
for Intel 251SB, Temic 251G1/A1,
and Intel 151 and 8051 Derivatives
User's Guide 07.97

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MCB251 and is the answer not in the manual?

Questions and answers

Summary of Contents for Keil MCB251

  • Page 1 ® 251 Microcontroller Target Board for Intel 251SB, Temic 251G1/A1, and Intel 151 and 8051 Derivatives User’s Guide 07.97...
  • Page 2 Copyright © 1995-1997 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved. Keil C51™ and dScope™ are trademarks of Keil Elektronik GmbH.
  • Page 3 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.
  • Page 4: Document Conventions

    Preface Document Conventions This document uses the following conventions: Examples Description Bold capital text is used for the names of executable programs, data files, README.TXT 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.
  • Page 5: Table Of Contents

    MCB251 Evaluation Board User’s Guide 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....................
  • Page 6 Contents...
  • Page 7: Chapter 1. Introduction

    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.
  • Page 8: Quick Start

    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.
  • Page 9: Chapter 2. Setup

    MCB251 Evaluation Board User’s Guide 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.
  • Page 10: Using The Mcb251

    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.
  • Page 11: Configuring The Mcb251

    MCB251 Evaluation Board User’s Guide 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: Intel 87C251SB or Temic 251G1 microcontroller, Source Mode with 0 Wait States, Non-Page Mode.
  • Page 12: Dip Switches

    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.
  • Page 13 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.
  • Page 14 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.
  • Page 15: Configuration Jumpers

    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.
  • Page 16: Cpu Selection

    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.
  • Page 17: 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 use EXT RS232 interface @ 57600 BPS.
  • Page 18 Chapter 2. Setup...
  • Page 19: Chapter 3. Hardware

    MCB251 Evaluation Board User’s Guide Chapter 3. Hardware The MCB251 is designed to be a very flexible evaluation board that you can use to compare the effectiveness of the 251 versus the 8051. We have attempted to support all features of the 251 while remaining compatible with the 8051. We have also tried to provide a board that can be expanded to support your own hardware prototypes.
  • Page 20 78L05 voltage regulator is provided at IC6. 251/8051 CPU The Intel 251SB or Temic 251G1 provided with the MCB251 are 251 derivatives with 1 Kbytes of internal RAM. The CPU is located at IC1. The IC1 socket can accommodate a Dallas 320 or 520 CPU, an Intel 151, or a standard 8051 microcontroller.
  • Page 21 PAL equations used. Memory and I/O Devices The MCB251 maps three memory devices into the address space of the CPU: the RAM at IC14, the RAM at IC15, and the EPROM at IC13. The 20V8 PAL at IC12 provides the chip select signal for the external UART at IC5 and a user chip select signal.
  • Page 22: Status Leds

    Chapter 3. Hardware Status LEDs The MCB251 has a single power LED labeled ON which indicates the power to the board is on. Eight LEDs are optionally connected to the Port 1 outputs through a 74HC373 at IC3. The Port 1 LEDs are flashed during reset and display the configuration status of the Monitor EPROM.
  • Page 23: Prototyping Area

    Exercise caution to avoid overloading these signal lines. Refer to “DIP Switches” on page 6 for the pin-out of the CPU and bus signals. NOTE Since the MCB251 supports both the page mode and non-page mode you should connect memory-mapped devices directly to the data bus DB0-DB7 and A0-A15.
  • Page 24: Schematics

    Chapter 3. Hardware Schematics...
  • Page 25 MCB251 Evaluation Board User’s Guide...
  • Page 26 Chapter 3. Hardware...
  • Page 27 MCB251 Evaluation Board User’s Guide...
  • Page 28: Printed Board Assembly

    Chapter 3. Hardware Printed Board Assembly...
  • Page 29: Technical Data

    MCB251 Evaluation Board User’s Guide Technical Data Supply Voltage: 8V-12V DC Supply Current: typical: 300mA System Clock: 12 MHz Memory: 256 Kbytes RAM 128 Kbytes Monitor EPROM (optional: 256 Kbytes User EPROM) CPU: Intel 80C251SB or Temic 80C251G1 (optional: Dallas 80C320, Intel 80C151,...
  • Page 30 Chapter 3. Hardware ;----------------------------------- Boolean Equation Segment ------ EQUATIONS IF (MON_ON) THEN ; Monitor switched on BEGIN A16_ROM = LED IF (MAP[1..0] = #b11) THEN BEGIN RD_RAM = PSEN + /A[16] ; 8051 Mode A16_RAM = 0; ELSE BEGIN RD_RAM = PSEN A16_RAM = A[16] IF (MON_RUN) THEN...
  • Page 31 MCB251 Evaluation Board User’s Guide A16_ROM = A[16] A16_RAM = A[16] RD_RAM = PSEN 3: BEGIN ; 8051 Mode CS_RAM = /(A[15] * A[14] * A[13]) ; RAM 00000 - 0dfff 8051 Mode CS_ROM = 1; ; ROM 00000 - 0ffff...
  • Page 32: Monitor Eprom Addresses

    Chapter 3. Hardware Monitor EPROM Addresses This following table lists the EPROM addresses in the Monitor EPROM for the different monitor versions and contains the EPROM addresses of the 251/151 configuration bytes CONFIG0 and CONFIG1. At address 0 and address 10000H the Monitor EPROM contains a LJMP 0E800H instruction.
  • Page 33: Chapter 4. Programming

    8051. The 251 begins executing instructions at address 0FF0000h. The MCB251 is shipped with the Keil 251 monitor programmed into an EPROM on the MCB251 board. The MCB251 board has Monitor boot logic which is coded in the PLD device. At Reset the Monitor EPROM is addressable at address 0FF0000h.
  • Page 34: Monitor Data & Interrupt Vectors

    Chapter 4. Programming Monitor Data & Interrupt Vectors The Monitors provided with the MCB251 use a minimal amount of your target’s resources. The following sections describe what is required for the 251 monitor and for the 8051 monitor. Monitor 251 For debugging, the 251 monitor uses the TRAP interrupt vector of the 251 CPU for handling breakpoints.
  • Page 35 MCB251 Evaluation Board User’s Guide Monitor 51 The 8051 monitor does not require the use of any interrupt vectors. The serial interrupt is not required for serial communication. However, if you enable the serial interrupt, you must reserve the interrupt vector space for the internal interrupt 0 or serial interrupt.
  • Page 36: Writing Programs For The 251 Monitor

    Chapter 4. Programming Writing Programs for the 251 Monitor Compiling and linking programs for use with the 251 monitor on the MCB251 board requires only two steps. First, compile your applications as you normally would. Make sure that you have selected the correct mode (MODBIN or MODSRC) directive to specify 251 operating mode you have configured on the MCB251 board.
  • Page 37: Blinky Example Program

    BLINKY Example Program The following simple program, BLINKY, is an exercise you may use to test the MCB251 and verify that you can use the tools provided to generate a working program. BLINKY blinks the LEDs on the MCB251 evaluation board. The complete source listing for the program is shown below: /* BLINKY.C - LED Flasher for the Keil MCB251 Evaluation Board */...
  • Page 38 Chapter 4. Programming Using the MS-DOS Command Line Tools Use the following command line to compile the BLINKY example program: C251 BLINKY.C DEBUG MODSRC Use the following command line to link the BLINKY example program for use with the 251 monitor: L251 BLINKY.OBJ RESERVE (0FF0003H-0FF0005H, 0FF003BH-0FF003DH, 0FF007BH-0FF007DH) Using the Windows-Based Tools...
  • Page 39 MCB251 Evaluation Board User’s Guide Create the BLINKY.C Source File Start µVision by double-clicking on the icon in the 251 Tools group. µVision Program Icon When µVision starts, select the New command from the File menu and µVision opens a new text window in which you may create the BLINKY program.
  • Page 40 Chapter 4. Programming You should save the BLINKY program after you enter it. Select the Save As… command from the File menu and µVision displays the Save As dialog box shown below. To save the program as BLINKY.C, enter BLINKY.C in the File Name text box at the top of the Save As dialog box.
  • Page 41 MCB251 Evaluation Board User’s Guide Create the BLINKY Project File After you save BLINKY.C, you should create a BLINKY project file. A project file contains a list of all the source files in your project as well as the options to use for the compiler, assembler, linker, and make facility.
  • Page 42 Chapter 4. Programming Include BLINKY.C in the Project When the project file is created, µVision displays the Project Manager dialog box. Here, you select the source files to include in your project. Click the Insert button and choose the BLINKY.C file you previously saved. Then, click the save button to save your changes to the project file.
  • Page 43 MCB251 Evaluation Board User’s Guide Set the C251 Compiler Options for the Project To set the C251 compiler options, select the C251 Compiler… command from the Options menu and µVision displays the C251 Compiler Options dialog box. The only options you need to set for the BLINKY example are Include debug information and Source Mode for Code generation.
  • Page 44 Chapter 4. Programming Set the L251 Linker Options for the Project To set the L251 linker options, select the L251 Linker… command from the Options menu. µVision displays the L251 Linker Options dialog box shown below. Enter the following text in the Reserve text boxes on the Misc tab shown above. 0xFF0003-0xFF0005, 0xFF003B-0xFF003D, 0xFF007B-0xFF007D This creates the reserve directive that tells the linker that memory areas 0xFF0003-0xFF0005, 0xFF003B-0xFF003D and 0xFF007B-0xFF007D should...
  • Page 45 MCB251 Evaluation Board User’s Guide Set the Path Specifications for the 251 Tools You may wish to specify the path to the 251 tools directly in µVision. You may do this in the Environment Pathspecs dialog box. Open this dialog box using the Environment Pathspecs…...
  • Page 46 Chapter 4. Programming Set the Make Options for the Project Finally, the make options control how µVision processes the files in your project. Open the Make Options dialog box by selecting the Make… command in the Options menu. Make sure you select the Run L251 Linker radio button. This links your source files after compiling them.
  • Page 47 MCB251 Evaluation Board User’s Guide Build the Project Now, you are ready to build the project. Select the Make: Build Project command from the Project menu to begin compiling and linking. µVision responds by compiling the BLINKY.C source file and linking it with the appropriate library files.
  • Page 48 Chapter 4. Programming Using dScope to Debug the BLINKY Program To load the BLINKY in the MCB251 evaluation board using dScope, you need to perform the following steps: Load the MON251.DLL CPU driver. Configure the CPU driver for the appropriate COM port and baud rate.
  • Page 49 MCB251 Evaluation Board User’s Guide When dScope starts, a screen similar to the following displays. Register Window Module Window Command Window To load the MON251.DLL CPU driver, type the following in the command window. load mon251.dll This is shown in the following figure.
  • Page 50 When using the MCB251 evaluation board, the baud rate should be set for 57,600 baud. You must determine which COM port you use.
  • Page 51 As you step through the BLINKY program, you will see how the Parallel Ports dialog box mirrors the LEDs on the MCB251 evaluation board. When you are ready to exit dScope, click on the Stop button in the module window and select the Exit command in the File menu.
  • Page 52: External Uart Example

    #define EXTSIO_DLM ((volatile unsigned char far *) (EXTSIO_ADDR + 1)) #define EXTSIO_CLK 1843200UL /*----------------------------------------------- This function sets the baudrate for the external UART on the MCB251. -----------------------------------------------*/ void extsio_baudrate ( unsigned long baudrate) unsigned long baud_divisor; unsigned char lcr_save; lcr_save = *EXTSIO_LCR;...
  • Page 53 MCB251 Evaluation Board User’s Guide /*----------------------------------------------- This function performs a general initialization of the external UART on the MCB251. -----------------------------------------------*/ void extsio_setup ( unsigned long baudrate) unsigned char dummy; extsio_baudrate (baudrate); *EXTSIO_LCR = 0x03; /* 8-bit, 1 stop, no parity */ *EXTSIO_IER = 0x00;...
  • Page 54 Chapter 4. Programming /*----------------------------------------------- putchar replacement for external UART. -----------------------------------------------*/ char putchar (char c) extsio_putchar (c); return (c); /*----------------------------------------------- Wait dummy function -----------------------------------------------*/ void wait (void) /* just to waits some time */ /*----------------------------------------------- Setup the external UART for 57600 baud, write the string "Hello World nnn", and repeat.
  • Page 55: Chapter 5. Using The 251 Monitor

    MCB251 Evaluation Board User’s Guide Chapter 5. Using the 251 Monitor The MCB251 comes ready-programmed with the Keil 251 monitor (MON251). The monitor programmed in the Monitor EPROM is setup to communicate at 57,600 baud using the EXT_RS232 interface and 19,200 baud using the INT_RS232 interface with a 12MHz oscillator.
  • Page 56 Chapter 5. Using the 251 Monitor Starting the MON251 Terminal Program Use the following command line to start the MON251 terminal program. MON251 COM1|COM2|COM3|COM4 INT14|NOINT BAUDRATE(n) where: Specifies the serial port to use. You may use the COM port COM1: - COM4: number (1, 2, 3, or 4) as an abbreviation.
  • Page 57: Terminal Commands

    MCB251 Evaluation Board User’s Guide Terminal Commands The MON251 terminal program supports the following commands: Exit MON251 and return to DOS. Exit Exit MON251 and return to DOS. Transmit the contents of a file. Echo the contents of the screen to a file.
  • Page 58 Chapter 5. Using the 251 Monitor F3: Echo the Contents of the Screen to a File When you enter , MON251 responds with the following prompt. Alt+3 Output File: Here, you may enter a file where the contents of the screen will be copied. For example: Output File: DEBUG.PRN...
  • Page 59: Index

    MCB251 Evaluation Board User’s Guide Index Example Program _getkey..........46 151 CPU..........6 External UART ......46 20V8........... 15 FLASH ......... 31 251 CPU..........14 ext_Uart DIP Switch ......6 251 Monitor ........49 External UART Example 51/151 DIP Switch ....... 7 Program ...........
  • Page 60 Index Push Buttons........16 Help Command......52 Terminal Commands ....51 putchar ..........46 MON251 environment variable..50 MON251 Terminal Program ....49 Monitor Data Space......28 Schematics..........18 Monitor DIP Switch ......7 Serial Port ...........16 Monitor EPROM Addresses....26 Setup.............3 Monitor Interrupt Vectors ....28 Software Requirements ......3 Monitor Memory Map......27 SRC/D2 DIP Switch ......6 Monitor Modes ........11 Status LEDs........16...

Table of Contents