11 using the in-system programming (isp), Nxp semiconductors – NXP Semiconductors P89LPC9321 UM10310 User Manual

Page 119

Advertising
background image

UM10310

All information provided in this document is subject to legal disclaimers.

© NXP B.V. 2010. All rights reserved.

User manual

Rev. 2 — 1 November 2010

119 of 139

NXP Semiconductors

UM10310

P89LPC9321 User manual

expense in components and circuit board area. The ISP function uses five pins (V

DD

, V

SS

,

TXD0, RXD0, and RST). Only a small connector needs to be available to interface your
application to an external circuit in order to use this feature.

18.11 Using

the

In-system programming (ISP)

The ISP feature allows for a wide range of baud rates to be used in your application,
independent of the oscillator frequency. 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 P89LPC9231 to establish the baud rate. The ISP firmware
provides auto-echo of received characters. Once baud rate initialization 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<crlf>

In the Intel Hex record, the ‘NN’ represents the number of data bytes in the record. The
P89LPC9321 will accept up to 64 (40H) 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
maximum number of data bytes in a record is limited to 64 (decimal). ISP commands are
summarized in

Table 108

. As a record is received by the P89LPC9321, the information in

the record is stored internally and a checksum calculation is performed. 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 P89LPC9321 will send an ‘X’ out the serial
port indicating a checksum error. If the checksum 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.

Advertising