
HMS99C51S/52S/54S/56S/58S
Sep. 2004 Ver 1.01
55
IN-SYSTEM PROGRAMMING (ISP)
The In-System Programming (ISP) is performed without removing the microcontroller from the system. The
ISP facility consists of a series of internal hardware resources coupled with internal firmware to facilitate remote
programming of the HMS99C51S/52S/54S/56S/58S through the serial port. The MagnaChip Microcontrollers
ISP facility has made in-circuit programming in an embedded application possible with a minimum of additional
expense in components and circuit board area. The ISP function through UART uses four pins: TxD, RxD, V
SS
,
and V
CC
. Only a small connector needs to be available to interface the application to an external circuit in order
to use this feature.
Using In-System Programming (ISP)
The ISP feature allows a wide range of baud rates in the user application. It is also adaptable to a wide range of
oscillator frequencies. This is accomplished by measuring the bit-time of a single bit in a received character.
This information is then used to program the baud rate in terms of timer counts based on the oscillator frequency.
The ISP feature requires that an initial character(an uppercase U) be sent to the HMS99C51S/52S/54S/56S/58S
to establish the baud rate. The ISP firmware provides auto-echo of received characters. Once baud rate initial-
ization has been performed, the ISP firmware will only accept Intel Hex-type records. Intel Hex records consist
of ASCII characters used to represent hexadecimal values and are summarized below:
:NNAAAARRDD...DDCC
HMS99C51S/52S/54S/56S/58S will accept up to 16(10
H
) data bytes. The “AAAA” string represents the address
of the first byte in the record. If there are zero bytes in the record, this field is often set to “0000”. The “RR”
string indicates the record type. A record type of “00” is a data record. A record type of “01” indicates the end-
of-file mark. In this application, additional record types will be added to indicate either commands or data for
the ISP facility. The “DD” string represents the data bytes. The maximum number of data bytes in a record is
limited to 16(decimal). The “CC” string represents the checksum byte. ISP commands are summarized in Table
22. As a record is received by the HMS99C51S/52S/54S/56S/58S, the information in the record is stored inter-
nally and a checksum calculation is performed and compared to “CC”. The operation indicated by the record
type is not performed until the entire record has been received. Should an error occur in the checksum, the
HMS99C51S/52S/54S/56S/58S will send an “X” out the serial port indicating a checksum error. If the check-
sum calculation is found to match the checksum in the record, then the command will be executed. In most cases,
successful reception of the record will be indicated by transmitting a “.” character out the serial port(displaying
the contents of the internal program memory is an exception). In the case of a Data Record(record type “00”),
an additional check is made. A “.” character will NOT be sent unless the record checksum matched the calcu-
lated checksum and all of the bytes in the record were successfully programmed.
For a data record, an “X” indicates that the checksum failed to match, and an “R” character indicates that one
of the bytes did not properly program.
MagnaChip ISP, a software utility to implement ISP programming with a PC, is available from the MagnaChip
web site. The users of this ISP function should use this MagnaChip ISP software for proper flash ROM control
and operation.