User manual

Using MPLAB PM3 with MPLAB IDE
© 2006 Microchip Technology Inc. DS51464C-page 43
4.7 READING A DEVICE
To copy the firmware from a programmed device into an unprogrammed device, read
the programmed firmware (program memory, Configuration bits, etc.) into MPLAB IDE,
then program the new device based on this information.
To read the entire device (i.e., all of program memory, Configuration bits, etc.), click
Programmer>Read
.
To read selectively (e.g., part of program memory, only Configuration bits), select
Programmer>Settings>Memory Ranges
to display the Memory Ranges dialog. Select
the options to be read, then click OK in this dialog. Areas that are grayed out are not
available on the device. Then, select Programmer>Read
. The memory area
corresponding to the checked boxes will be read.
Once the Read is complete, the Program Memory window will display the data read
from the device master. You can save that data as a hex file (File>Export
), insert a new
device into MPLAB PM3 to copy that same data into a new device, or modify the data
in MPLAB IDE before you save to a hex file or program another device.
If you attempt to read a code-protected device, you will get a warning indicating that the
device is code-protected and that the program memory may be invalid. If this happens,
obtain the original hex code from a file or a non-protected device.
If you have an MPLAB ICE emulator connected to MPLAB IDE, your code will be
downloaded to the emulated program memory of MPLAB ICE. If you have a project
open, you will be asked if you want to close it before reading memory from a device.
After reading a device into MPLAB IDE, its data will appear in the Program Memory
window. You can modify the data, then save it to a hex file by selecting Project>Build
Options>Project. See the MPLAB IDE documentation for more information.
4.8 SPECIAL PROGRAMMING
4.8.1 SQTP
Serial Quick Turn Programming (SQTP) allows you to program a unique serial number
into each device. This number can be used as an entry code, password or ID number.
Serialization is done by using a series of RETLW (Return Literal W) instructions, with
the serial number bytes as the literal data. To serialize, you must first generate a
serialization file, and then use that file to serialize locations in the device
microcontroller:
1. To generate an SQTP file, select Programmer>Settings>
, click on the SQTP tab
and fill in the dialog.
2. To activate serialization, select Programmer>Load SQTP File
and choose the
file.
3. To program the device, select Programmer>Program
.
Refer to Section 7.5.3 “SQTP Tab” and Section 7.6.1 “Using SQTP” for more
detailed information on SQTP programming. See Section 7.7.1 “Using Hexadecimal
Record Formats” for information on hex record formats.
Note: If you keep your project open, the Absolute Listing window and the Source
Code window may not match the data you have read into the Program
Memory window. Symbols may not match the proper addresses in the
Program Memory window.