You are on page 1of 58

MCB2140 User's Guide

The MCB2140 User's Guide describes the MCB2140 Board and contains detailed operating
instructions for the hardware.

Introduction gives an overview of the MCB2140 Evaluation Board, hardware and software
requirements, where to find information quickly, and where to find Technical Support.
Setup shows the MCB2140 Board components, how to connect, configure, and use the
board, and describes the jumpers.
Theory of Operation explains the components of the MCB2140 board in detail.
Writing Programs describes how to write programs, download to flash, and configure your
project for debugging for the MCB2140 board.
Example Programs lists example programs available on the installation CD. There are stepby-step instructions on building and running programs on the MCB2140 board.

Introduction
The Keil MCB2140 Evaluation Board allows you to generate and test application programs for
the NXP LPC2100 microcontroller family. With this hands-on process, you can determine the
hardware and software requirements for current and future product development.
The MCB2140 Evaluation Board ships with an LPC214x device that is a superset of several
other device variants of the NXP LPC2100 microcontroller series. The MCB2140 Board contains
all hardware components required in a single-chip LPC2100 system.

Kit Contents
Home Introduction Kit Contents

The MCB2140 kit includes:


The MCB2140 Evaluation Board.
A Vision IDE Quick Start Guide.
An ARM Development Tools Overview.
Example Programs for the MCB2140 Evaluation Board are located in the folders
KEIL\ARM\RV30\BOARDS\KEIL\2130 and 2140.
Examples in both the 2130 and 2140 folders work for the MCB2140 Evaluation Board.
All examples can be compiled and debugged using the Lite Edition.

Features
Home Introduction Features

The connectors on the MCB2140 evaluation board provide easy access to many of the on-chip peripherals.

USB 2.0 Full Speed Interface


A USB interface connector on the MCB2140 board interfaces with the on-chip USB peripheral of the
LPC2148 device. You may configure the board as a self-powered or a USB powered device.
Dual Serial Ports
Standard DB9 connectors are on the MCB2140 for both of the LPC2148's serial ports.
Your application may use either of these ports.
LF Amplifier
An LF Amplifier on the MCB2140 connects the D/A output of the LPC2148 device to a speaker.
You may use this LF Amplifier to generate sound.
Analog Voltage Control for ADC Input
An adjustable analog voltage source is on the MCB2140 board for testing the
Analog to Digital output feature of the LPC2148. A configuration jumper enables and disables this feature.
JTAG Download and Debug
A JTAG interface is on the MCB2140 board and, coupled with the ULINK USB-JTAG adapter,
allows flash programming. The on-chip debug interface can perform real-time in-circuit emulation of the
LPC2148 device. For fast PC communication, use your PC's USB port.

Hardware Requirements
Home Introduction Hardware Requirements

To use the MCB2140 Evaluation Kit, you need:

The MCB2140 Evaluation Board.


An IBM-compatible PC with one of the following:

Two unused USB ports to supply power to the board, and to perform
ULINK USB-JTAG downloading and debugging.

Or

An unused RS232 COM port for Flash In-System Programming (ISP) via Serial Interface.

To run the Keil debugger using JTAG emulation, you need:

A ULINK USB-JTAG Adapter.


Two USB serial cables, no longer than 10ft/3m.

To program the MCB2140 using the Flash Magic utility, you need:

A serial cable, 9-pin male to 9-pin female, no longer than 10ft/3m, wired one-to-one.

Software Requirements
Home Introduction Software Requirements

You must install the following required software to use the MCB2140 Evaluation Board:

Windows Operating System


The Keil Vision tool chain runs in these Windows Operating Systems:

Microsoft Windows 2000


Microsoft Windows XP

Tools and Examples


To compile, link, and run applications on the MCB2140 Evaluation Board,
you must install these Keil products:

Keil Professional Development Suite for ARM.


Example programs written for the MCB2140. These programs are included in the PK-ARM,
DB-ARM and Keil ARM Evaluation Toolkits.

Quick Start
Home Introduction Quick Start

Use the following table to locate important information about the MCB2140 board and get started quick.
To

See

Connect power to the MCB2140 board.

Setup

Connect the MCB2140 via ULINK/JTAG to your PC.

Connecting the MCB2140

Read about the default configuration settings.

Configuring the MCB2140

