Nuvoton 8051 ISP by COM Port: User Manual
Nuvoton 8051 ISP by COM Port: User Manual
Nuvoton 8051 ISP by COM Port: User Manual
Nuvoton
8051 ISP by COM Port
User Manual
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 1
8051 ISP by COM Port
Table of Contents
Revision History ...................................................................................................... 3
1 Introduction ........................................................................................................ 4
2 Hardware ........................................................................................................... 4
2.1 With an RS232 Transceiver in the Target System ....................................................................... 6
2.2 Without an RS232 Transceiver in the Target System .................................................................. 7
2.3 Requirement on the MCU Operating Frequency .......................................................................... 8
3 Software ............................................................................................................ 9
3.1 Installing the Application Program ............................................................................................... 9
3.2 Introduction to the GUI ................................................................................................................ 9
3.3 Auto Synchronization of Buffer Data .......................................................................................... 10
4 Operation Steps ............................................................................................... 11
4.1 With Reset Control .................................................................................................................... 11
4.2 Without Reset Control ............................................................................................................... 11
4.3 Production Mode ....................................................................................................................... 12
5 Reset Control ................................................................................................... 13
6 Tool Project File (TPJ) ..................................................................................... 14
7 Advanced Functions ........................................................................................ 15
7.1 Serial Number Programming ..................................................................................................... 15
7.2 Fast Protocol Mode ................................................................................................................... 17
7.3 Chip Counter ............................................................................................................................. 18
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 2
8051 ISP by COM Port
Revision History
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 3
8051 ISP by COM Port
1 Introduction
ISP is the acronym of In-System Programming, which makes it possible that the user can update the program
memory under the software control without removing the mounted MCU chip from the actual end product. For the
8051 MCU products, we provide an ISP solution through the COM port of PC. As long as the LDROM of the MCU is
pre-programmed with the Nuvoton Standard ISP Code and CONFIG bits are properly configured, the user can easily
update the APROM of the MCU through the COM port of PC.
Note:
The ISP function can work only when the ISP code has resided in LDROM of the MCU. To let users easily use the ISP function,
some of the 8051 MCU products have the “Nuvoton Standard ISP Code” pre-programmed in LDROM and CONFIG bits properly
configured before shipping. Please contact Nuvoton for detailed product information. (The “Nuvoton Standard ISP Code” is also
included in the folder [(3) Nuvoton Standard ISP Code]. The user may program it with a universal programmer.)
2 Hardware
To make the 8051 MCU boot from LDROM after reset to run the ISP code, some specific I/O pins need to be tied to
ground and the CONFIG needs to be properly configured. The following table shows the specific I/O pins and the
proper CONFIG setting used for booting from LDROM after reset. In addition, to directly connect to the COM port of
PC, there needs an RS232 transceiver (e.g. MAX232) in the target system. The following sub-sections will show the
hardware connection.
I/O Pins and CONFIG Bit for Booting from LDROM after Reset
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 4
8051 ISP by COM Port
I/O Pins Tied to Ground for CONFIG Setting for
Part No.
Booting from LDROM Booting from LDROM
N79E815A configured as LDROM
N79E844A
N79E845A
N79E854A
N79E855A
N79E8132A
N79E8432A
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 5
8051 ISP by COM Port
2.1 With an RS232 Transceiver in the Target System
In this design, each target system has an RS232 transceiver (e.g. MAX232) inside, and so only one RS232 cable is
needed during the ISP operation, as shown below.
Transceiver
15
16
R2 U1 U2
10K VCC 1 2 RS232
GND
VCC
C1+ V+ 6
C2
10p
/EA C4 V- C7
1u/16V
Connector
1u/16V 3 P1
XTAL1 C1-
X1 GND 5
C3 Fosc 4 RI 9
C2+
10p XTAL2 C5
DTR 4
CTS 8
VCC
UART 1u/16V 5 TD 3
Interface C2- RTS 7
C1 RXD TXD 11 14 RD 2
R1 2u P3.0(RXD) 10 T1_IN T1_OUT 7 DSR 6
47K T2_IN T2_OUT DCD 1
RST TXD RXD 12 13
P3.1(TXD) 9 R1_OUT R1_IN 8 Male DB9
VCC R2_OUT R2_IN
P2.6 R3 MAX232 R4
P2.7 4.7K 10K
Q1
GND 2N3906
PC
COM Port RS232 Cable
Note 1:
The I/O pins used for booting from LDROM may be P2.6&P2.7, P4.3, P3.6&P3.7, P4.0 or none.
(See the above table.)
Note 2:
For "With Reset Control" configuration, Q1, R3 and R4 are needed.
For "Without Reset Control" configuration, Q1, R3 and R4 are not needed.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 6
8051 ISP by COM Port
2.2 Without an RS232 Transceiver in the Target System
To save an RS232 transceiver (e.g. MAX232) built in each target system, the user may use the RS232 Cable
Adaptor with an RS232 transceiver inside, as shown below.
Transceiver
15
16
U1
General
R2 U2
10K Connector 1 2
VCC RS232
GND
VCC
C1+ V+ 6
C2 /EA C7
10p R5 C4 V-
1u/16V Connector
P2.6 100 1u/16V 3 P1
XTAL1 C1-
X1 (PL) Pulled low
GND 5
C3 Fosc
P2.7 4 RI 9
C2+
10p XTAL2 C5
DTR 4
RST RST CTS 8
VCC 1u/16V 5 TD 3
UART VCC C2- RTS 7
C1 VCC
2u Interface TXD 11 14 RD 2
R1 P3.0 RXD 10 T1_IN T1_OUT 7 DSR 6
47K RST P3.0(RXD) T2_IN T2_OUT DCD 1
RST P3.1 TXD RXD 12 13
P3.1(TXD) 9 R1_OUT R1_IN 8 Male DB9
P2.6 GND GND VCC R2_OUT R2_IN
P2.7
P2.6
R3 MAX232 R4
P2.7 4.7K 10K
Q1
To boot from LDROM. GND 2N3906
(See Note 1)
RST
For reset control.
(See Note 2)
PC
COM Port RS232 Cable
Note 1:
The I/O pins used for booting from LDROM may be P2.6&P2.7, P4.3, P3.6&P3.7, P4.0 or none.
(See the above table.)
Note 2:
For "With Reset Control" configuration, Q1, R3 and R4 are needed.
For "Without Reset Control" configuration, Q1, R3 and R4 are not needed.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 7
8051 ISP by COM Port
2.3 Requirement on the MCU Operating Frequency
For ISP operation through COM port, there is no special restriction on the MCU operating frequency as long as the
frequency is higher than or equal to 3.6864 MHz. The 8051 MCU will automatically choose a proper baudrate
according to its operating frequency to communicate with the host (PC).
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 8
8051 ISP by COM Port
3 Software
3.1 Installing the Application Program
The application program setup file is contained in the folder [(2) Application Program]. Using the default installation
setting, you will find the item “Nuvoton Tools \ Nuvoton ISP-ICP Utility, v7.10” appears in the Windows START-menu
after the application program is successfully installed.
Note:
‘ISP-ICP means’ this application program is used for both the ‘ISP’ Programmer and the ‘ICP Programmer’.
In addition, also for the ‘ISP by COM Port’.
Production Mode
Select Select the COM port
updated items to which the MCU chip
when Set CONFIG bits is connected
'Update chip'
is clicked
Click to show
APROM buffer
Click to show
DataFlash buffer
Information of
the loaded file
Processing
status
Serial number Chip counter
to be programmed
Note:
To load code file, click 'APROM Buffer', then click 'Load File'
To load data file, click 'DataFlash Buffer', then click 'Load File'
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 9
8051 ISP by COM Port
3.3 Auto Synchronization of Buffer Data
The buffer contents will be automatically synchronized with the physical file in the hard disk when the function button
'Update Chip' is clicked, as shown below. Thus, the user does not need to manually reload the files for APROM
buffer and DataFlash buffer when the physical files are updated externally.
Buffer Contents
Physical file in
the hard disk
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 10
8051 ISP by COM Port
4 Operation Steps
4.1 With Reset Control
For the “With Reset Control” configuration, the user should follow the steps to do ISP.
Step 1: Connect the target system to the COM port of PC through an RS232 cable.
Step 2: Run the PC-site AP, select wanted part no., select correct COM port to which the target system is connected,
and load the code/data file into APROM/DataFlash Buffer.
Step 3: Click the “Update Chip” button when the target system is in power-on state.
Step 4: Now, the 8051 MCU will automatically reboot from LDROM, and will be successfully detected and updated.
Note: If possible, “With Reset Control” is strongly recommended for ISP operation.
Step 1: Connect the target system to the COM port of PC through an RS232 cable.
Step 2: Run the PC-site AP, select wanted part no., select correct COM port to which the target system is connected,
and load the code/data file into APROM/DataFlash Buffer.
Step 3: Click “Update Chip” button.
Step 4: Manually have the 8051 MCU reboot from LDROM during “Detect chip…”, as shown below, by the following
two methods:
(1) Send a reset pulse to the RST-pin of the MCU when the target system is in power-on state, or
(2) Power off the target system and then power on again.
Step 5: Now, the 8051 MCU will be successfully detected and updated.
Note:
(1) Step 4 shows the “Without Reset Control” is somewhat inconvenient for the user to have the 8051 MCU reboot
from LDROM. This is why we strongly recommend the user to adopt the “With Reset Control” configuration.
(2) If any failed condition happens, repeat steps 3 and 4.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 11
8051 ISP by COM Port
4.3 Production Mode
In the production mode, the user should follow the steps to do ISP.
Step 1: Connect the target system to the COM port of PC through an RS232 cable.
Step 2: Run the PC-site AP, select wanted part no., select correct COM port to which the target system is connected,
load the code/data file into APROM/DataFlash Buffer, and click the “P.M.” check box to enable production
mode.
Step 3: Click the “Update Chip” button to start programming of production mode.
Step 4: Refer to Step 4 in Section 4.1 & 4.2 to make the 8051 MCU boot from LDROM.
Step 5: The 8051 MCU will be detected and updated.
If pass, the ‘PASS’ message will be displayed for 1 second and then automatically disappear.
If fail, the ‘FAIL’ message will be displayed until the user closes it.
Step 6: Now, detecting 8051 MCU will automatically restart. The user may place the next chip to be programmed
and go to Step 4.
To stop the production mode, click the ‘P.M.’ check box to be un-checked state.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 12
8051 ISP by COM Port
5 Reset Control
Normally, the RST-pin of the MCU with external RC reset circuit (see Figure 5a) can be controlled by the PNP
transistor Q1 (see the figures in Sections 2.1 and 2.2). At this time, the user may adopt the “With Reset Control”
configuration for ISP operation. However, the RST-pin cannot be controlled when it is connected to a reset IC (such
as MAX810, ADM810, AIC810 and FP6810, etc., see Figure 5b). Now the user should adopt the “Without Reset
Control” configuration for ISP operation.
The general external RC reset circuit is shown in Figure 5a. The resistance of R should be larger than 47kΩ to have
the RST-pin be successfully controlled by the PNP transistor. Normally, {47kΩ, 2.2uF} and {100kΩ, 1uF} are
recommended for {R, C}.
8051 MCU
External RC reset circuit
VDD
C
RST
GND
In this condition, the RST-pin cannot be controlled by the PNP transistor Q1.
8051 MCU
VCC
RESET RST
GND
GND
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 13
8051 ISP by COM Port
6 Tool Project File (TPJ)
The user may save all the GUI settings to the Tool Project (TPJ) file, and retrieve the GUI settings by loading the
TPJ file previously saved. It is much helpful to the user to manage a variety of programming data by the ‘project’
type.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 14
8051 ISP by COM Port
7 Advanced Functions
7.1 Serial Number Programming
The serial number programming is supported in ‘ISP by COM Port’. The serial number is BCD coded and 8 bytes
long, which supports 16 decimal digits. Only APROM area can be programmed with the serial number. The following
figure shows how to open the configuration dialog box for serial number programming.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 15
8051 ISP by COM Port
As shown in the above figure, ‘2468000012345678’ is to be programmed at address 0x3FF8 in APROM area. The
BCD-coded serial number programmed in the chip has a ‘what you see is what you get’ format, as shown below.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 16
8051 ISP by COM Port
7.2 Fast Protocol Mode
To greatly reduce the operation time of ‘ISP by COM Port’, the Fast Protocol mode is supported. In most conditions,
the user can use this mode to do ISP. In some cases, for example, the XTAL frequency is 3.6864 MHz, the user
may select the Normal Protocol mode to prevent communication problems from occurring during ISP operation.
After ISP code version 4.00 (e.g. ISP_Code_N78E055A_v4.00.bin), use Fast Protocol for any frequency. Normal
Protocol is no more required when XTAL frequency is 3.6864 MHz.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 17
8051 ISP by COM Port
7.3 Chip Counter
The chip counter is used to calculate the successfully programmed chips. The user may configure the counter as up
counter or down counter, and set the initial counter value. The following figure shows how to open the configuration
dialog box for chip counter.
© 2014 Nuvoton Technology Corporation. All Rights Reserved. < Revision 7.10 > 18