Keil MCB167-NET User manual

MCB167-NET
Evaluation Board
High-Speed Microcontroller Board
for Infineon 167 and ST10-167/168 variants
with dual CAN and Ethernet Controller
User’s Guide 05.2000

2 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 with the terms of the
agreement. It is against the law to copy the software on any medium except as
specifically allowed in the license or nondisclosure agreement. The purchaser
may make one copy of the software for backup purposes. No part of this manual
may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or information storage and
retrieval systems, for any purpose other than for the purchaser’s personal use,
without written permission.
Copyright © 1993-2000 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
Keil C166™ and µVision2™ are trademarks of Keil Elektronik GmbH.
Microsoft®and Windows™ are trademarks or registered trademarks of
Microsoft Corporation.
Every effort was made to ensure accuracy in this manual and to give appropriate
credit to persons, companies, and trademarks referenced herein.

MCB167-NET Board User’s Guide 3
Preface
This manual describes the Keil Software MCB167-NET Evaluation Board and
the 166 microcontroller software development tools. The following chapters 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 MCB167-NET board and the logic equations for
the PLD.
“Chapter 4. Programming” gives details about how to use our tools to generate
programs for the MCB167-NET evaluation board.
NOTE
This manual assumes that you are familiar with Microsoft Windows and the
hardware and instruction set of the 166/167 microcontrollers.

4 Contents
Contents
Chapter 1. Introduction......................................................................................5
Quick Start ....................................................................................................................6
Chapter 2. Setup..................................................................................................7
Using the MCB167-NET ..............................................................................................7
Configuring the MCB167-NET ....................................................................................8
DIP Switches.................................................................................................................9
Configuration Jumpers ................................................................................................11
Chapter 3. Hardware........................................................................................13
PAL Equations ............................................................................................................17
Schematics ..................................................................................................................18
Printed Board Assembly .............................................................................................22
Technical Data ............................................................................................................23
Pin-Out of Port Signals ...............................................................................................23
Chapter 4. Programming .................................................................................25
Writing Programs for the MCB167-NET....................................................................25
BLINKY Example Program........................................................................................28
Other Example Programs ............................................................................................29
Application Notes .......................................................................................................29
Index....................................................................................................................30

MCB167-NET Board User’s Guide 5
Chapter 1. Introduction
Thank you for letting Keil Software provide you with the MCB167-NET
evaluation board and software for the 166/ST10 microcontroller family. With
this kit you can generate code and then operate it on the MCB167-NET
evaluation board. This hands-on process helps you determine hardware and
software needs for current and future product development.
The MCB167-NET evaluation board operates with all CPU variants of the
Infineon C167 and ST10-167/168. It supports the dual on-chip CAN controllers
available in some devices and provides the Crystal LAN CS8900A Ethernet
controller. You may implement an TCP/IP stack on this board that allows you to
connect the board to the Internet via a standard 10Mbit Ethernet network.
Several program examples are provided: a simple test program that flashes the
LEDs, a program that writes “Hello World” to the serial port, and a measurement
recording system.
TCP/IP stack implementations for the RTX-166 real-time operating system are
available from ARS Software (www.ars2000.com) and US Software
(www.ussw.com).
This user’s guide describes the hardware of the MCB167-NET evaluation board
and contains basic operating instructions for the monitor program (Monitor-166)
and the µVision2 debugger The monitor programs let you communicate
between your PC and the MCB167-NET evaluation board and let you download
and run your 166/167 programs.
The MCB167-NET kit includes the following items:
MCB167-NET Evaluation Board User’s Guide (this manual),
MCB167-NET Evaluation Board,
CD-ROM which in includes an evaluation version of the Keil C166 compiler
and example programs for the MCB167-NET Evaluation Board,
9-pin Serial Cable.

6 Chapter 1. Introduction
Quick Start
Use the following list to quickly locate important information about the
MCB167-NET evaluation board.
To… See…
Connect power to the MCB167-NET board. “Using the MCB167-NET” on page 7.
Connect the MCB167-NET to your PC. “Using the MCB167-NET” on page 7.
Read about the default configuration settings. “Configuring the MCB167-NET” on page 8.
Configure the tool options for the MCB167-NET
board.
“Writing Programs for the MCB167-NET” on
page 25.
Create a simple program to blink the LEDs. “BLINKY Example Program” on page 28.
Write code to use the Ethernet controller. “Other Example Programs” on page 29.
Learn more about the µVision2 IDE. “Writing Programs for the MCB167-NET” on
page 25.
Read about the DIP switch settings. “DIP Switches” on page 9.
Read about the configuration jumpers. “Configuration Jumpers” on page 11.
See the MCB167-NET schematics. “Schematics” on page 18.
See the MCB167-NET PAL equations. “PAL Equations” on page 17.