Configure the tool options for the MCB2140 board.

Writing Programs

Learn more about the Vision IDE.

Vision User's Guide

Review the MCB2140 schematics.

Schematics

Setup
Home Setup

Setting up the MCB2140 evaluation board is easy. Explanations for the board setup
and its components are presented here. Details about the connecting and configuring procedures
for the MCB2140 board are also presented, with a separate topic for the connector descriptions.
Setup includes using the MCB2140 board with ULINK.
The MCB2140 board requires a USB connection for power and either a serial connection
for In-System Programming, or another USB connection for the ULINK-USB adapter
between your development PC and the JTAG connector.
Before you start, make sure you have satisfied the hardware and software requirements.

Board Setup
Home Setup Board Setup

The MCB2140 Evaluation Board is a USB-powered device.

The MCB2140 Evaluation Board connects directly to the Keil Vision Debugger using the
Keil ULINK USB-JTAG Adapter, so no additional software is required on the board.
The MCB21400 Evaluation Board connects to a PC via a standard USB cable that provides power.

Board Components
Home Setup Board Components

The following illustration shows the important interface and hardware components
of the MCB2140 board.

Connecting with ULINK


Home Setup Connecting with ULINK

To use the MCB2140 Evaluation Board with ULINK, you must:

Connect the ULINK to the PC via a standard USB cable.


Connect ULINK to the JTAG connector of the MCB2140 board.
Make sure that J9 - JTAG is ON.
Connect power to the board using a standard USB cable.

The following picture shows how to connect ULINK to the MCB2140 board.

Note

If your application program puts the ARM device in idle or power-down mode, the
Embedded ICE in the LPC2000 core (and subsequently the ULINK) stops working.
Therefore, do not put the ARM device into the power saving modes during the
software development cycle.

Connecting with Serial ISP


Home Setup Connecting with Serial ISP

To connect the MCB2140 Evaluation Board for serial programming, you must:

Configure the jumpers for Flash Magic:


J1 & J10 ON
J8 & J9 OFF
Connect power to the MCB2140 Board using a standard USB cable.
Connect a 9-pin serial cable from a COM port on your PC to the COM0 connector
on the MCB2140 Board.
Verify the COM Connection using Flash Magic.

Verifiying the COM Connection


Home Setup Connecting with Serial ISP Verifiying the COM Connection

After setting up the MCB2140 Board, use Flash Magic to verify the COM connection.
1. Start Flash Magic (using Start Programs Flash Magic) and configure
the COM Port interface as illustrated.

2. Verify the COM connection using the menu command ISP Read Device Signature....

3. The Read Device Signature... displays the following window. Then close the Window.

If there are any errors, recheck your PC COM port designation and the jumper settings:

J1 & J10 ON
J8 & J9 OFF

Configuring the MCB2140


Home Setup Configuring the MCB2140

The MCB2140 Evaluation Board is configured using the jumpers J1 - J15.


The MCB2140 Board ships with the following configuration:
Jumper

State

Description

J1 - ISP

OFF

Disables In-System Programming via COM0.

J2 - AV

ON

Connects POT1 potentiometer to AIN0 for analog


input demonstration.

J3 - 3.3V

ON

Connects 3.3V to CPU.

J4 - VBAT

ON

Connects VBAT to CPU.

J5 - V3A

ON

Connects analog reference voltage to CPU.

J6 - LED

ON

Enables Port1.16 - Port1.23 LEDs.

J7 - INT1

ON

Enable INT1 Push Button.

J8 - ETM

OFF

Disables Embedded Trace Macrocell

J9 - JTAG

ON

Enables JTAG Interface

J10 - RST

ON

Enables Reset via COM0.

J11 - VREF

ON

Connects ADC VREF to 3.3V.

J12 - USB (D-)

ON

Connects USB Line D- to the USB connector.

J13 - AOUT

ON

Connects AOUT via LF amplifier to the


loudspeaker.

J14 - USB (D+)

ON

Connects USB Line D+ to the USB connector.

J15 - VR Vbus Signal

ON

Connects 5V USB supply voltage to the


Vbus pin (P0.23).

Configuring for the ULINK USB-JTAG Adapter


The default jumper settings (above) on the MCB2140 board are pre-configured for the
ULINK USB-JTAG adapter.

Configuring for Serial ISP Flash Programming


