8051 Development Board-tutorials

8051 Development Board-tutorials (2)

Friday, 28 December 2012 09:49

User Manual for 8051 Development Kit

Written by

PRIMER-8051 Kit, is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 8-bit MCU from NXP/Dallas/Atmel. The board supports 8051 family devices with various memory and peripheral options. It integrates on board two UARTs, LEDs, Relays, Motor Interface, keypads, an ADC input and GLCD/LCD Display to create a stand-alone versatile test platform.



  • NXP's 8051 - P89V51RD2 MCU


  • 64K Flash – Program Memory
  • 1K SRAM – Data Memory


  • 11.0592MHz crystal for MCU | 32.768KHz RTC

On-Board Peripherals

  • 40pin-ZIF Socket | 44-pin PLCC Socket
  • 8 Nos. Point LEDs (Logic Output)
  • 8 Nos. Digital Input (Slide Switch)
  • 4x4 Matrix Keypad
  • 2X16 Character LCD (Background Light)
  • 4 Nos. 7-Segment Display
  • 2 Nos. Analog Input (Potentiometer | LM35)
  • Stepper Motor Driver Interface
  • 2 Nos. of SPDT Relay
  • Serial EEPROM (I2C)
  • DS1307 RTC with Battery-Backup
  • 2 Nos. UART(RS232)
  • USB 2.0 Connector ( Power Supply)
  • Buzzer (Alarm), Interrupts Study, Reset Button
  • SPI - Digital / Analog converter
  • 2-Channel SPIAnalog-Digital converter
  • 128x64 Graphical LCD
  • Digital Temperature Sensor (DS18S20)
  • 40-Pin Expansion Connector
  • Traffic Light Controller Modules


  • 9-12V, AC/DC- Adaptors,
    Power form USB (+5V) (+3.3V, 800mA)


  • D-SUB Connector (Serial Port, ISP)
  • 40 – PIN Expansion Connector
  • Ext Analog Input Connector

General Block Diagram


Supported Microcontrollers


  • NXP : P89V51Rxx
  • Dallas : DS89C420/430/450
  • *Atmel : AT89S51/52/8252 and AT89Sxx


  • NXP : P89V51Rxx
  • Dallas : DS89C420/430/450
  • *Atmel : AT89S51/52/8252 and AT89Sxx MCUs

P89V51 Controller Features

  • 80C51 Central Processing Unit
  • 5V Operating voltage from 0 to 40 MHz
  • 64 KB of on-chip Flash program memory with ISP (In-System Programming) and IAP (In-Application Programming)
  • Supports 12-clock (default) or 6-clock mode selection via software or ISP
  • SPI (Serial Peripheral Interface) and enhanced UART
  • PCA (Programmable Counter Array) with PWM and Capture/Compare functions
  • Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each)
  • Three 16-bit timers/counters
  • Programmable Watchdog timer (WDT)
  • Eight interrupt sources with four priority levels
  • Second DPTR register
  • Low EMI mode (ALE inhibit)
  • TTL- and CMOS-compatible logic levels
  • Brown-out detection
  • Low power modes
       -  Power-down mode with external interrupt wake-up
       -  Idle mode

Jumper & Connector Details

Stepper / Relay



Internal Supply (+5V)        

External Supply(+5V)




Enable LEDs,  Port (P1.16 – P1.23)

Disable LEDs.

Buzzer (P0.6)



Enable Buzzer                     

Disable Buzzer

Analog I/P (POT)



On-Board Analog Input(Potentiometer)

External Analog Input-1 select

Analog I/P (LM35)



On-Board Analog Input(LM35 Temp sensor)

External Analog Input-2 select


Connector Details

40-Pin Expansion Connector


Power Supply

The external power can be AC or DC, with a voltage between (7V/12V,1A output) at 230V AC input. The 8051 board produces +5V using an LM7805 voltage regulator, which provides supply to the peripherals. USB socket meant for power supply only, user can select or control power either USB or Ext power supply through slide switch SW2.




Power +5V (EXT through Adaptor)

Power +5V (USB)


On-board Peripherals

The Development kit comes with many interfacing options

  • 8-Nos. of Point LED’s (Digital Outputs)
  • 8-Nos. of Digital Inputs (slide switch)
  • 2 Lines X 16 Character LCD Display
  • 4 Digit Seven-segment display
  • 128x64 Graphical LCD Display
  • 4 X 4 Matrix keypad
  • Stepper Motor Interface
  • 2 Nos. Relay Interface | Buzzer
  • Serial EEPROM
  • Real Time Clock (DS1307) with battery backup
  • Digital Temperature Sensor(DS18S20)
  • Traffic Light Module (Optional)
  • Two UART for serial communication

Light Emitting Diodes

  • Light Emitting Diodes (LEDs) are the most commonly used components, usually for displaying pin’s digital states. <.li>
  • The 8051 Kit has 8 nos., of Point LEDs, connected with port pins (P0.0 to P0.7), to make port pins high LED will glow.


