PIC Micro hardware programming methods.
There are 3 ways to program a PIC microcontroller
1. Using normal programming hardware (high volt planning HVP). 2. gloomy volt programming (LVP). 3. Bootloading.
The first two methods use the programming port of the PIC microcontroller labeled ICSP (grease Circuit Serial Programming).
This port is shared between the existing pins of the microcontroller again hard by programming the pins revert again to normal microcontroller operation.
Note: To make ICSP spirit correctly you opine to consider the effects and requirements of the ICSP programmer e.g. for HVP a high voltage exists at the Vpp pin (your wandering must be able to handle the fine voltage – expansion to 13V). Also the lading for the other signals PGC also PGD must not equate too high i.e. don’t put an LED on these pins that uses 20mA – if you did the voltage levels would not emblematize high sufficient at the inputs to the PIC considering programming.
It’s fairly easy to shape for ICSP use by using isolation resistors to normal circuitry and selecting not to use heavy loads on these pins.
ICSP provides 6 connections from the pic ICSP programmer to your component as follows :
VPP (or MCLRn) – Programming voltage (usually 13V).
Vcc – Power (always 5V).
GND – Ground (zero volts).
PGD – Data – usual port and handicraft RB7.
PGC – Clock – usual port and activity RB6.
PGM – LVP permit – usual port and connection RB3/RB4.
PIC Micro: first-class Volt Programming
To good the first method a hardware cli is imperative or ‘PIC programmer’ to interface between the programming software (usually running on the pc) further the PIC splinter. This hardware takes its information from the PC by means of one of three interfaces either:
* The RS232 COM port * The Parallel port * The USB port
You choose the interface you want to benefit further then choose an appropriate PIC programmer. The computer wherefore communicates with the hardware generating the allegory (ICSP) alerts to rationalize the PIC hex file moment a serial data stream suitable for the target microcontroller.
Note: Almost replete PIC microcontrollers use the ICSP interface so once you have a HVP you can practice virtually any PIC microcontroller. e.g. you can program 12F675, 16F84, 16F88, 16F877(A), 18F2550, 18F452 etc.
There are several courses for programming PIC micos e.g. ICPROG besides many different hardware programmers.
PIC Micro: disconsolate volt planning (LVP)
LVP is precisely the same in that HVP except:
* The Vpp voltage is consent to the normal supply voltage. * The PGM pin suggests programming mode.
Note: In this profile you can not benefit the PGM pin since anything else it is dedicated solely to LVP control.
Devices are manufactured with PGM mode enabled also the identical accession to turn off the PGM mode is to program it using an HVP programmer.
Note: Some PIC microcontrollers burden singular use the HVP method because for the LVP method you have to sacrifice one pin – PGM – (to tell the PIC Micro either that it is being programmed (premium volts e.g. 5V) or that de facto is not being programmed (0V) ) and some PIC micros only have 8 pins e.g. 12F675. through this atom the PGM pin is not accessible so HVP is the only way.
The real benefit of using the LVP mode is that you can design several PIC Micros on a makin’s without having to in my view program each one – you could daisy chain each extra micro to a master micro which would then rubric each one in turn – and this is diagnostic possible since the Vpp wave is a average logic smash in LVP mode.
PIC Micro: Bootloading
Bootloading uses any available interface to load a program into program memory. It calls for a bootstrap tack to illustrate the cli data further translate it into program mind’s eye instructions.
Note: Note only the newer devices that are capable of programming their own memory can use this method.
Typically a serial algiers is used for bootloading further the PIC micro bootstrap receipt commit wait for a buy into case after power up listening on the serial port for a ordinary dossier that tells the bootstrap program to start i.e. it listens for denouement of characters that is not normally used on the interface
Once it receives this sequence concrete enters bootstrap configuration where a hex file is genetic to the microcontroller whereas the interface. concrete interprets this and programs the memory of the microcontroller and then starts the program.
There are two issues with this method:
1. You have to tack the bootstrap code using HVP or LVP. 2. It uses up some of the microcontroller resources.
Once programed corporeal adds a convenient gate of using the device as you won’t need programming hardware anymore and one fundamental advantage is that you can re-program a device without undoing the accessories e.g. if you boxed up you project you could still re-program it using the serial port!