So far you had a tour of the PIC Lab-II anatomy. Now you know what devices are there on board, and where their connectors are located. Now we come to the second part of hardware device to start with. This device is called Programmer.
Programmer is a device, or piece of hardware which will accept the compiled program from your computer and write it into the program memory of your microcontroller. Since this memory is flash based, once the microcontroller is programmed, you do not need the programmer. Whenever you will turn the power on, the program in microcontroller memory will start. However whenever you make changes to the software, the newly compiled program has to be written back into the microcontroller. You will again need the programmer device to do so.
There are hundreds of programming devices available, in market. Each having its own merits and de-merits. One of the most popular device is one from Microchip® itself. A number of commercial third party devices are also available in market. All these devices differ in the list of supported devices. A few designs are available for students which make use of very few components yet do the job. Price therefore is another factor in choosing a Programmer. We shall introduce you various programming devices available from Microtronics® Pakistan for use with PIC Lab-II. This list is by no means final, and for the latest devices do visit the web site, www.electronicspk.com.
PIC PG-I
PIC programmer-I is the simplest programmer possible. This programmer is connected to the serial port of your computer and the microcontroller to be programmed is inserted into the ZIF sockets. After programming the microcontroller is taken out and inserted into the application board to run the program.
The programmer has sockets for both 18 pin as well as 40 pin PIC microcontrollers.
It does not require external power supply, and programs most of the commonly used microcontrollers.
Since this programmer takes its power supply from the PC
serial port, some PCs, specially Laptops do not have enough power available on serial port and therefore it can not be used with Laptop computers. Secondly since it does not support In circuit Programming, you will have to remove the microcontroller every time from your host
board, program it and re-insert back. Although a boring job, yet its good for a beginner for the price its offered. Moreover its general purpose, and can be used to program your chips for use in other projects. This design does not support 18F series of devices.
PIC PG-II
PIC-PG-II is the next version of PIC-PG-I programmer. It supports In-circuit serial programming. Moreover it can also program the 18F series of microcontrollers. However since this programmer also takes its power supply from host PC serial port,
it does not work with laptop computers. Considering the simple design, low cost and In-Circuit programming capabilities this programmer is recommended for beginners with PIC-Lab-II. In order to program ex-circuit PIC microcontrollers you will need an adapter board for use with this programmer.
Anyway in order to use with PIC-Lab-II you just need this programmer and adapter board is not necessary.
PIC 16 QL-2006 Programmer
This is a professional quality commercial programmer. This programmer supports a wide range of PIC microcontrollers. The ZIF socket allows all types of 8, 12, 18, 28 and 40 pin PIC microcontrollers to be inserted and programmed as ex-circuit.
However the programmer also has In-Circuit programming option, a cable is connected to the standard ICSP connector and it works as ICSP as well.
The programmer has its own power supply, which makes it work with laptops as well.
This programmer has dual input, and can work with Serial port as well as USB ports. When connected to USB, it can even take supply from USB.
This programmer is recommended for more serious developers.
It can be directly connected to PIC Lab-II ICSP connector.
Microchip In-Circuit Programmer / Debugger –2
Microchip® the manufacturer of PIC microcontrollers have produced their ICD-2. This device can be connected to serial as well as USB ports and can program a huge range of microcontrollers, in circuit. Not only that it can program, but it can also debug the software running inside the microcontroller. The device is controlled from microchip software MPLAB©. From the MPLAB you can stop the program, step over, step into, animate and halt the software. You can then examine the status of various registers and program variables.
This device is invaluable for experienced programmers and developers making complex software. Debugging a complex software is not an easy job!
Microtronics ICD-2 Clone
ICD-2 is a product from Microchip®, its expansive and not easily available in local markets. Considering the usage and beneficial features of ICD-2 Microtronics Pakistan® produced their own ICD-2 Clone. This ICD-2 works from serial port and has 100% compatibility with Microchip® ICD-2. Available in a price much less than the original, and availability in local market, makes this a programmer/
debugger of choice for the professional.
Well now you have a choice of a number of programmers, all of these will work, however to start with we suggest using PIC-PG2 programmer, and later thinking of upgrading to Microtronics ICD-2 clone.
Microchip® Self-Programming System
Microchip has introduced recently a new technology in its newer microcontrollers. This capability allows these microcontrollers to acquire the new program through its serial port connection, right in-circuit. This feature does not require any external programmer, and is quite fast and reliable. However this feature requires to load a piece of software called ‘Boot-Loader’ into the microcontroller using a conventional programmer. Once the Boot-loader is there, it can take new programs, using serial port, and write them into the program memory. The Boot-loader itself remains unaffected by new program.
A number of companies, including Microchip® are providing Boot-Loader software. PIC lab-II comes with a Boot-Loader program as well, and in this manual we shall learn, how to use both conventional programming, use ICD-2 and Boot-loader.
As you can see there are number of methods to program the microcontroller. Remember, if many solutions exist for a given job, each has merits and de-merits. There are advantages and disadvantages of all these methods, so you must be prepared to choose the right one for a given situation.
For now we will be using PIC-PG-II programmer, connected to the PIC Lab-II board. In order to work, we have to install the necessary supporting software, which will communicate between the PC and PIC-PG-II programmer.