For programming the MCB2140 using the Flash Magic Utility, change the following
jumper from the above default settings:

Jumper J9 - OFF

Jumper Descriptions
Home Setup Jumper Descriptions

The jumpers used to configure the MCB2140 board are:

J1 - ISP: Enable for In-System Programming: lets the RTS line of the COM0 port
generate a signal on P0.14 (EINT1). When RTS is active P0.14 is driven low.
This is used to enter In-System Programming (ISP) mode.
J2 - AV: Analog Voltage for AIN0: connects the POT1 potentiometer to the analog
input AIN0.
J3 - 3.3V: Supply Voltage for CPU: connects the 3.3V Supply Voltage to the CPU.
J4 - VBAT: Supply Voltage for CPU: connects battery Supply Voltage to the CPU.
J5 - V3A: Analog Reference Voltage for CPU: connects the 3.3V Supply Voltage
to the CPU Analog Reference Input V3A.
J6 - LED: Enable LED Driver: enables the LED driver connecting the on-board LEDs
to GPIO Port1.16 - Port1.23.
J7 - INT1: Enable Push Button INT1: connects the push button INT1 to the CPU
I/O pin P0.14 (EINT1 input). Pushing the button generates a low signal.
J8 - ETM: Enable Embedded Trace Module: enables the Embedded Trace Module
(ETM). Port1.16 - Port1.23 LEDs cannot be used when J8 is set because these pins
share the same ETM signals.
J9 - JTAG: Enable JTAG Interface: enables the JTAG interface. This is required for
ISP flashing and for debugging via Keil ULINK or other JTAG debuggers.
J10 - RST: Enable Reset via COM0 Port: When RST is set, you may generate a CPU
RESET signal using the DTR signal of the COM0 port. An active DTR signal generates
a CPU RESET.
J11 - VREF: A/D Converter Reference Voltage: connects 3.3V Supply Voltage VREF
of the CPU.
J12 - D-: USB Line: connect the USB Line D- to the USB connector.
J13 - AOUT: D/A Output for loudspeaker: connects the AOUT output to the LF
amplifier.
J14 - D+: USB Line: connect the USB Line D+ to the USB connector.
J15 - VR: Vbus signal:connects 5V supply from the USB connector to the Vbus
pin (P0.23), indicating the presence of USB BUS power to the device.

Theory of Operation
Home Theory of Operation

The Theory of Operation explains the MCB2140 board hardware. The descriptions
help you to understand the MCB2140 board components and how to use the available
I/O interfaces.
The MCB2140 is designed to be a very flexible evaluation board for the NXP LPC2100
family of microprocessors. The MCB2140 evaluation board can be expanded to build
hardware prototypes.

Block Diagram
Home Theory of Operation Block Diagram

The hardware block diagram displays input, configuration, power system, and User
I/O on the board. This visual presentation helps you to understand the MCB2140
board components.

Technical Data
Home Theory of Operation Technical Data

Parameter

Description

Supply Voltage

5V DC (provided by the USB bus of a PC)

Supply Current

65mA typical, 120mA maximum

XTAL Frequency

12 MHz (Allows up to 60MHz CPU clock)

Microcontroller

NXP LPC214x

Peripherals

2 RS232 Interfaces,
1 JTAG Interface,
1 Analog Output (connected to
speaker by default)
1 Analog Input (connected to
potentiometer by default)
1 ETM Interface (optional)

Board Size

100mm x 110mm (3.95" x 4.35").

Prototyping Area
Home Theory of Operation Prototyping Area

The prototyping area provides blocks for connecting the address and data line, ports P0 and P1, +3.3V DC(Vcc),
and ground (GND).

Note
All microcontroller signals are brought out to pins and are driven directly
by the microcontroller. Exercise caution to avoid overloading these
signal lines.

Microcontroller
Home Theory of Operation Microcontroller

The NXP LPC214x microcontroller (IC1) provided with the MCB2140 board is a high-end LPC214x device
with advanced ADC, DAC and USB capabilities.

A 12.0 MHz crystal (Q1) provides the clock signal for the CPU.

Related Knowledgebase Articles


MCB2140: LPC2148 DEVICE RETURNS LPC2138 DEVICE ID

Power Supply
Home Theory of Operation Power Supply