MCB167-NET Board User’s Guide 7
Chapter 2. Setup
The MCB167-NET evaluation board requires power and a serial connection to a
PC running the µVision2 Debugger with the Monitor-166 driver. Before you
start, make sure you have satisfied the following hardware and software
requirements.
Hardware/Software Requirements
A PC running Microsoft Windows-95/98, Windows NT or Windows-2000
with an available RS-232 port.
The Keil C166 tool chain with µVision2 Debugger with the Monitor-166
driver. A pre-configured Monitor for the MCB167-NET board is included in
Keil C166 Version 4.06 or higher. This package contains also several
example programs for the MCB167-NET board.
Using the MCB167-NET
To use the MCB167-NET evaluation board, you must:
Connect the external serial port jack (COM) to a serial port on your PC using
the supplied serial cable.
Connect power using a DC 9V= 500mA power supply.
The serial cable lets your PC download program code and debug your target
applications. The power cable provides power to the MCB167-NET evaluation
board. The MCB167-NET does not get power from the PC via the serial cable.

8 Chapter 2. Setup
The following illustration shows MCB167-NET board and the important
interface and hardware components.
Configuring the MCB167-NET
You configure the MCB167-NET evaluation board with the DIP switches and
the configuration jumpers. The MCB167-NET evaluation board is shipped with
the following configuration:
20 MHz internal CPU clock, 3 chip select signals, 4 segment address lines.
enabled bootstrap loader for downloading the debug monitor,
enabled CAN drivers and CAN bus termination resistors,
5V reference voltage for the A/D converter.
The default DIP switch settings are shown in the following table.
Switch CLKCFG SALSEL CSSEL BTYP BSL
ON X X X X X X X
OFF X X X
Power Supply
DC 9V 500mA
A
SC0
Serial Jack
DIP
Switches
CAN
connectors
NMI Interrupt
Button
1 MByte
SRAM
Infineon C167 o
r
ST10-167/168 variant LED’s for Power and Port P2.0 .. P2.7 Status
Prototyping
Area
Port & Bus
Signals
Configuration
Jumpers
Reset Button
Sockets for
Flash ROM

MCB167-NET Board User’s Guide 9
DIP Switches
The following sections describe each of the DIP switches of the MCB167-NET
board.
CLKCFG: Default OFF ON OFF
The CLKCFG switches select the clock generation. The 167 device used an on-
chip PLL that generates from the external 10MHz XTAL the CPU clock signal.
The following table shows the possible internal CPU clock when the standard
10MHz XTAL is used. Check the maximum possible internal CPU clock with
the datasheet of actual device.
15 14 13 internal CPU clock Note
OFF OFF OFF 10MHz * 4 = 40MHz
OFF OFF ON 10MHz * 3 = 30MHz
OFF ON OFF 10MHz * 2 = 20MHz default setting
OFF ON ON 10MHz * 5 = 50MHz
ON OFF OFF 10MHz direct drive, on-chip PLL is off
ON OFF ON 10MHz * 1.5 = 15MHz only possible on some CPU variants
ON ON OFF 10MHz * 0.5 = 5MHz only possible on some CPU variants
ON ON ON 10MHz * 2.5 = 25MHz only possible on some CPU variants
SALSEL : Default ON ON
The SALSEL switches define the number of active segment address lines on
Port 4. For using the CAN interface only the A19..A16 address lines can be
enabled, since the other Port 4 pins are CAN I/O pins. Even if some segment
address lines are disabled, the device internally uses a complete 24-bit address.
The full address space can be still used via the CS signals.
12 11 Segment Address Lines Directly accessible Address Space
OFF OFF Two: A17…A16 256 KByte
OFF ON Eight: A23…A16 16 MByte
ON OFF None 64 KByte
ON ON Four: A19..A16 1 MByte (default setting)

10 Chapter 2. Setup
CSSEL: Default ON ON
The CSSEL switches define the number of active chip select signals. The CS/
signals are generated on Port 6 and are used as chip select lines for the RAM,
Flash ROM and Ethernet devices on the MCB167-NET board.
10 9 Segment Address Lines Note
OFF OFF Five: CS4/…CS0/ gives two additional user CS lines.
OFF ON None Port 6 pins are free; requires board
modification
ON OFF Two: CS1/…CS0/
ON ON Three: CS2/...CS0/ default setting for the MCB167-NET Board
BTYP: Default OFF ON
The BTYP switches select the external bus type. The MCB167-NET board uses
an demultiplexed 16-bit address bus. Therefore the bus type cannot be changed
without extensive modification of the MCB167-NET hardware. The following
table lists the possible external bus types with the 167 CPU.
7 6 External Bus Note
OFF OFF 16-bit multiplexed BUS
OFF ON 16-bit demultiplexed BUS default setting for the MCB167-NET Board
ON OFF 8-bit multiplexed BUS
ON ON 8-bit demultiplexed BUS
BSL: Default ON
The BSL switch actives the on-chip bootstrap loader. The bootstrap loader
allows you to download the Monitor-166 for program debugging with µVision2.
This Monitor download is automatically performed when you start the µVision2
debugger. When BSL is OFF you may use an Monitor program that is
programmed into the on-chip ROM of the C167 device.