Point LEDs

8051 Lines

LED Selection




















Digital Inputs

  • This is another simple interface, of 8-Nos. of slide switch, mainly used to give an input to the port lines, and for some control applications also.
  • The 8051 Kit, slide switches (SW8 to SW27) is connected with port pins (P2.0 to P2.7), user can give logical inputs ‘LOW’.


Slide Switch

8051 Lines

Input Logic Selection





















The 8051 Kit, have 2x16 character LCD. 7 pins are needed to create 4-bit interface; 4 data bits (P0.4 – P0.7, D4-D7), address bit (RS-P0.0), read/write bit (R/W-P0.1) and control signal (E-P0.2). The LCD controller is a standard KS0070B or equivalent, which is a very well-known interface for smaller character based LCDs.

Figure below illustrate the LCD part of the design and which pins are used for the interface. The LCD is powered from the 5V power supply enabled by switch SW30.



8051 LINES

2x16 LCD Selection





















Make switch SW30 to ‘LCD’ label marking position


Seven Segment Display

In 8051 Kit, 4 nos. of common anode seven segment displays, The digit select lines are connected to port pin (P3.4- P3.7) and the segment lines of seven segments LED is being terminated at port pins (P1.0-to P1.7). All the common anode displays consume very small amount of current.

The 7-segmend display is powered from the 5V power supply enabled by switch SW30.



8051 Pins

7-Segment Display

Digit select lines

Digit - 1



Digit – 2


Digit – 3


Digit - 4


Segment Lines

Seg - a


Seg – b


Seg – c


Seg – d


Seg – e


Seg – f


Seg – g


Seg – dp



Make switch SW30 to ‘7SEG’ label marking position


128x64 GLCD Graphical LCD

The 8051 Kit is the GLCD. 14 pins are needed to create 8-bit interface; 8 data bits (P1.0 – P1.7, DB0-DB7), two chip select line P3.2(CS1) and P3.3(CS2), address bit (R/S-P3.4), read/write bit (R/W-P3.5) and control signal (E-P3.6) and Reset (RST-P3.7). The GLCD controller is a standard S6B0108 or equivalent, which is a very well-known interface for Graphical based LCDs.

Figure below illustrate the GLCD part of the design and which pins are used for the interface. The GLCD is powered from the 5V power supply enabled by switch SW30.



8051 LINES

128x64 GLCD Selection
































Make switch on

SW30   - GLCD  | 7-SEG position


SW32 to GLCD label marking position


4x4 Matrix keypad

Keypads row and column lines are arranged by matrix format. Row lines (P2.0 – P2.3) and Column lines (P2.4 to P2.7) connected directly by the port pins.


4x4 Matrix Lines

8051 Lines

4x4 Matrix Keypad





















Note: While using Keypad ensure slide switches (SW8-SW27) to off position.

Stepper Motor

The ULN2003A is a high-voltage, high-current Darlington transistor array. The device consists of eight NPN Darlington pairs that feature high-voltage outputs with common-cathode clamp diodes for switching inductive loads.

ULN2003 is used as a driver for port I/O lines, drivers output connected to stepper motor, connector provided for external power supply if needed.


Stepper Motor(5V)

8051 Lines

Stepper Motor PWR Select











Make  switch SW30 to SM/RL label

marking position.


For Motor/relay section obtain power from on-board (internal) or external supply through jumper JP3.

Relay and Buzzer Interface

ULN2003 is used as a driver for port I/O lines, drivers output connected to relay modules. Connector provided for external power supply if needed. Make port pins to high, relay will activated

A small piezoelectric buzzer on the 8051 Kit, P0.6 make the pin high, current will flow through the buzzer and a relatively sharp, single-tone frequency will be heard.



8051 Lines

RELAY Power Select









Note : Relay | Buzzer selection make switch SW30 to SM/RL label marking position


For Motor/relay/buzzer section obtain power from on-board (internal) or external supply through jumper JP3.


The AT24C01A/02/04/08/16 provides 1024/2048/4096/8192/16384 bits of serial electrically erasable and programmable read-only memory (EEPROM) organized as 128/256/512/1024/2048 words of 8 bits each. The device is optimized for use in many industrial and commercial applications where low-power and low-voltage operation are essential.

Features of AT24Cxx

  • Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K)
  • 2-wire Serial Interface
  • Bi-directional Data Transfer Protocol
  • 100 kHz (1.8V, 2.5V, 2.7V) and 400 kHz (5V) Compatibility
  • Write Protect Pin for Hardware Data Protection
  • 8-byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes
       - Data Retention: 100 Years.



8051 Lines


AT 24xx






Make switch SW28 to I2C label marking position.



Real Time Clock (DS1307)

