
MS51
Dec. 17, 2019
Page
190
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
RET
Program_CONFIG_Verify:
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 b
e 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, nRESET, ICPDA, and ICPCK, involved in ICP function. nRESET is used
to enter or exit ICP mode. ICPDA is the data input and output pin. ICPCK 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 VDD and GND 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)
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
memory map and does not share any on-chip peripherals.
When the OCDEN (CONFIG0.4) is programmed as 0 and LOCK (CONFIG0.1) remains un-