untitled document [] · 2016. 12. 9. · • select the com port you will be using to program the...
TRANSCRIPT
-
AN10258How to use the LPC900 In-circuit programming (ICP)Rev. 02 — 21 October 2004 Application note
Document information
Info Content
Keywords LPC900 In-circuit programming (ICP)
Abstract How to use the LPC900 In-circuit programming (ICP)
-
Philips Semiconductors AN10258How to use ICP
Revision history
Rev Date Description
02 20041021 Second version (9397 750 14227)
Modification:
• Updated Figure 5 “MCB900 hook-up”.01 20040324 Initial version (9397 750 12995)
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 2 of 17
Contact informationFor additional information, please visit: http://www.semiconductors.philips.com
For sales office addresses, please send an email to: [email protected]
-
Philips Semiconductors AN10258How to use ICP
1. Introduction
This document gives an overview of how the ICP (In Circuit Programming) on the P89LPC9xx can be done.
ICP is one of the programming methods of the LPC900 microcontroller family.
ICP uses a serial shift protocol that requires 5 pins to program: PCL, PDA, Reset, VDD and VSS. ICP is different from ISP (In System Programming) because it is done completely by the microcontroller’s hardware and does not require a bootloader.
The ICP programming method is a serial programming method, shifting in programming commands and shifting data in and out with a clock and dataline.
Using ICP on the application board has many advantages:
• The latest software revision can be loaded into the product before shipping.• Field updates can be made when reprogramming the chip on the application board.• In the debug stage of development the chip can stay on the application board while
being reprogrammed.
2. Hooking up ICP to the Application board
Figure 1 shows how an ICP programming device can be hooked up to the Application board. This allows the microcontroller to be (re)programmed while it is already soldered on the board.
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 3 of 17
-
Philips Semiconductors AN10258How to use ICP
Table 1 shows the pins needed for ICP programming.
[1] The connection to the application has to be disconnected during ICP programming.
The majority of the LPC900 family have the 5 pins necessary for ICP located in the same configuration. Only the LPC901/902/903 differ from the same configuration, see Section 5 for the pin configurations of the LPC900 parts.
Fig 1. ICP set-up
ICP DEVICE PROGRAMMER
application
header
VDDPCL
PDA
resetVSS
VDD
PCLPDAresetVSS
VSS
VDD application
P89LPC9xx
application board
jumpers
002aaa836
Table 1: Programming pins used for ICP
Mnemonic Type Name and function Disconnect regular connection?
VSS P Ground: 0 V reference. No
VDD P Power Supply: 3 V Yes[1]
PCL I Serial clock input for programming communication.
Yes[1]
PDA I/O Serial data I/O for programming communication.
Yes[1]
RESET I ICP programming entry pin Yes[1]
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 4 of 17
-
Philips Semiconductors AN10258How to use ICP
3. Using the EPM900 as an ICP programmer
The EPM900 Emulator / Programmer from Keil Software supports ICP programming of all devices that have ICP. The EPM900 can be setup to do the ICP programming using the Keil �Vision IDE. Under the ‘Utilities’ tab in ‘Options for Target’, select ‘Use Target Driver for Flash Programming’ and select the Target to be ‘LPC900 EPM Emulator/ Programmer’.
Click on ‘Settings’ to select the device you want to program.
3.1 Set-upIn the ‘Settings’ menu you can select the device you want to program from the Device pull-down menu. The programming mode will be ICP by default on devices that only have ICP programming capability. The parts can be hooked up one-to-one from the EPM900 to the application board as shown in Figure 1. Connect all 5 ICP pins and then program with the EPM900.
Fig 2. Options for the EPM900
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 5 of 17
-
Philips Semiconductors AN10258How to use ICP
When using the LPC901/902/903 make sure that the ‘Pin to Pin’ is selected in the ‘Adapter’ option.
Fig 3. Settings for the EMP900 as ICP programmer
Table 2: ICP connection to EPM900 pin
ICP Pin Hook up to EPM900 pin
P0.4/PDA programming Data pin P0.4
P0.5/PCL programming clock pin P0.5
P1.5/RST ICP mode entry pin P1.5
VDD needed for ICP mode entry VDD
VSS VSS
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 6 of 17
-
Philips Semiconductors AN10258How to use ICP
When the EPM900 is hooked up to the Application board and the project you want to program into the microcontroller is open press the ‘LOAD’ button on the Build toolbar to start downloading code to the microcontroller.
4. Modifying the MCB900 as ICP programmer
The MCB900 evaluation board from Keil Software can be modified to be able to work as an ICP programming device. Only 1 PNP transistor and an ICP ribbon cable to the application board is needed.
The LPC932 on the MCB900 can be programmed to interface between the ISP protocol used by the FlashMagic ISP programming software and the ICP protocol needed to program the LPC9xx.
4.1 Hardware set-up of the MCB900Table 3 shows how to hook up the MCB900 to the ICP target board.
[1] To control VDD, a PNP transistor is needed, because P2.3 cannot supply enough current for the LPC9xx during programming.
Fig 4. LOAD button on the Build toolbar
Table 3: ICP connection to MCB900 pin
ICP Pin Hook up to MCB900 pin
P0.4/PDA programming Data pin P0.4
P0.5/PCL programming clock pin P0.5
P1.5/RST ICP mode entry pin P1.6
VDD needed for ICP mode entry P2.3[1]
VSS VSS
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 7 of 17
-
Philips Semiconductors AN10258How to use ICP
4.2 Programming the ISP-ICP bridge codeFor FlashMagic to be able to interface to the ICP protocol the ISP commands from FlashMagic have to be converted into ICP commands. This can be done by programming the ISP-ICP bridge code that will do the translation from FlashMagic’s ISP commands to ICP commands.
Step 1:
• If not yet installed or if you have a version before 1.77, install the latest FlashMagic from: www.esacademy.com/software/flashmagic.
Step 2:
• Program the LPC932 device on the MCB900 board with the ISP-ICP bridge code using the FlashMagic software you installed in step 1.
• Set the jumper on the MCB900 board to the RESET position:
Fig 5. MCB900 hook-up
Fig 6. MCB900 in Reset mode
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 8 of 17
http://www.esacademy.com/software/flashmagic
-
Philips Semiconductors AN10258How to use ICP
• Connect the MCB900 to your PC COM port using a serial cable.• Power up the MCB900 board.• Start FlashMagic (Start | Programs | FlashMagic | FlashMagic).• Go to ‘Options | Advanced Options | Hardware Config’ and make sure the box ‘Use
DTR and RTS to enter ISP mode’ is selected:
• Go to ‘Options | Advanced Options | Security’ and make sure the ‘Protect ISP code’ option is selected:
• Select the COM port you will be using to program the LPC932.• Select the P89LPC932 as the device to be programmed.• Select baud rate 9600.• Browse to the prog90x.hex file (this first has to be unzipped from the ZIP that includes
the appnote).
• Check the ‘erase all’ Flash box.• Click start program the ISP-ICP bridge code into the P89LPC932:
Fig 7. Use DTR and RTS
Fig 8. Protect ISP code
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 9 of 17
-
Philips Semiconductors AN10258How to use ICP
4.3 Programming the LPC900Once all setups from the previous chapter have been made, using FlashMagic the LPC900 devices can be programmed in 5 steps corresponding to the numbered steps on the FlashMagic User Interface.
Step 0:
• Disconnect the power cable from the MCB900 board • Make sure that the jumpers on the application board are set for ICP programming
mode and reset your application board is connected properly to the MCB900 board.
• Plug the power cable back in to enter ICP mode on the LPC9xx (the ICP mode is only entered on power-up of the MCB900). LED P2.3 on the MCB900 board should light up.
• Start FlashMagic (Start | Programs | FlashMagic | FlashMagic).
Step 1:
• Select the COM port (make sure it is not already taken by another application, e.g. some PDA software)
Fig 9. Start programming
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 10 of 17
-
Philips Semiconductors AN10258How to use ICP
• Select a baud rate of 19200 baud (the ISP-ICP bridge application has a fixed baud rate of 19200 baud)
• Select the LPC900 device you would like to program. • At this point you can do a quick read of the device signature bytes to make sure you’re
connected to the LPC9xx:
If FlashMagic cannot read the Device Signature or you get all FF’s, please check your setup. See chapter 5.1 for the correct ID bytes.
Step 2
Select which Flash blocks should be erased before the programming operation.
Step 3
Select the hex file to be programmed.
Step 4
Can be used to set security bits and fill unused Flash (optional)
Step 5
Start programming!
4.4 Verification of the programmed code using CRCsThe LPC90x verifies using CRC (Cyclic Redundancy Check). The make sure the LPC90x has been programmed correctly, use the ‘ISP | Cyclic Redundancy Check’ option in FlashMagic.
For example, after the LED-Blinker code for the LPC901/2/3 is programmed into an LPC901 device, go to ‘ISP | Cyclic Redundancy Check’:
Fig 10. Checking signature bytes (example for LPC908)
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 11 of 17
-
Philips Semiconductors AN10258How to use ICP
The Device CRC column gives you the CRC checksum for each block plus the Global CRC checksum for the whole device. As you can see from the image above, The Device CRC matches the corresponding Hex File CRC from the hex file on the CD ROM. This means that the device was programmed successfully. (Please note that the code for the LED Blinker on the LPC906/7/8 has a different CRC).
Fig 11. CRC check window
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 12 of 17
-
Philips Semiconductors AN10258How to use ICP
5. Devices that are supported with the ICP programming interface
5.1 8-pin packages
Fig 12. P89LPC901 pinout Fig 13. P89LPC902 pinout
Fig 14. P89LPC903 pinout Fig 15. P89LPC906 pinout
Fig 16. P89LPC907 pinout Fig 17. P89LPC908 pinout
Fig 18. P89LPC912 pinout Fig 19. P89LPC913 pinout
handbook, halfpage
002aaa438
P89
LP
C90
1FD
1
2
3
4
8
7
6
5
VSS
P0.4/CIN1A/KBI4
P0.5/CMPREF/KBI5
P1.2/T0
VDD
XTAL1/P3.1
CLKOUT/XTAL2/P3.0
RST/P1.5
handbook, halfpage
002aaa439
P89
LP
C90
2FD1
2
3
4
8
7
6
5
VSS
P0.4/CIN1A/KBI4
P0.5/CMPREF/KBI5
P0.6/CMP1/KBI6
VDD
P0.2/CIN2A/KBI2
P0.0/CMP2/KBI0
RST/P1.5
handbook, halfpage
002aaa440
P89
LP
C90
3FD1
2
3
4
8
7
6
5
VSS
P0.4/CIN1A/KBI4
P0.5/CMPREF/KBI5
P1.0/TxD
VDD
P0.2/CIN2A/KBI2
P1.1/RxD
RST/P1.5
002aaa847
P89
LP
C90
6
1
2
3
4
8
7
6
5
P0.4/CIN1A/KBI4/PDA
P0.5/CMPREF/KBI5/PCL
VDD
CLKOUT/XTAL2/P3.0
RST/P1.5
VSS
P0.6/CMP1/KBI6
XTAL1/P3.1
ICP pins
ICP pins
002aaa848
P89
LP
C90
7
1
2
3
4
8
7
6
5
P0.4/CIN1A/KBI4/PDA
P0.5/CMPREF/KBI5/PCL
VDD
P1.0/TxD
RST/P1.5
VSS
P0.6/CMP1/KBI6
P1.2/T0
ICP pins
002aaa849
P89
LP
C90
8
1
2
3
4
8
7
6
5
P0.4/CIN1A/KBI4/PDA
P0.5/CMPREF/KBI5/PCL
VDD
P1.0/TxD
RST/P1.5
VSS
P0.6/CMP1/KBI6
P1.1/RxD
P89
LP
C91
2
002aaa850
1
2
3
4
5
6
7
P2.2/MOSI
SPICLK/P2.5
RST/P1.5
VSS
P0.6/CMP1/KBI6
P1.2/T0
XTAL1/P3.1
P2.3/MISO
P0.2/CIN2A/KBI2
P0.4/CIN1A/KBI4/PDA
P0.5/CMPREF/KBI5/PCL
VDD
P2.4/SS
CLKOUT/XTAL2/P3.0
14
13
12
11
10
9
8
ICP pins ICP pins
P89
LP
C91
3
002aaa851
1
2
3
4
5
6
7
P2.2/MOSI
SPICLK/P2.5
RST/P1.5
VSS
P0.6/CMP1/KBI6
P1.1/RXD
XTAL1/P3.1
P2.3/MISO
P0.2/CIN2A/KBI2
P0.4/CIN1A/KBI4/PDA
P0.5/CMPREF/KBI5/PCL
VDD
P1.0/TXD
CLKOUT/XTAL2/P3.0
14
13
12
11
10
9
8
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 13 of 17
-
Philips Semiconductors AN10258How to use ICP
Fig 20. P89LPC914 pinout Fig 21. P89LPC922/921/920 pinout
Fig 22. P89LPC930/931 pinout Fig 23. P89LPC933/934 pinout
ICP pinsP
89L
PC
914
002aaa852
1
2
3
4
5
6
7
P2.2/MOSI
SPICLK/P2.5
RST/P1.5
VSS
P0.6/CMP1/KBI6
P1.1/RXD
P1.2/T0
P2.3/MISO
P0.2/CIN2A/KBI2
P0.4/CIN1A/KBI4/PDA
P0.5/CMPREF/KBI5/PCL
VDD
P1.0/TXD
P2.4/SS
14
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
P0.6/CMP1/KBI6
P0.7/T1/KBI7
P1.0/TXD
P1.1/RXD
P2.5/SPICLK
P2.4/SS
28
27
26
25
24
23
22
21
20
19
18
17
16
15
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 14 of 17
-
Philips Semiconductors AN10258How to use ICP
5.2 Device ID bytes
Fig 24. P89LPC935 pinout
ICP pins
handbook, halfpage
P89
LP
C93
5
002aaa855a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
AD03/DAC0/ICB/P2.0
AD02/OCD/P2.1
AD01/KBI0/CMP2/P0.0
AD00/OCC/P1.7
OCB/P1.6
RST/P1.5
VSS
XTAL1/P3.1
CLKOUT/XTAL2/P3.0
INT1/P1.4
SDA/INT0/P1.3
SCL/T0/P1.2
MOSI/P2.2
MISO/P2.3
P2.7/ICA
P2.6/OCA
P0.1/CIN2B/KBI1/AD10
P0.2/CIN2A/KBI2/AD11
P0.3/CIN1B/KBI3/AD12
P0.4/CIN1A/KBI4/AD13/DAC1/PDA
P0.5/CMPREF/KBI5/PCL
VDD
P0.6/CMP1/KBI6
P0.7/T1/KBI7
P1.0/TXD
P1.1/RXD
P2.5/SPICLK
P2.4/SS
28
27
26
25
24
23
22
21
20
19
18
17
16
15
Table 4: Device ID bytes
Device MFGID ID1 ID2
P89LPC901 15h DD 0Dh
P89LPC902 15h DD 0Fh
P89LPC903 15h DD 10h
P89LPC906 15h DD 11h
P89LPC907 15h DD 12h
P89LPC908 15h DD 13h
P89LPC912 15h DD 14h
P89LPC913 15h DD 15h
P89LPC914 15h DD 16h
P89LPC920 15h DD 1Ah
P89LPC921 15h DD 0Bh
P89LPC922 15h DD 0Ch
P89LPC930 15h DD 19h
P89LPC931 15h DD 09h
P89LPC933 15h DD A0h
P89LPC934 15h DD 1Dh
P89LPC935 15h DD 1Eh
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 15 of 17
-
Philips Semiconductors AN10258How to use ICP
6. Disclaimers
Life support — These products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. Philips Semiconductors customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Philips Semiconductors for any damages resulting from such application.
Right to make changes — Philips Semiconductors reserves the right to make changes in the products - including circuits, standard cells, and/or software - described or contained herein in order to improve design and/or performance. When the product is in full production (status ‘Production’), relevant changes will be communicated via a Customer Product/Process Change Notification (CPCN). Philips Semiconductors assumes no responsibility or liability for the use of any of these products, conveys no licence or title under any patent, copyright, or mask work right to these products, and makes no representations or warranties that these products are free from patent, copyright, or mask work right infringement, unless otherwise specified.
9397 750 14227 © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Application note Rev. 02 — 21 October 2004 16 of 17
-
Philips Semiconductors AN10258How to use ICP
7. Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Hooking up ICP to the Application board . . . . 33 Using the EPM900 as an ICP programmer . . . 53.1 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Modifying the MCB900 as ICP programmer . . 74.1 Hardware set-up of the MCB900 . . . . . . . . . . . 74.2 Programming the ISP-ICP bridge code . . . . . . 84.3 Programming the LPC900 . . . . . . . . . . . . . . . 104.4 Verification of the programmed code �
using CRCs . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Devices that are supported with the ICP
programming interface . . . . . . . . . . . . . . . . . . 135.1 8-pin packages . . . . . . . . . . . . . . . . . . . . . . . . 135.2 Device ID bytes . . . . . . . . . . . . . . . . . . . . . . . 15
6 Disclaimers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
© Koninklijke Philips Electronics N.V. 2003All rights are reserved. Reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice. No liability will be accepted by the publisher for any consequence of its use. Publication thereof does not convey nor imply any license under patent- or other industrial or intellectual property rights.
Date of release: 21 October 2004Document number: 9397 750 14227
Published in U.S.A.
1. Introduction2. Hooking up ICP to the Application board3. Using the EPM900 as an ICP programmer3.1 Set-up
4. Modifying the MCB900 as ICP programmer4.1 Hardware set-up of the MCB9004.2 Programming the ISP-ICP bridge code4.3 Programming the LPC9004.4 Verification of the programmed code using CRCs
5. Devices that are supported with the ICP programming interface5.1 8-pin packages5.2 Device ID bytes
6. Disclaimers7. Contents
/ColorImageDict > /JPEG2000ColorACSImageDict > /JPEG2000ColorImageDict > /AntiAliasGrayImages false /DownsampleGrayImages true /GrayImageDownsampleType /Bicubic /GrayImageResolution 300 /GrayImageDepth -1 /GrayImageDownsampleThreshold 1.50000 /EncodeGrayImages true /GrayImageFilter /DCTEncode /AutoFilterGrayImages true /GrayImageAutoFilterStrategy /JPEG /GrayACSImageDict > /GrayImageDict > /JPEG2000GrayACSImageDict > /JPEG2000GrayImageDict > /AntiAliasMonoImages false /DownsampleMonoImages true /MonoImageDownsampleType /Bicubic /MonoImageResolution 1200 /MonoImageDepth -1 /MonoImageDownsampleThreshold 1.50000 /EncodeMonoImages true /MonoImageFilter /CCITTFaxEncode /MonoImageDict > /AllowPSXObjects false /PDFX1aCheck false /PDFX3Check false /PDFXCompliantPDFOnly false /PDFXNoTrimBoxError true /PDFXTrimBoxToMediaBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXSetBleedBoxToMediaBox true /PDFXBleedBoxToTrimBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXOutputIntentProfile () /PDFXOutputCondition () /PDFXRegistryName (http://www.color.org) /PDFXTrapped /Unknown
/Description >>> setdistillerparams> setpagedevice