Power is supplied to the MCB2140 board on your PC using a standard USB connector.
The voltage regulator (IC3) generates 3.3 Volts DC. The Power LED indicates when power is applied to the board.
Caution: Do not attach additional power supplies (such as batteries) while the USB supplies power to the MCB2140.
This may harm your P

Configuration
Home Theory of Operation Configuration

The MCB2140 evaluation board is very flexible and configures easily to suit your needs. Configuration jumpers control
the built-in features such as debug interfaces and Analog Input Voltages.
Refer to Configuring the MCB2140 and Jumper Descriptions for a description of the possible settings.
After changing configuration jumpers, you must reset the MCB2140 board.

Note
The LPC21xx device provides many configuration options. Some of these settings are available via configuration
resistors which are illustrated in the schematics topic.

JTAG Interface
Home Theory of Operation JTAG Interface

The JTAG Interface connector provides debugging and emulator support for the NXP LPC21xx device.
The JTAG Interface allows application debugging and programming of on-chip and off-chip Flash devices.

The standard JTAG 20-pin connector works with the Keil ULINK and many third party tool vendors.

LEDs
Home Theory of Operation LEDs

The LEDs on the MCB2140 board are:

The POWER LED indicates that power is present on the board.


P1.16 - P1.23 connect to eight Port 1 pins when jumper J6 is installed. These LEDs can display program status
while testing your applications. Removing Jumper J6 disables the LED drivers.

Push Buttons
Home Theory of Operation Push Buttons

The two push buttons on the MCB2140 board are:

The RESET push button connects to the reset circuit. This resets the microcontroller.
The INT1 push button connects to the external interrupt 1 (EINT1) of the microcontroller.
Removing Jumper J7 disables this button.

Potentiometer
Home Theory of Operation Potentiometer

The potentiometer on the MCB2140 board connects to Port 0.28 (AIN2) when the Jumper J2 is enabled.
The voltage range is 0.0-3.3 Volts.

Speaker
Home Theory of Operation Speaker

The MCB2140 board includes a speaker controlled by the output of the on-chip D/A converter.
The LM386M low voltage power amplifier (IC4) amplifies the D/A output to drive the speaker.
Jumper J13 connects the D/A output (Port 0, pin 25, P0.25/AOUT) to the input of the LM386M amplifier.
Removing this jumper disables the speaker.

Serial Ports
Home Theory of Operation Serial Ports

The MCB2140 board connects the ASC0 on-chip serial UART to the MAX563 (IC2), which converts the logic
signals to RS-232 voltage levels. The ASC0 UART may be used in bootstrap mode to download other utilities
for debugging or downloading flash.

In addition to the standard 3-wire interface, the COM0 DB9 connector is wired to allow a board RESET via
the DTR pin, and to enable In-System Programming (ISP) via the RTS pin as shown in the figure below.

Note
The Flash Magic Utility uses the DTR and RTS pins to control Flash downloading. You must install jumpers
J1 and J10 to program Flash with this utility.

The COM1 DB9 connector uses the standard 3-wire interface and does not connect the DTR or RTS pins
to any board component as shown in the figure below.

SD Connector
Home Theory of Operation SD Connector

The MCB2140 board supports one SD memory card connector that allows you to connect a wide range
of memory cards.

Writing Programs
Home Writing Programs

The Writing Programs topics introduce you to the Keil development tools, and show you, step-by-step,
the process of using them with the MCB2140 board. You will learn how to use Vision to create, compile,
download, debug, and run a program on the MCB2140 board.
Writing programs for the MCB2140 board is easy.
1. Create the Application Program using the Vision IDE and the RealView C/C++ Compiler.
2. Download the program to the on-chip Flash of the MCB2140 Board.
3. Debug the program using the Vision Debugger and ULINK.

Note
Use the Keil MDK-ARM Lite Edition if no other version is installed on the computer.

LPC Development Studio


Home Writing Programs LPC Development Studio

To use the MCB2140 Board download the Lite Edition of the Keil Microcontroller Development Kit (MDK-ARM).
The MDK-ARM Lite Edition includes:

The Keil ARM tools (Lite Edition).


The GNU ARM tools (unrestricted).
The powerful and easy-to-use Vision IDE with integrated text editor, project management and program make
capability.
The Vision Debugger including complete CPU and peripheral simulation, and supporting drivers for the Keil
ULINK USB-JTAG Adapter.
Program and project examples for the MCB2140 using the Keil ARM tools or the GNU ARM tools.
Extensive tutorials and documentation.