MCB167-NET Board User’s Guide 11
Configuration Jumpers
The following sections describe each of the configuration jumpers of the
MCB167-NET board.
CAN1, CAN2: Default ON
The CAN1 and CAN2 configuration jumper enable on 120Ωtermination resistor
on the CAN1 or CAN2 bus interface. This resistor is used on the end of each
CAN communication line.
P2.15: Default ON
The P2.15 configuration jumper provides the interrupt request signal of the
Ethernet controller to the EX7IN interrupt input of the C167 CPU.
EA/: Default ON
The EA/ configuration jumper selects on-chip or off-chip program execution.
With the default setting the CPU starts instruction execution from external
memory. When the EA/ jumper is off, code execution starts from on-chip ROM.
WRCFG: Default ON
The WRCFG configuration jumper selects the initial operation of the WR/ and
BHE/ signals. For correct operation the MCB167-NET board requires a WRH/
and WRL/ signal. Therefore this jumper should be always ON.
A20, A21, A22, A23: Default ON
The A20…A23 configuration jumpers connect the CAN bus drivers (IC9 and
IC11) to the C167 CAN interface signals. When you remove the A21 and A22
jumpers you disconnect the CAN1 bus driver. With A20 and A24 the CAN2 bus
driver is disconnected.

12 Chapter 2. Setup
VAREF, VAGND: Default ON
This configuration jumpers provide the reference voltage for the A/D converter.
When you set this jumpers to off, you may supply an user provided reference
voltage.
VPP: Default OFF
VPP provides the flash programming voltage for some devices. In some device
variants. On some device variants this jumpers might be used to disable the
oscillator watchdog. For detailed information about the usage of this jumper
refer to the description of pin 84 in chip datasheet of the device used on the
board.

MCB167-NET Board User’s Guide 13
Chapter 3. Hardware
The MCB167-NET is designed to be a very flexible evaluation board that you
can use for a wide variety of 167 and ST10-167/168 variants. It supports up to
two CAN interfaces that can be enabled using jumpers. We have also tried to
provide a board that can be expanded to support your own hardware prototypes.
This chapter describes logical sections of the MCB167-NET and also provides a
circuit description. The descriptions here will help you understand how the
MCB167-NET board works and how you can easily interface to the various I/O
devices available.
The following block diagram shows the various memory, I/O, configuration, and
power systems that compose the board.
Input
8 - 12V DC
Output
5V +/-5%
500 m
A
Power
Supply
CPU
C167
ST10-167
ST10-168 Bus & Port
Signals
Flash ROM
Reset & Interrupt
Button
Configuration
RAM
P
or
t2
LED
s
Ethernet
Controller 10Base-T
dual CAN
RS232
Memory System User I/O
Power Supply
Power is supplied to the MCB167-NET from an external 8-12 Volt DC power
supply which is capable of providing 400-500mA. Connection is made using a

14 Chapter 3. Hardware
standard 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 A/D converter a second
78L05 voltage regulator is provided at IC6.
C167 CPU
The Infineon C167CR or C167CS provided with the MCB251 are high-end 167
devices with on-chip CAN. The CPU is located at IC1. The IC1 socket can
accommodate a variants of the 167 including ST10-167/168. A 10.000 MHz
crystal provides the clock signal for the CPU.
Configuration
The MCB167-NET is a very flexible evaluation board. You can change the
operation of the board using the DIP switches and the configuration jumpers.
Features such as CAN interfaces, chip select and segment address lines, internal
CPU clock frequency, on-chip ROM usage, and Monitor operation can all be
configured using these switches and jumpers. Refer to “DIP Switches” on page
9 and “Configuration Jumpers” on page 11 for a complete description of the DIP
switches and configuration jumpers.
NOTE
You must RESET the MCB167-NET after changing the state of any DIP switch.
CAN Drivers
The MCB167-NET provides a dual CAN interface with SI9200AY CAN drivers
(IC9 and IC11) and termination resistors (R18 and R19). The settings of this
CAN drivers can be changed with various configuration jumpers.
Memory Devices
The MCB167-NET provides two high-speed RAM devices (IC5, IC8) and
sockets for two Flash ROM devices (IC3, IC4). The chip select signals are
directly provided by the C167 CPU: CS0/ is used for the Flash ROM; and CS1/
is the signal for the RAM.

