
MS51
Nov. 28, 2019
Page
265
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
MOV
IAPCN,#BYTE_READ_CONFIG
MOV
IAPAH,#00h
MOV
IAPAL,#02h
CALL Trigger_IAP
MOV
B,R6
MOV
A,IAPFD
CJNE A,B,Program_CONFIG_Verify_Error
RET
Program_CONFIG_Verify_Error:
CALL Disable_IAP
MOV
P0,#00h
SJMP $
;********************************************************************
;
APROM code
;********************************************************************
AP_code:
DB
75h,0B1h, 00h
;OPCODEs of “MOV P0M1,#0”
DB
75h,0Ach, 00h
;OPCODEs of “MOV P3M1,#0”
DB
75h, 90h, 55h
;OPCODEs of “MOV P1,#55h”
DB
75h,0A0h,0Aah
;OPCODEs of “MOV P2,#0Aah”
DB
80h,0Feh
;OPCODEs of “SJMP $”
END
6.3.2
In-Circuit-Programming (ICP)
The Flash Memory can
be programmed by “In-Circuit-Programming” (ICP). If the product is just under
development or the end product needs firmware updating in the hand of an end customer, the
hardware programming mode will make repeated programming difficult and inconvenient. ICP method
makes it easy and possible without removing the microcontroller from the system. ICP mode also
allows customers to manufacture circuit boards with un-programmed devices. Programming can be
done after the assembly process allowing the device to be programmed with the most recent firmware
or a customized firmware.
There are three signal pins,
RST
̅̅̅̅̅̅
, ICP_DAT, and ICP_CLK, involved in ICP function.
RST
̅̅̅̅̅̅
is used to
enter or exit ICP mode. ICP_DAT is the data input and output pin. ICP_CLK is the clock input pin,
which synchronizes the data shifted in to or out from MCU under programming. User should leave
these three pins plus V
DD
and VSS pins on the circuit board to make ICP possible.
Nuvoton provides ICP tool for MS51, which enables user to easily perform ICP through Nuvoton ICP
programmer. The ICP programmer developed by Nuvoton has been optimized according to the
electric characteristics of MCU. It also satisfies the stability and efficiency during production progress.
For more details, please visit Nuvoton 8-bit Microcontroller website:
6.3.3
On-Chip-Debugger (OCD)
Overview
6.3.3.1
The MS51 is embedded in an on-chip-debugger (OCD) providing developers with a low cost method
for debugging user code, which is available on each package. The OCD gives debug capability of
complete program flow control with eight hardware address breakpoints, single step, free running, and
non-intrusive commands for memory access. The OCD system does not occupy any locations in the