Restrictions of the PKARM Lite Edition


The restrictions for the Lite Edition of the Keil PKARM Developers Kit are:

The Vision Debugger is limited to 32K Bytes user code.


You may not use the Lite Edition of the Vision IDE/Debugger to create commercial products.
The GNU ARM tools (compiler, assembler, and so on) that are provided are not limited or restricted in any way.

Other Software Components


In addition, the Lite Edition includes the GNU ARM Tools binary for Windows platform.

Creating Application Programs


Home Writing Programs Creating Application Programs

The required steps for creating application programs are outlined here.
Vision includes a Project Manager that makes it easy for you to design applications quickly. The topics below
show you how to create a project, set the target options, configure the output files, compiler and linker options,
and build an application program that is ready to download to the MCB2140 board.
1. Creating a Project
2. Setting Target Options
3. Configuring Output Files
4. Configuring Compiler Options
5. Configuring Linker Options
6. Building a Program

Detailed information can be found in the Vision User's Guide in the


Creating Applications chapter.

Creating a Project
Home Writing Programs Creating Application Programs Creating a Project

Follow the steps below to create a new project file and to specify and organize your source (and debug) files that
are a part of this project.
1. Create a New Project File with the Vision menu command Project New Project.
Select a microcontroller from the Device Database. Use the MCB2140 Board to develop code for many of the
LPC214x's family of devices.
2. Add Startup Code.
The Startup file provides pre-configured startup code for the MCB2140 board. The Startup file you use varies
depending on the toolset you select.

Keil tools: root\ARM\BOARDS\KEIL\MCB2140\BLINKY.


GNU toolset: root\ARM\GNU\BOARDS\KEIL\MCB2140\BLINKY.
ARM/ADS tools: root\ARM\ADS\BOARDS\KEIL\MCB2140\BLINKY.
Copy the appropriate Startup file to your project folder and add it to your project.

3. Add a Linker Control Script to control the link process for the GNU tools. The scripts are located in the same
folder, root\ARM\GNU\BOARDS\KEIL\MCB2140\BLINKY. Two pre-configured linker control script files
are available:

Flash.ld configures the linker for program code in Flash ROM (typical configuration).
RAM.ld configures the linker for program code in RAM (used for more extensive debugging).
Copy the linker control script file of your choice to your project folder. This file is required to set up the
Linker controls.

4. Add your own Source Code to the project using the Vision editor (or any editor of your choice)
by either:Right-clicking a group in the Project Window, and selecting Add Files to Group

from the context menu,Or Use the Components, Environment and Books toolbar button
(or select Project Components, Environment and Books Project Components) to
display the dialog below.Within this dialog you may create and organize files into groups or create
new project targets with different tool configurations.

Setting Target Options


Home Writing Programs Creating Application Programs Setting Target Options

Use the Options for Target toolbar button to display the Target dialog.
Type in the XTAL (MHz) of 12.0 for the MCB2140 board's oscillator frequency.

Configuring Output Files


Home Writing Programs Creating Application Programs Configuring Output Files

Configure the Output Files in the Project Options for Target Output dialog. The steps for configuring
these files are:
1. Select Folder for Objects... allows you to specify sub-folders for the output files.
By default, objects are stored in the same folder as the project file.
2. Enable Debug Information to store symbolic debug information within the executable file for source
level program testing with the Vision debugger.

3. Enable Create HEX File to generate an Intel HEX file for Flash programming with the NXP LPC2000 Flash Utility

Configuring Compiler Options


Home Writing Programs Creating Application Programs Configuring Compiler Options

Configure the C Compiler Options in the Project Options for Target C dialog. The steps for configuring
these options are:

1. Enable Compile Thumb Code directs the compiler to generate ARM Thumb instruction set code for this project.
2. Enable Support Calls between ARM and Thumb Instruction Set allows you to intermix Thumb and native
ARM code within the same project.
3. Enable APCS (ARM Procedure Call Standard) creates an application with standard parameter passing
conventions.

For more options information, refer to the Vision User's Guide Options Settings chapter.

Configuring Linker Options


Home Writing Programs Creating Application Programs Configuring Linker Options

