Wednesday, September 2, 2009

How To Program The PIC

Here are my thoughts on how to program the PIC.

There are three ways to program a PIC microcontroller

1. Using normal programming hardware (high voltage programming HVP).
2. Low Voltage Programming (LVP).
3. Boot Loading.

The first two methods use the programming port of PIC microcontrollers labeled ICSP (In Circuit Serial).

This port is shared between the existing pins after programming of microcontrollers and pin back to the normal operation of the microcontroller.

Note: To work your ICSP effects and consider the requirements of the programmer, for example ICSP HPV is a high voltage on the Vpp pin (the circuit must be capable of high voltage - 13V to handle). The burden of other signs of PGC PGD and may not be too high not to one of these pens LED 20mA - if not the tension level high enough at the entrance of the PIC for programming.

It is relatively easy to design for ICSP through the use of insulation resistance for the normal channels and not using heavy loads on these pins.

ICSP provides 6 connections from the pic ICSP programmer to the board as follows:

VPP - (o MCLRn) programming voltage (typically 13V).

Vcc - Power (usually 5V).

GND Ground (zero volts).

DGP - Data Port and connection RB7 custom.

PGC - Clock usual connection port RB6.

PGM - LVP is habit and RB3/RB4 port connection.

PIC Micro: High V programming

To use the first method of a hardware interface that is required or a PIC programmer "to the interface between the programming software (usually running on the PC) and the PIC chip. This is the hardware information from the PC via one of three of the interfaces:

* RS232 COM port
* Parallel port
* The USB port

You choose the interface you want, and then choose a suitable PIC programmer. The PC communicates with the hardware generation of the series (ICSP) signals to the PIC hex file translate into a serial data stream suitable for the target microcontroller.

Note: Almost all PIC microcontrollers using the ICSP interface, so once you have HPV can program virtually any PIC microcontroller. For example, you can program 12F675, 16F84, 16F88, 16F877 (A), 18F2550, 18F452, etc

There are several programs for programming PIC eg ICPROG monkeys and many different hardware developers.

PIC Micro: Low-voltage programming (LVP)

LVP is exactly the same as HVP except:

* The Vpp voltage is set to the normal voltage.
* The PGM pin, the programming mode.

Note: In this mode you can not use the PIN-code of the PGM for something else that is dedicated solely to LVP control.

Devices are manufactured with PGM mode enabled and the only way to PGM mode to disable the program that a developer of HPV applications.

Note: Some PIC microcontrollers can only method of HPV, used as the LVP method you must sacrifice a pin - PGM - (to tell the PIC Micro either that it is programmed (high volts eg 5V) or not programmed (0 V)) and some PIC micros have only 8 pins eg 12F675. For this chip the PGM pin is not available for HPV is the only way.

The real advantage of using the LVP mode is that you can plan several Micros PIC on a board without that each individual program - could be one extra daisy chain each master micro micro than the agenda of any one turn - and This is only possible from the Vpp signal is a normal level of logic in LVP mode.

PIC Micro: Boat Loading

Loading Boot uses any available interface to a program to load the program memory. It requires a bootstrap program interface to the data to interpret and translate into instructions of program memory.

Note: Note: only new devices that are able to program your own memory can use this method.

Normally, a serial port for boot loading and PIC microcontroller program will start waiting for a time after listening to the serial port of a reserved word that tells the boot program to start is to listen sequence of characters that normally not be used in the interface

Once you get this order, starting mode is a hex-file is passed to the microcontroller interface. He interprets this and programs the memory of the microcontroller and then starts the program.

There are two problems with this method:

1. You have to program the boot code using HVP or LVP.
2. Use one of the resources of the microcontroller.

Once programmed it offers a convenient way to use the device if it is not necessary hardware and programming an important advantage is that you can reprogram a device without the example of bodies, if you boxed project teams can still return to program the serial port!

1 comment:

  1. Registry Easy is an excellent Windows Registry Cleaner that scans your PC and safely cleans errors & invalid entries that cause system slowdowns, freezing and crashing. Registry Easy repairs registry problems to make your computer run like new again.
    Thanks for this blog..

    ReplyDelete

Bookmark and Share