The Real Time Clock (RTC) is a set of counters for measuring time when system power is on, and optionally when it is off. It uses little power in Power-down mode. On the 8051, the RTC can be clocked by a separate 32.768KHz oscillator, or by a programmable prescale divider based on the VPB clock. Also, the RTC is powered by its own power supply pin, VBAT, which can be connected to a battery or to the same 3.3 V supply used by the rest of the device.


  • Measures the passage of time to maintain a calendar and clock.
  • Ultra Low Power design to support battery powered systems.
  • Provides Seconds, Minutes, Hours, Day of Month, Month, Year, Day of Week, Day of Year.
  • Dedicated 32kHz oscillator or programmable pre-scalar from VPB clock.
  • Dedicated power supply pin can be connected to a battery or to the main 5V/3V3.



8051 Lines

Real Time Clock







Make switch SW28 to I2C label marking position.



Digital Temperature Sensor (DS18S20)

The DS1820 digital thermometer is well suited to environmental temperature measurement, having a temperature range of –55C to 125C and an accuracy of +/-0.5C.


  • Unique 1-Wire interface requires only one port pin for communication
  • Multi-drop capability simplifies distributed temperature sensing applications
  • Can be powered from data line. Power supply range is 3.0V to 5.5V
  • Measures temperatures from -55°C to +125°C (-67°F to +257°F)
  • ±0.5°C accuracy from -101°C to +85°C
  • 9-bit thermometer resolution, Converts temperature in 750ms (max.)


Temp Sensor

8051 Lines

Digital Temp Sensor





Make switch SW28 to 1-WIRE label marking position.



Analog-Digital Converter (SPI)

The Microchip Technology Inc. MCP3202 is a successive approximation 12-bit Analog-to-Digital (A/D) Converter with on-board sample and hold circuitry. The MCP3202 is programmable to provide a single pseudo-differential input pair or dual single-ended inputs. Differential Nonlinearity (DNL) is specified at ±1 LSB, and Integral Nonlinearity (INL) is offered in ±1 LSB (MCP3202-B) and ±2 LSB (MCP3202-C) versions. Communication with the device is done using a simple serial interface compatible with the SPI protocol. The device is capable of conversion rates of up to 100ksps at 5V and 50ksps at 2.7V.



8051 Lines


MCP 3202










Make switch SW28 to ADC label marking position.



Analog Inputs Select

ADC Select

ADC Inputs


ADC Select







POT (R19)




Digital-to-Analog Converter (DAC)

DAC Features

The Microchip Technology Inc. MCP492X are 2.7 – 5.5V, low-power, low DNL, 12-Bit Digital-to-Analog Converters (DACs) with optional 2x buffered output and SPI interface.

The MCP492X are DACs that provide high accuracy and low noise performance for industrial applications where calibration or compensation of signals (such as temperature, pressure and humidity) are required.


  • 12-Bit Resolution
  • ±0.2 LSB DNL (typ), ±2 LSB INL (typ)
  • Single or Dual Channel
  • SPI™ Interface with 20 MHz Clock Support
  • Simultaneous Latching of the Dual DACs w/LDAC
  • Fast Settling Time of 4.5 µs
  • Selectable Unity or 2x Gain Output
  • 450 kHz Multiplier Mode
  • External VREF Input
  • Extended Temperature Range: -40°C to +125°C



8051 Lines


MCP 2491








Note :      Measure DAC output at J2 PTB connector.


Traffic Light Controller

Traffic light controller section consists of 12 Nos. point leds are arranged by 4Lanes. Each lane has Go(Green), Listen(Yellow) and Stop(Red) LED is being placed. Each LED has provided for current limiting resistor to limit the current flows to the LEDs.

LAN Direction

8051 Lines


Traffic Light Controller































Note      : Make SW32 to “Traffic” label marking position


RS-232 | Interrupt Communication

  • RS-232 communication enables point-to-point data transfer. It is commonly used in data acquisition applications, for the transfer of data between the microcontroller and a PC.
  • The voltage levels of a microcontroller and PC are not directly compatible with those of RS-232, a level transition buffer such as MAX232 be used.


UART DB-9 Connector


Processor Lines

Serial Port Section














Note      : RXD1 and TXD1 lines are only available in Maxim-Dallas Microcontrollers DS89C4xx series.



In 8051, two external interrupts lines are terminated at (EXINT0-P3.2) and (EXINT2-P3.3).



8051 Lines


Tactile Switch






SW29 – (INT0)



SW31 – (INT1)



Board Layout


Easy Programming Steps - NXP Microcontrollers

Software Settings

1. Open “Flashmagic” ISP software

Step 0 : Go to “Options” Menu, then choose “Advanced Options”, Advanced options windows appears.Choose “Hardware Config” tab, Deselect “Use DTR to Control RST” checkbox.


Step1 : Select Com Port E.g COM1 or COM2

  • Set baud rate “9600”
  • Select Device “89V51RD2”
    Interface “None(ISP)”

Step2 : Check “Erase all Flash”


Step3 : Load or locate your Hex files

Step4 : Select options you want like above figure, verify, erase, security bit.

Step 5: Press “Start” button


Press Hardware “RST” Button SW3. Now it starts, Erasing, Program & Verifying.