Configure the Linker Options in the Project Options for Target Linker dialog. The steps for configuring
these options are:
1. Text Start: 0x00000000 is the starting location in on-chip Flash ROM for code and constants in your program.
2. Data Start: 0x40000000 is the starting location in on-chip RAM for variables in your program.

3. Linker Script File: .\flash.ld specifies the linker script file you selected in Create A Project. Clicking the
Edit button allows you to configure the linker options contained in that file.

For detailed information about linker options, refer to the Vision IDE User's Guide, Vision Dialog Pages, Project,
Options, Linker.

Building a Program
Home Writing Programs Creating Application Programs Building a Program

When the building a program function starts, you may watch the progress in Vision's Command window.
The created executable files are placed in an output folder, ready for downloading. The steps and progress are:
1. Start the build

Click on the Build toolbar button to generate your application program. Vision translates all your
source files and links the project.
2. Monitor progress

The build activity progress (assembling, compiling and linking) displays in Vision's Command window.
Any errors or warnings detected during the build process also display in this window.

3. Program Files

The build creates an Executable File in ELF Format in the Output folder you designated earlier.
The ULINK USB-JTAG adapter requires this file for downloading to the MCB2140 board using the JTAG
or other emulators.
The build creates an Intel HEX executable file. The LPC2000 FLASH ISP Utility requires this file for
downloading through the serial port.
The program is now built and ready for test.

Programming Flash
Home Writing Programs Programming Flash

You may use either of the following tools to download programs to the Flash memory of the MCB2140
evaluation board:

The ULINK USB-JTAG Adapter connects the USB port of your PC to the JTAG port of the MCB2140.
It supports programming Flash, emulation, and debug capabilities.
The Flash Magic Utility connects the COM port of your PC to the serial port of the MCB2140. It may be used
only for programming Flash via the ISP Flash Interface.

ULINK USB-JTAG Adapter


Home Writing Programs Programming Flash ULINK USB-JTAG Adapter

The ULINK USB-JTAG Adapter allows you to debug and test programs and to program Flash memory on the
MCB2140 Evaluation Board. To setup ULINK for Programming Flash within the Vision IDE, you must:
1. Connect the ULINK to the JTAG connector of the MCB2140 Board.
Note that the red cable marks pin 1 of the JTAG-connector.
Make sure that the jumper J9 (JTAG) is ON.

Note
The Embedded ICE in the LPC2000 core is disabled when the device is in Power Down or Idle mode.
ULINK stops working if your code puts the ARM device into Idle or Power Down mode. Therefore,
do not enable either of the power saving modes of the LPC2148 during the software development
cycle in your application program.

2. Power up the MCB2140 Board.


3. Configure Flash Programming in the Project Options for Target Utilities dialog.

Click the toolbar button and select the Utilities tab.


Set the Use Target Driver for Flash Programming option, then select the ULINK ARM Debugger
as the Flash programming tool.

Check the Update Target before Debugging option to ensure that the Flash ROM gets programmed
whenever the debugger starts.

Click the Settings button to open the Flash Download Setup dialog.
4. Configure the Flash Download Setup dialog.

In the RAM for Algorithm section, set the Start: parameter to 0x40000000 and the Size: parameter
to0x0800

5. Click the Add button and select the LPC2000 256kB Flash algorithm.

Finally, click the OK button to save the Flash Download settings.


6. Download your application to Flash.

Use the Download to Flash toolbar button to download the application program into the LPC2100
device.
The ULINK-JTAG adapter can also be used for downloading and debugging application code in Flash
ROM or in RAM of the LPC2100 microcontroller.

Downloading with Flash Magic


Home Writing Programs Programming Flash Downloading with Flash Magic

The Flash Magic utility connects the PC's COM port to the serial port of the MCB2140 and provides
In-System Flash Programming (ISP) support for Intel HEX files. The installation program for this utility may be
downloaded from the Flash Magic Web Site.
Flash Magic may be run as a stand-alone utility or as an external tool from within Vision IDE.
To configure the MCB2140 Evaluation Board for Flash programming see Configuring the MCB2140.

Stand Alone
Home Writing Programs Programming Flash Downloading with Flash Magic Stand Alone

