Microchip Technology Universal Device Programmer DV007004 DV007004 Manuale Utente
Codici prodotto
DV007004
MPLAB
®
PM3 User’s Guide
DS51464C-page 40
© 2006 Microchip Technology Inc.
4.5.3
Loading the Hex Code into Program Memory
If you have a hex file (e.g., code.hex) ready for programming into a microcontroller,
open the Program Memory window if it is not already open. To do so, from the MPLAB
IDE menu, select View>Program Memory. Then, select File>Import... to browse for the
file you want to load into the MPLAB IDE Program Memory window.
open the Program Memory window if it is not already open. To do so, from the MPLAB
IDE menu, select View>Program Memory. Then, select File>Import... to browse for the
file you want to load into the MPLAB IDE Program Memory window.
The Program Memory window should now contain the hex code from the hex file
(Figure 4-3).
(Figure 4-3).
FIGURE 4-3:
PROGRAM MEMORY — HEX CODE DISPLAY
If you do not have a hex file with which to program your device, you can build one using
MPLAB IDE Projects. MPLAB IDE provides a text editor for generation of source code
and compatibility with various assemblers/compilers for assembling/compiling your
source code into hex code in MPLAB IDE program memory. For an example on using
MPLAB IDE Projects to create a hex file for device programming, refer to Chapter
3. “Tutorial”. Please read the MPLAB IDE documentation to see how to use MPLAB
IDE Projects to develop your own firmware.
Each time you rebuild your project, the Program Memory window will be updated.
MPLAB IDE Projects. MPLAB IDE provides a text editor for generation of source code
and compatibility with various assemblers/compilers for assembling/compiling your
source code into hex code in MPLAB IDE program memory. For an example on using
MPLAB IDE Projects to create a hex file for device programming, refer to Chapter
3. “Tutorial”. Please read the MPLAB IDE documentation to see how to use MPLAB
IDE Projects to develop your own firmware.
Each time you rebuild your project, the Program Memory window will be updated.
4.5.3.1
IMPORTED HEX FILES AND EEPROM DATA
If you imported your hex file into MPLAB IDE and are using EEPROM data memory,
make sure your hex code specifies the start of EEPROM data memory. This needs to
be specified for use with programmers.
make sure your hex code specifies the start of EEPROM data memory. This needs to
be specified for use with programmers.
Note: There is no warning for importing files with invalid hex values. That is, the
hex file of a 14-bit device may be loaded into the program memory of a
12-bit device and the hex file of a 16-bit device may be loaded into the
program memory of a 14-bit device.
12-bit device and the hex file of a 16-bit device may be loaded into the
program memory of a 14-bit device.