Dallas Microcontrollers

Hardware Settings


Select Dallas MCU “DS89C450”


1. “Options” – Menu

Select com port and set baud rate to 9600


2. “Target” – Menu

  • Open Com1at 9600
  • Connect to Loader

We get window like this

3. “File” – Load Flash

…\Examples Code\LED Blink\Out\LEDBlink.hex


Execution Mode


Saturday, 01 September 2012 10:07

Getting started with Flash Magic

Written by
Introduction of Flash Magic

NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash memory and the ability to be reprogrammed using In-System Programming technology.

Flash Magic is Windows software from the Embedded Systems Academy that allows easy access to all the ISP features provided by the devices. These features include:

  • Erasing the Flash memory (individual blocks or the whole device)
  • Programming the Flash memory
  • Modifying the Boot Vector and Status Byte
  • Reading Flash memory
  • Performing a blank check on a section of Flash memory
  • Reading the signature bytes
  • Reading and writing the security bits
  • Direct load of a new baud rate (high speed communications)
  • Sending commands to place device in Boot loader mode

Flash Magic provides a clear and simple user interface to these features. Under Windows, only one application may have access the COM Port at any one time, preventing other applications from using the COM Port.

Flash Magic only obtains access to the selected COM Port when ISP operations are being performed. This means that other applications that need to use the COM Port, such as debugging tools, may be used while Flash Magic is loaded.

Screenshot of Flash Magic Window


The window is divided up into five sections. Work your way from section 1 to section 5 to program a device using the most common functions.

At the very bottom left of the window is an area where progress messages will be displayed and at the very bottom right is where the progress bar is displayed. In between the messages and the progress bar is a count of the number of times the currently selected hex file has been programmed since it was last modified or selected.

Just above the progress information Embedded Hints are displayed. These are rotating Internet links that you can click on to go to a web page using your default browser.


There are five menus, File, ISP, Options, Tools and Help.


The File menu provides access to loading and saving Hex Files, loading and saving settings files and exiting the application.


The Options menu allows access to the advanced options and includes an item to reset all options.


The ISP menu provides access to the less commonly used ISP features.


The Tools menu provides features that support the operation and use of Flash Magic.


The Help menu contains items that link directly to useful web pages and also open the Help About window showing the version number.



Throughout the Flash Magic user interface extensive use has been made of tooltips. These are small text boxes that appear when you place the pointer over something and keep it still for a second or two.

Note that tooltips do not appear for items that are disabled (grayed out).

Saving Options

The options in the main window and the Advanced Options window are automatically saved to the registry whenever Flash Magic is closed. This removes the need for an explicit save operation. When Flash Magic is restarted the main window and the Advanced Options window will appear as you left it, so you do not have to repeatedly make the same selections every time you start the application. If you wish to reset the options to the original defaults then choose Reset from the Options menu.

Five Step Programming

For each step there is a corresponding section in the main window as described in the User Interface Tour.

Step 1 – Connection Settings

Before the device can be used the settings required to make a connection must be specified.


COM Port Settings

Select the desired COM port from the drop down list or type the desired COM port directly into the box. If you enter the COM port yourself then you must enter it in one of the following formats

  • COM n
  • n

Any other format will generate an error. So if you want to use COM 1 (which is not present on the drop down list) you can directly type in either “COM 1” or “1”.

Baud Rate Settings

Select the baud rate to connect at. Try a low speed first. The maximum speed that can be used depends on the crystal frequency on your hardware. You can try connecting at higher and higher speeds until connections fail. Then you have found the highest baud rate to connect at.

Alternatively, some devices support high speed communications.

Device Selection

Select the device being used from the drop down list. Ensure you select the correct one as different devices have different feature sets and different methods of setting up the serial communications.

Interface Selection

Select the interface being used, if any. An interface is a device that connects between your PC and the target hardware. If you simply have a serial cable or USB to serial cable connecting your COM port to the target hardware, then you can choose "None (ISP)". Choosing the correct interface will automatically configure Flash Magic for that interface, along with enabling and disabling the relevant features.

Oscillator Frequency

Enter the oscillator frequency used on the hardware. Do not round the frequency, instead enter it as precisely as possible. Some devices do not require the oscillator frequency to be entered, so this field will not be displayed.

Once the options are set ensure the device is running the on-chip Boot loader if you are using a manual ISP entry method.

Note that the connection settings affect all ISP features provided by Flash Magic.

Step 2 – Erasing

This step is optional, however if you attempt to program the device without first erasing at least one Flash block, then Flash Magic will warn you and ask you if you are sure you want to program the device.


  • Select each Flash block that you wish to erase by clicking on its name.
  • If you wish to erase all the Flash then check that option.
  • If you want to check to erase a Flash block and all the Flash then the Flash block will not be individually erased.
  • If you wish to erase only the Flash blocks used by the hex file you are going to select, then check that option.

