Teach Yourself PIC Microcontrollers | www.electronicspk.com | 144
Microchip® MPLAB is a software, that can be downloaded free from Microchip site. As of this writing
version 8.0 is available. MPLAB is an integrated development environment for PIC microcontrollers from
Microchip. The platform supports native assembly language, and programs written
in assembly can be di-
rectly compiled on this platform. It also supports many other supporting tools, like C17, C18, C24 etc. these
are C language compilers available from microchip site. These compilers are integrated with MPLAB, and
you can write software,
for all supported devices, debug them, within MPLAB, see the status of various
registers and then burn the hex file into the PIC using MPLAB supported programmers, or your own, while
generating hex file from MPLAB.
The MPLAB organizes your entire
development as a project, which may contain various source files, linker
libraries and so on.
One of the beautiful aspects of MPLAB is integration with microchip ICD-2. This device is both a pro-
grammer as well as in circuit debugger. Your program can be run and tested right in the target board, as
well as stopped and you can examine its registers.
Details of this software and Microchip ICD-2 can be found at microchip site.
Working with MPLAB®
Teach Yourself PIC Microcontrollers | www.electronicspk.com | 145
P
rogramming a microcontroller
needs a hardware device, called programmer. All programmers
have the same basic functionality, that they accept a program (.hex) file from your PC and trans-
fers it to the program memory of microcontroller. The number of commercial designs vary in
speed,
availability of serial port, parallel port or USB and the supported devices. You have been
using our simple, yet fully functional programmer PIC-PG-II. We also introduced you another useful de-
vice, ICD-2 which operates under Microchip MPLAB software and not only program the MPLAB sup-
ported devices but also helpful in source level debugging of the project, right in circuit.
Microchip has
introduced another technology, which has simplified the task of programming, as well as
upgrading the firmware within your projects. This is called Self programming. Newer PIC microcontrollers,
like 16F877 and all 18Fxxx series have this capability. If you use this technique, you do not need an exter-
nal programmer at-all. The programming is done through standard
USART serial interface, which almost
every project has.
PIC Lab-II is equipped with this software, so that you can use direct programming without the need of in-
tervening programmer. This does not mean you should not have the programmer at hand! It still has useful
functions.
Chia sẻ với bạn bè của bạn: