Keil MCB251 User Manual

Summary of MCB251

  • Page 1

    Mcs ® 251 microcontroller target board for intel 251sb, temic 251g1/a1, and intel 151 and 8051 derivatives user’s guide 07.97.

  • Page 2

    Ii keil software information in this document is subject to change without notice and does not represent a commitment on the part of the manufacturer. The software described in this document is furnished under license agreement or nondisclosure agreement and may be used or copied only in accordance ...

  • Page 3: Preface

    Mcb251 evaluation board user’s guide iii preface this manual describes the keil software mcb251 evaluation board and the mcs ® 251 microcontroller software development tools. The following chapters are included: “chapter 1. Introduction” gives an overview of this user’s guide and provides a quick st...

  • Page 4: Document Conventions

    Iv preface document conventions this document uses the following conventions: examples description readme.Txt 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 repres...

  • Page 5: Contents

    Mcb251 evaluation board user’s guide v contents chapter 1. Introduction ..................................................................................... 1 quick start..................................................................................................................... 2 chapter 2...

  • Page 6

    Vi contents.

  • Page 7: Chapter 1.  Introduction

    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...

  • Page 8: Quick Start

    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 config...

  • Page 9: Chapter 2.  Setup

    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 ...

  • Page 10: Using The McB251

    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 de...

  • Page 11: Configuring The McB251

    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 ...

  • Page 12: Dip Switches

    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 ...

  • Page 13

    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...

  • Page 14

    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 m...

  • Page 15: Configuration Jumpers

    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. ...

  • Page 16: Cpu Selection

    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 configurat...

  • Page 17: Monitor Modes

    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 th...

  • Page 18

    12 chapter 2. Setup.

  • Page 19: Chapter 3.  Hardware

    Mcb251 evaluation board user’s guide 13 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 a...

  • Page 20

    14 chapter 3. Hardware 5.5mm barrel plug with a 2.5mm center hole. The center hole provides positive voltage. 5 volts dc is generated and provided to the board by a 7805 voltage regulator at ic2. To reduce the noise for the 251a1 a/d converter a second 78l05 voltage regulator is provided at ic6. 251...

  • Page 21

    Mcb251 evaluation board user’s guide 15 in non-page mode, the 251/151 multiplexes the address bus (a0-a7) and data bus (d0-d7) on port 0. This is the same way the standard 8051 works. To support non-page mode, the configuration jumpers must be in the nonp position. In non-page mode, the address bus ...

  • Page 22

    16 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 monit...

  • Page 23

    Mcb251 evaluation board user’s guide 17 both serial ports are configured as a standard 3-wire interface. The handshaking signals are connected to loop the pc’s signals back. Refer to the figure at the right to determine how the db9 connector for this port is wired. Prototyping area a perforated area...

  • Page 24: Schematics

    18 chapter 3. Hardware schematics.

  • Page 25

    Mcb251 evaluation board user’s guide 19.

  • Page 26

    20 chapter 3. Hardware.

  • Page 27

    Mcb251 evaluation board user’s guide 21.

  • Page 28: Printed Board Assembly

    22 chapter 3. Hardware printed board assembly.

  • Page 29: Technical Data

    Mcb251 evaluation board user’s guide 23 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, intel 8...

  • Page 30

    24 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; end else begin rd_ram = psen a16_ram = a[16] end if (mon_r...

  • Page 31

    Mcb251 evaluation board user’s guide 25 a16_rom = a[16] a16_ram = a[16] rd_ram = psen end 3: begin ; 8051 mode cs_ram = /(a[15] * a[14] * a[13]) ; ram 00000 - 0dfff 8051 mode cs_rom = 1; ; rom 00000 - 0ffff a16_rom = 0 a16_ram = 0 rd_ram = /a[16] end end end if (map[1..0] = #b11) then ; 8051 mode? B...

  • Page 32: Monitor Eprom Addresses

    26 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 ...

  • Page 33: Chapter 4.  Programming

    Mcb251 evaluation board user’s guide 27 chapter 4. Programming writing programs for the mcb251 is relatively simple. However, before you get started, there are a few points you should keep in mind. N the 251 supports a new hardware architecture that is different from that of the 8051. The 251 begins...

  • Page 34

    28 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 in...

  • Page 35

    Mcb251 evaluation board user’s guide 29 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 ...

  • Page 36

    30 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) directi...

  • Page 37: Blinky Example Program

    Mcb251 evaluation board user’s guide 31 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 ...

  • Page 38

    32 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, 0...

  • Page 39

    Mcb251 evaluation board user’s guide 33 create the blinky.C source file start µvision by double -clicking on the icon in the 251 tools group. 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. Enter the blink...

  • Page 40

    34 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. You...

  • Page 41

    Mcb251 evaluation board user’s guide 35 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. Additi...

  • Page 42

    36 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 b...

  • Page 43

    Mcb251 evaluation board user’s guide 37 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 inclu...

  • Page 44

    38 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...

  • Page 45

    Mcb251 evaluation board user’s guide 39 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… command in the options menu. You...

  • Page 46

    40 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 you...

  • Page 47

    Mcb251 evaluation board user’s guide 41 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. Th...

  • Page 48

    42 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: n load the mon251.Dll cpu driver. N configure the cpu driver for the appropriate com port and baud rate. N configure the cpu dri...

  • Page 49

    Mcb251 evaluation board user’s guide 43 when dscope starts, a screen similar to the following displays. To load the mon251.Dll cpu driver, type the following in the command window. Load mon251.Dll this is shown in the following figure. Command window register window module window.

  • Page 50

    44 chapter 4. Programming typically, the first time you load the cpu driver for the 251 monitor, you must set the com port and baud rate. If dscope cannot determine the com port and the baud rate automatically, the following dialog box appears informing you that dscope could not find the target syst...

  • Page 51

    Mcb251 evaluation board user’s guide 45 you may now single step through the blinky program by clicking on the stepover button on the right side of the module window. As you step through the program, you should see the leds on the mcb251 changing. You may display the status of the i/o ports in dscope...

  • Page 52: External Uart Example

    46 chapter 4. Programming external uart example the following example program shows you how to use the external uart to send and receive serial data. The _getkey and putchar routines are included for use with the stream functions like printf. #include #include #define delay 50000l #define extsio_add...

  • Page 53

    Mcb251 evaluation board user’s guide 47 /*----------------------------------------------- this function performs a general initialization of the external uart on the mcb251. -----------------------------------------------*/ void extsio_setup ( unsigned long baudrate) { unsigned char dummy; extsio_ba...

  • Page 54

    48 chapter 4. Programming /*----------------------------------------------- putchar replacement for external uart. -----------------------------------------------*/ char putchar (char c) { extsio_putchar (c); return (c); } /*----------------------------------------------- wait dummy function -------...

  • Page 55: Mon251 Terminal Program

    Mcb251 evaluation board user’s guide 49 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 interfac...

  • Page 57: Terminal Commands

    Mcb251 evaluation board user’s guide 51 terminal commands the mon251 terminal program supports the following commands: n exit exit mon251 and return to dos. N f1 exit mon251 and return to dos. N f2 transmit the contents of a file. N f3 echo the contents of the screen to a file. N help display the he...

  • Page 58

    52 chapter 5. Using the 251 monitor f3: echo the contents of the screen to a file when you enter f3 or alt+3 , mon251 responds with the following prompt. Output file: here, you may enter a file where the contents of the screen will be copied. For example: output file: debug.Prn directs mon251 to wri...

  • Page 59: Index

    Mcb251 evaluation board user’s guide 53 index _getkey ............................................... 46 151 cpu............................................... 6 20v8................................................... 15 251 cpu............................................. 14 251 monitor ..............

  • Page 60

    54 index help command.............................52 terminal commands ....................51 mon251 environment variable..........50 mon251 terminal program ..............49 monitor data space............................28 monitor dip switch .............................7 monitor eprom addresses......