For most devices erasing all the Flash also results in the Boot Vector and Status Byte being set to default values, which ensure that the Boot loader will be executed on reset, regardless of the state of the PSEN pin or other hardware requirements.

Only when programming a Hex File has been completed will the Status Byte be set to 00H to allow the code to execute.

This is a safeguard against accidentally attempting to execute when the Flash is erased.

On some devices erasing all the Flash will also erase the security bits. This will be indicated by the text next to the Erase all Flash option.

On some devices erasing all the Flash will also erase the speed setting of the device (the number of clocks per cycle) setting it back to the default.

This will be indicated by the text next to the Erase all Flash option.

Step 3 – Selecting the Hex File

This step is optional. If you do not wish to program a Hex File then do not select one.


You can either enter a path name in the text box or click on the Browse button to select a Hex File by browsing to it.

Also you can choose Open… from the File menu.

Note that the Hex file is not loaded or cached in any way. This means that if the Hex File is modified, you do not have to reselect it in Flash Magic. Every time the Hex File is programmed it is first re-read from the location specified in the main window.

The date the Hex file was last modified is shown in this section. This information is updated whenever the hex file is modified. The hex file does not need to be reselected.

Clicking on more info or choosing Information… from the File menu will display additional information about the Hex file.

The information includes the range of Flash memory used by the Hex file, the number of bytes of Flash memory used and the percentage of the currently selected device that will be filled by programming the Hex file.

If the device supports programming and execution from RAM, for example the ARM devices, then the hex file may contain records for the RAM.

First the flash will be programmed followed by the RAM. Programs loaded into RAM via a hex file may be executed using such features as the Go option.

Step 4 – Options

Flash Magic provides various options that may be used after the Hex File has been programmed.

This section is optional; however verify After Programming, Fill Unused Flash and Gen Block Checksums may only be used if a Hex File is selected (and therefore being programmed), as they all need to know either the Hex File contents or memory locations used by the Hex File.


Verify After Programming

Checking the Verify after Programming option will result in the data contained in the Hex File being read back from Flash and compared with the Hex File after programming. This helps to ensure that the Hex File was correctly programmed. If the device does not support verifying then this item will be disabled.

Fill Unused Flash

Checking the Fill Unused Flash option will result in every memory location not used by the Hex File being programmed with the value that sets all the bits to a programmed state.

Once a location has been programmed with this feature it cannot be reprogrammed with any other value, preventing someone from programming the device with a small program to read out the contents of Flash or altering the application’s operation.

General Block Checksums

Checking the Gen Block Checksums option will instruct Flash Magic to program the highest location in every Flash block used by the Hex File with a special “checksum adjuster value”.

This value ensures that when a checksum is calculated for the whole Flash Block it will equal 55H, providing the contents of the Flash block have not be altered or corrupted. Please refer to the Block Checksums section for more information.

Execute option

Checking the Execute option will cause the downloaded firmware to be executed automatically after the programming is complete. Note that this will not work if using the Hardware Reset option or a device that does not support this feature.

Step 5 – Performing the Operations

Step 5 contains a Start button.


Clicking the Start button will result in all the selected operations in the main window taking place. They are:

  • Erasing Flash
  • Programming the Hex File
  • Verifying the Hex File
  • Filling Unused Flash
  • Generating Checksums
  • Programming the clocks bit
  • Programming the Security Bits
  • Executing the firmware

Once started the progress information and a progress bar will be displayed at the bottom of the main window.

In addition the Start button will change to a cancel button. Click on the cancel button to cancel the operation.

Note that if you cancel during erasing all the Flash, it may take a few seconds before the operation is cancelled.

Once the operations have finished the progress information will briefly show the message “Finished”.

The Programmed Count shown next to the progress bar will increment. This shows the total number of times the hex file has been programmed.

Modifying the hex file or selecting another hex file will reset the count.

Alternatively, right-clicking over the count provides a menu with the option to immediately reset the count.

Additional ISP Features

Saving a Hex File

Once connected choosing Save As… from the File menu opens the Hex File save window. It is possible to save a section of Flash memory to a Hex File.

Enter the start address and the end address (inclusive) that you wish to save. Note that the start and end addresses do not have to correspond to a Flash block.

If desired you can save a single memory location by entering it as both the start and end address.

Next select the location and name of the Hex file to save by either entering a path in the text box or clicking on the Browse button and browsing to a folder.

Finally, click on the Save button to start save. Progress information on the save will be shown at the bottom of the window.

Blank Check

Choose Blank Check… from the ISP menu to perform a blank check on all the Flash blocks present on the device.


Once complete the Blank Check window will look something like the following:

  • The status column indicates if a block is blank or not.

Checking the option to Mark non-blank blocks to be erased will have the effect of checking the relevant items in the Erase section of the main window.

For example if Block 0 is not blank, then checking the Mark option will result in Block 0 in the Erase section of the main window being checked.

Reading the Security Settings

When Flash Magic is first started it will attempt to read the security bits of any device that is connected to the specified COM Port.


If no device is connected then you may connect a device and choose Read Security from the ISP menu. The security settings will be read and the following window opened:

  • If a security bit is set then it will be highlighted.

Reading the Device Signature

The device signature is comprised of two or three bytes that identify the device or a single 32-bit value. To read the device signature choose Read Device Signature from the ISP menu.


The signature will be read and the following window will open showing the three bytes:

  • A manufacturer ID of 15H corresponds to NXP Semiconductors.
  • Some devices will also display the boot loader version in this window.

Modifying the Boot Vector and Status Byte

The Status Byte indicates how the device will operate after a reset. A value of 00H will result in the device checking the PSEN pin to determine whether it should run the Boot loader or the user application. Any other value will result in the device running the Boot loader.

The Boot Vector contains the page that the Boot loader (or user boot loader) starts at. The default varies depending on the device but as an example FCH corresponds to the address FC00H for 8051 non-LPC devices, and F8H, corresponds to the address F800H for the XA devices.

Once programming is completed it is possible to change both the Boot Vector and Status Byte by selecting Boot Vector and Status Byte from the ISP menu. You will be presented with the following window:


The current Boot Vector and Status Byte settings will be shown. Modify the settings as desired and click on the Reprogram button.

Setting the Boot Vector to a value other than the default may result in the inability to run the Boot loader on the device. This will mean that the ISP features of the device cannot be accessed until the device has been erased in a Parallel Programmer.

Because of this danger, you will be presented with a confirmation window if you try to reprogram the Boot Vector to a non-default value:


Following the below instructions in the window carefully to reprogram the Boot Vector.

Once the Boot Vector and Status Byte have been reprogrammed a confirmation message will be displayed.

Some devices do not support a Boot Vector. However, the Status Byte may still be changed by selecting Status Byte from the ISP menu.

The following dialog window will be displayed:


Displaying Memory

A useful feature is the ability to view the contents of memory. Choosing Display Memory from the ISP menu accesses this feature.

Memory is shown one block at a time. The block being displayed may be selected from the drop-down list at the bottom of the Display Memory window:


Each line shows 16 bytes of data starting at the address given at the start of the line. If a line contains question marks then data has not yet been read in for those locations. The memory is read in the background allowing viewing of the memory that has been loaded in without having to wait for all of it to be read.

At any time a new range may be selected or the window closed.

Each line shows the 16 bytes of data first in hexadecimal format then in ASCII format. For characters that are not printable a period is displayed instead.

Erasing Flash

There are two ways Flash can be erased. Either as part of the five step process described earlier in this manual, or without performing any other ISP operations by choosing Erase Flash from the ISP menu.

The Erase Flash window will be opened. Its operation is identical to the erase section in the main window. Once settings have been chosen click on the Erase button to erase.


Progress information is displayed at the bottom of the window.

Verifying a Hex File

A Hex File can be verified without programming it into the device first. To access the verify feature choose Verify… from the ISP menu.

You will be presented with the following dialog window:


Select a Hex File to verify either by entering the path to the file of clicking on the Browse button and choosing it.

If checksums were used when the device was programmed then check the option to ignore checksum locations, as they will be different in memory to any reserved checksum locations stored in the Hex file.

Click on the Verify button to start verification. Progress information is shown at the bottom of the window.

Reset and Execute

Selecting the Reset item on the ISP menu will cause a reset command to be sent to the device.

Depending on the hardware and the status byte, the device is either reset to the execute code or reset to the Boot loader.

If the Reset command is sent after successfully programming the device then the reset will execute the downloaded code.

If the Reset command is sent after erasing the device then the device will reset to the Boot loader.

Selecting the Execute item on the ISP menu will cause Flash Magic to program the Boot Vector to the default and the Status Byte to zero (for devices that have this feature), followed by sending a reset command to the device.

This will force any downloaded code to be executed.

Start Boot loader Description

The Start Boot loader feature allows a textual command or break condition to be sent to the device to place it into Boot loader mode. In order for this to work however it must be supported by the user’s application or the device.

For textual commands the user’s application must watch the UART for the command to be received.

Once received the application must echo back the command and a single full stop, then use In-Application Programming to program the Boot Vector to the default and the Status Bit/Byte to non-zero, and then reset the device.

Once the device completes the reset the Boot loader will be executed, allowing the device to be reprogrammed.

If a break condition is sent, then Flash Magic does not expect the break condition to be echoed back and assumes the device has been placed in Boot loader mode.

Choosing “Start Boot loader…” from the ISP menu accesses the Start Boot loader feature. The following dialog window will be displayed.


Select to either send a textual command or a break condition.

The baud rate used is completely independent from the baud rate in the main window. This allows the user’s application to use the UART at say 9600 baud, but allow Flash Magic to use say 19200 baud either with or without high-speed communications turned on. However the COM Port used is the same as the one selected in the main window.

Select the baud rate, enter the textual command (which may be anything you desire), select the append option you want and click on Start Boot loader to send. If successful the ISP features of Flash Magic can now be used.