MCB167-NET Board User’s Guide 15
Ethernet Interface
The Ethernet controller CS8900A (IC7) is the interface to the Ethernet
connector. The MCB167-NET provides a standard 10Base-T (10MBit) interface
that allows direct connection to most Ethernet networks. The chip select signal
CS2/ from the C167 CPU is used to access the Ethernet controller as memory
mapped device.
Decode Logic
All memory address decode logic and signal conversions required for the
CS8900A Ethernet controller are performed by the 20V8 PAL (IC15). Refer to “
PAL Equations” on page 17 for a complete listing of the PAL equations used.
Status LEDs
The MCB167-NET has a power LED labeled PWR which indicates the power to
the board is on. Eight LEDs are connected to the Port 2 outputs for status
display in user programs. The LEDs labeled LAN and LINK show the current
status of the Ethernet interface.
Push Buttons
The MCB167-NET provides two push buttons. The first push button, labeled
RESET, is connected to the reset input of the CPU. The second button, labeled
NMI, is connected to the NMI (non-mask able interrupt) of the CPU. You may
generate an NMI signal to stop program execution when you are using the
Monitor-166 for program debugging.
Serial Port
The MCB161-NET supports the ASC0 serial UART and uses a MAX232 (IC10)
to convert the logic signals to RS-232 voltage levels. The ASC0 UART is used
in bootstrap mode to download the Monitor-166 program. This Monitor
program allows program test using the µVision2 debugger.
Two drivers of the MAX232 (IC10) are pre-wired to use the simulated serial
mode of the Monitor-166. In this mode two standard I/O pins of the 167 device
are used to establish communication between the µVision2 debugger and the

16 Chapter 3. Hardware
MCB167-NET board. For this operation the Monitor-166 needs to be
programmed into ROM.
The serial port (COM) is 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 is provided on the MCB167-NET for prototyping your own
hardware. All CPU signals are connected to this prototyping area. The signals
provided are driven directly by the CPU. Exercise caution to avoid overloading
these signal lines. Refer to “Pin-Out of Port Signals” on page 23 for the pin-out
of the CPU and bus signals.

MCB167-NET Board User’s Guide 17
PAL Equations
This following lists the PAL equations for the 20V8 logic device at IC12.
;PALASM Design Description
;---------------------------------- Declaration Segment ------------
TITLE GAL for MCB167NET Prototype board
PATTERN Decode Logic for Ethernet Controller
REVISION 1.0
AUTHOR Hans Schneebauer
COMPANY Keil Elektonik GmbH
DATE 09/30/99
CHIP IC15 PALCE20V8
;---------------------------------- PIN Declarations ---------------
PIN 1 UNUSED1 COMBINATORIAL ; INPUT
PIN 2..6 A[8..12] COMBINATORIAL ; INPUT
PIN 7 /RD COMBINATORIAL ; INPUT
PIN 8 /WRL COMBINATORIAL ; INPUT
PIN 9 /WRH COMBINATORIAL ; INPUT
PIN 10 /RSTOUT COMBINATORIAL ; INPUT
PIN 11 /CS2 COMBINATORIAL ; INPUT
PIN 12 GND ; INPUT
PIN 13 UNUSED2 COMBINATORIAL ; INPUT
PIN 14 UNUSED3 COMBINATORIAL ; INPUT
PIN 15 RESET COMBINATORIAL ; OUTPUT
PIN 16 /IOW COMBINATORIAL ; OUTPUT
PIN 17 /IOR COMBINATORIAL ; OUTPUT
PIN 18 /MEMW COMBINATORIAL ; OUTPUT
PIN 19 /MEMR COMBINATORIAL ; OUTPUT
PIN 20 AEN COMBINATORIAL ; OUTPUT
PIN 21 /REFRESH COMBINATORIAL ; OUTPUT
PIN 22 /SBHE COMBINATORIAL ; OUTPUT
PIN 23 UNUSED4 COMBINATORIAL ; INPUT
PIN 24 VCC ; INPUT
;----------------------------------- Boolean Equation Segment ------
EQUATIONS
RESET = RSTOUT
SBHE = WRH + RD
AEN = 0
REFRESH = 0
IF (A[11..8] = #b0011) THEN ; If in Range 0300H - 03FF -> IO Interface
BEGIN
IOR = RD * CS2
IOW = (WRL + WRH) * CS2
MEMR = 0 ; MEMR always inactive
MEMW = 0 ; MEMW always inactive
END
ELSE ; If in Range 0 - 02FF or 0400 - 0FFF
BEGIN ; -> Memory Interface
IOR = 0 ; IOR always inactive
IOW = 0 ; IOW always inactive
MEMR = RD * CS2
MEMW = (WRL + WRH) * CS2
END
;-------------------------------------------------------------------

18 Chapter 3. Hardware
Schematics

MCB167-NET Board User’s Guide 19

20 Chapter 3. Hardware
Table of contents
Other Keil Motherboard manuals