Downloading with the Flash Magic utility requires the following steps to download code to the LPC2148's
on-chip Flash ROM.
To configure the MCB2140 Evaluation Board for Flash programming, select and start
Programs Flash Magic Flash Magic.
1. Select COM 1 for the COM Port, specify 9600 as the Baud Rate, and select either the LPC2148
as the Device depending on the board you have.
2. Enable Erase blocks used by Hex File.
3. Select the Hex File, for example: root\ARM\BOARDS\KEIL\MCB2130\BLINKY\BLINKY.HEX.
4. In the Options Advanced Options dialog, select theHardware Config tab, then check the Use DTR
and RTS to control RST and P0.14 check box.

5. Click Start to download the Hex File into the Flash ROM of the LPC2148.

In case of errors, check the COM connection and jumper settings

J1 & J10 ON
J8 & J9 OFF

Within Vision
Home Writing Programs Programming Flash Downloading with Flash Magic Within Vision

You can configure the Vision Flash Download Command to program the MCB2140 using the Flash Magic
utility from within Vision. The steps to setup the MCB2140 for programming Flash are:
1. Configure Flash Programming.

Use the toolbar button and click the Utilities tab to display the Utilities dialog, or
Select the Project Options for Target Utilities dialog.

Enable Use External Tool for Flash Programming.


Modify the program path:
Command: FM.EXE
Arguments: DEVICE($D,$X) ERASE(DEVICE,PROTECTISP) HEXFILE("#H",NOCHECKSUMS,
NOFILL,PROTECTISP) COM(1,9600) HARDWARE(BOOTEXEC,100,50)

Note
Make sure the program path in the Command text box corresponds to where you installed the
download utility.

2. Connect and Configure

You must adjust the COM number according to your PC configuration.


The jumpers on the MCB2140 Board must be configured for Flash Magic:
J1 & J10 ON
J8 & J9 OFF
3. Download to Flash

Click the Download to Flash button or use the Vision command Flash Download to
download the application program into the MCB2140 device.
4. Vision uses Flash Magic in batch mode for Flash programming. Monitor the progress in the
Output Window that displays the messages Flash Magic generates.

Debugging Programs
Home Writing Programs Debugging Programs

Vision IDE offers a very powerful and comprehensive set of debugging tools designed to make program
testing easier and reduce the time it takes to produce a working application.
Using the Vision debugger and the embedded ICE capability of the MCB2140, you may set breakpoints
and step through your code, and also view the status of on-chip peripherals using the Peripheral dialogs
custom-designed for the LPC2148 device.
The required steps for configuring the debugger on the MCB2140
board are described in the topic Debugging with ULINK.

Debugging with ULINK


Home Writing Programs Debugging Programs Debugging with ULINK

Detailed information can be found in the Vision User's Guide in the Debugging topic and in the Getting
Started User's Guide (..\Keil\ARM\HLP\GSA.CHM) in the chapter Testing Programs.
Follow these steps to program debugging using the Vision Debugger and the ULINK USB_JTAG Adapter.
1. Connect the ULINK to the JTAG connector of the MCB2140 Board. Note that the red cable marks pin 1
of the JTAG-connector.
Make sure that the jumper J9 (JTAG) is ON.

Note
The Embedded ICE in the LPC2000 core is disabled when the device is in Power Down or Idle mode.
ULINK stops working if your code puts the ARM device into Idle or Power Down mode. Therefore,
do not enable either of the power saving modes of the LPC214x during the software development
cycle in your application program.

2. Power up the MCB2140 Board.


3. Configure the Debugger in the Project - Options for Target - Debug dialog.

Use the Options for Target toolbar button and click the Debug tab to display the Debug dialog.
Select the Use: radio button and then ULINK ARM Debugger in the drop-down list to choose the
ULINK USB-JTAG Adapter as the debugging tool.

Check the Load Application at Startup and the Run to main() options to load your application
and execute code up to the beginning of your main() function when the debugger starts.

Click the Settings button to open the ARM Target Driver Setup dialog.
This dialog displays the IDCODE of the ARM device on the MCB2140 Board.

Select the Verify Code Download option under Download Optionsto compare the loaded
application program with the Flash ROM content. You may disable this option to speed up
the debugger start.
4. Start the Debugger

Use the Start/Stop Debug Session toolbar button to start debugging the program.
Or
Use the Vision command, Debug - Start/Stop Debug
Session, to start debugging the program.

You might also like