The append options allow a carriage return and line feed to be added to the command. This is useful if your application implements a command line via the serial port and expects all commands to end in these control characters. Select the setting that matches your implementation.

Combined with the automatic Reset after programming option, devices may be programmed and tested repeatedly without ever having to touch the hardware.

Erase Pages

Some devices allow the flash to be erased in pages. If this feature is supported by the device then the Erase Flash Pages… item on the ISP menu will be enabled.


Select the pages to erase and click on the Erase button to erase them.

Device Configuration

Some devices allow configuration via ISP. If the selected device supports this feature then the Device Configuration… item on the ISP menu will be enabled. When selected the current configuration will be read from the device and displayed in the configuration dialog window.

The configuration may then be changed and by clicking on Reprogram the new configuration will be programmed into the device.


Some devices support protecting the device configuration, along with the boot vector and status bit/byte. On these devices a Clear configuration Protect button will be shown, which when clicked will send the command to clear the protection for the configuration of the device.

Cyclic Redundancy Check

Some devices instead of a verify option provide a Cyclic Redundancy Check (CRC) option, where the device can calculate a 32-bit CRC value for a single Flash Block or the entire device. CRCs are a form of checksum, therefore if the contents of the memory change, there is a very high probability the CRC will also change.

If the selected device supports CRCs then the Cyclic Redundancy Check… item on the ISP menu will be enabled. Selecting it displays the CRC window.


When the window is first opened the CRC value is read from the device for each Flash Block and the entire device. These values are shown in the “Device CRC” column.

Click on the Add button and select each of the Hex files programmed into the device. Each Hex file will appear in the list at the bottom of the window.

To remove a Hex file from the list select it in the list and click on the Remove button.

Click on the Calculate CRC button to calculate the CRCs for each block and the whole device, as if the chosen Hex files were programmed into the device. These values will appear in the “Hex Files CRC” column. If the contents of the device exactly match the contents of the chosen Hex files then the CRCs on each row of the table will match.


Some devices instead of a verify option provide a MISR option, where the device can calculate a 128-bit MISR value for a single Flash Block or the entire device. MISR values are a form of checksum, therefore if the contents of the memory change, there is a very high probability the MISR value will also change.

If the selected device supports MISR values then the Read MISR… item on the ISP menu will be enabled. Selecting it displays the MISR window, which is functionally identical to the CRC window described in the previous section.

When the window is first opened the MISR value is read from the device for each Flash Block and the entire device. These values are shown in the “Device MISR” column.

Click on the Add button and select each of the Hex files programmed into the device. Each Hex file will appear in the list at the bottom of the window.

To remove a Hex file from the list select it in the list and click on the Remove button.

Click on the Calculate MISR button to calculate the MISR values for each block and the whole device, as if the chosen Hex files were programmed into the device. These values will appear in the “Hex Files MISR” column.

If the contents of the device exactly match the contents of the chosen Hex files then the MISR values on each row of the table will match.


Some devices support executing from specific addresses in flash or RAM and using specific options or modes, for example the ARM devices.

To perform a Go operation and start execution choose Go… from the ISP menu.

Enter the address to start execution from and choose the mode to execute in. Click on Go to start execution.

Serial Number

Some devices provide a serial number feature, which protects access to the device via ISP.

If a serial number is supplied to the device then on the next reset the device will block most ISP operations until it is unlocked by supplying the correct serial number. The serial number may be reset being erased stopping unauthorized access to the code.

Check the device datasheet for the exact details of the implementation.

If the selected device supports serial numbers then the Serial Number… item on the ISP menu will be enabled. Selecting it displays the serial number window.


To set a serial number, enter it into box boxes indicated. The contents of the boxes must match. Then click on Set Serial Number.

For reset a serial number click on the Reset Serial Number button. To unlock a device using a serial number, enter the correct serial number into the box and click on Unlock Device.

Serial numbers may be entered in ASCII or Hexadecimal, by selecting from the drop-down list. Examples of ASCII serial numbers:

  • 2A45bc2
  • foobar
  • MyOldMan

Examples of Hexadecimal serial numbers:

  • 23BD4C2101ED3451
  • 112233AABBCC

Serial numbers may be any length up to the maximum allowed. Hexadecimal serial numbers must not include the 0x prefix or the H/h suffix.

Update Boot loader

Some devices allow the boot loader to be updated via ISP. This can only be performed using a special boot loader update hex file supplied by NXP Semiconductors. Flash Magic supports these hex files.

If the currently selected device supports this feature, then "Update Boot loader…" on the ISP menu will be enabled. Choosing the menu item displays the dialog window.


Simply select the boot loader update hex file by entering the path to the file or clicking on the Browse… button to select it. Click on Update to start the update process.

Status information will be shown at the bottom of the dialog window.

Once complete Flash Magic will indicate that the boot loader was updated or the reason why the update failed.

Only use special boot loader update hex files supplied by NXP Semiconductors that are created for this feature. Do not interrupt the power supply or reset the device during the update. Failure to follow these warnings may result in a device that no longer has a functional boot loader.

Additional Security Bits

Some devices support additional security bits that are not related to specific section of Flash memory. If the selected device has this feature then the Additional Security Bits… option on the ISP menu will be available. Choosing the option will display a dialog window showing the additional security bits for that device.

When the window is opened the current settings for the security bits will be read from the device and displayed in the window. Checking a security bit will set that bit. Un- checking a security bit will attempt to unset it.

Note that setting these security bits may have significant repercussions on the functionality of the device. It is strongly recommended to consult the data sheet or user manual and understand the functionality of these bits before setting them.

Advanced Options

High Speed Communications

Some devices feature the ability to switch from the initial baud rate to a high speed communications mode, allowing speeds higher than the auto baud method in the Boot loader would be able to accurately measure.

Flash Magic will calculate the highest possible baud rate that may be used by both the device and the PC COM Port and automatically switch to it after connecting at the initial baud rate specified in the main window.

If you experience problems with this feature, then try limiting how fast the high speed communications mode can go. Select the maximum speed from the drop-down list. If in doubt, select 9600 and start increasing until the problems appear.

Half-duplex Communications

When communicating with the device Flash Magic can send and receive data at the same time to achieve the fastest data rate. This type of transmission is called full-duplex. Turning the half-duplex option on will cause Flash Magic to only transmit one byte at a time, waiting for the byte to be echoed from the Boot loader before transmitting the next byte? While this will slow the data rate down it allows ISP to be performed via half-duplex serial buses.

Note however that you must design your hardware such that the PC and the Boot loader do not receive the bytes they transmit otherwise each will be confused.

Hardware Configuration

For some devices, Flash Magic can control DTR and RTS to enter ISP mode or execute newly downloaded code. To implement this requires a hardware design that supports controlling of the device using DTR and RTS.

The options for controlling this feature are accessed by clicking on the Hardware Configuration tab.

The advantages of this feature include:

  • Faster development
  • ISP is now possible on hardware that is hard to reach or enclosed in a box
  • Removes the need for switches or jumpers on the hardware


DTR and RTS need to be connected to RST and to allow Flash Magic to control the reset and ISP entry of the device.

The following simplified circuit diagram for an P89XX is one possible way of connecting the DTR and RTS signals to RST of the device.

When the COM Port is not in use or the serial cable is not connected, the RS232 signals are pulled low by the transceiver. This results in the TTL signals being high. Therefore when the TTL DTR and RTS signals are high, RST must be in a state that allows the device to reset normally and execute code.

By checking the option to assert RTS while the COM Port is open, the RTS signal will remain asserted while the ISP operation is performed. This allows hardware to be designed that can reset or reconfigure hardware for an ISP operation.

Protect ISP

Some devices contain the ISP code – which allows Flash Magic to communicate with the device – in the main Flash memory. This means that it is possible to erase or corrupt the ISP code. Once erased or corrupted ISP operations can no longer be performed and the device would have to be physically removed from the hardware

In order to stop the ISP code from being accidentally erased the Protect ISP option is provided. When checked, Flash Magic will modify erase and programming operations such that the ISP code is not erased or corrupted.

For example:

  • A full device erase will be achieved by erasing Flash blocks and pages, to erase the Flash without erasing the section of Flash containing the ISP code.
  • A block erase for a block that contains the ISP code will be achieved by erasing pages in the block – if they exist on the device – to avoid erasing the ISP code.
  • The programming of any Hex file containing data that would corrupt the ISP code will be aborted.
  • The section of Flash containing the ISP code will not be filled.
  • Any checksums that are in the same locations as ISP code will not be programmed.

If the Protect ISP option is unchecked then erasing or programming a device has the potential to erase or corrupt the ISP code. Any attempt to perform one of these operations will result in Flash Magic asking for confirmation first.

Erasing or corrupting the ISP code will immediately render the ISP functionality of the device non-functional.


In the Timeouts section the timeouts Flash Magic should use when performing ISP operations are specified. Normally default settings are used, however if you wish to change the timeouts then check the option to use my timeouts and fill in the values in the boxes.

Flash Magic uses two timeouts, regular and long. Each timeout is specified in seconds. The regular timeout is used for most ISP operations. The long timeout is used for erasing and performing blank checks.

The default settings are four seconds for the regular timeout and 60 seconds for the long timeout. It is strongly recommended to use the default settings.

If you are using a USB to COM port converter then you may find that increasing the timeouts will resolve communication problems that are sometimes present with those converters.


In the Misc section miscellaneous settings relating to Flash Magic can be found.

In the Misc section miscellaneous settings relating to Flash Magic can be found.

Flash Magic includes the ability to play a Wave file when programming is completed.

To do this check the option to play a Wave file, then either enter the path to the Wave file into the box or click on the Browse button and select the Wave file. For hearing the Wave file click on the purple arrow.

Find to