Introduction: DIY- UNIVERSAL PIC AND AVR PROGRAMMER
I am presenting a best class USB Universal Programmer for both PIC and AVR Microcontrollers. In our present market the universal programmer supporting much devices with combination of PIC and AVR are not in common, they are expensive also.
This programmer is very cheap which is less than ₹500(10$). It is made with easily available components. This gives an advantage to the students and hobbyists for their projects. I am dedicating this purely DIY project to all students, electronic hobbyists and enthusiasts.
- It is free and open source.
- No need of installing extra drivers, it uses the HID (Human Interface Device) driver which is used to keyboard and mouse.
- Supports much devices of PIC and AVR.
- No external power is needed.
- It supports both Windows and Linux platforms. In windows the software is OpenProg and in Linux, it is Opengui.
Step 1: Supported Devices:
It supports both 5V and 3.3V devices.( Check the “support device list” in attachment for the details of supported devices)
- PIC Devices :
PIC 10-12-16-18-24, dsPIC 30-33
3.3V devices : PIC12F1xxx, 16F1xxx,18FxxJxx, 18FxxKxx, 24Fxxxx, 24Hxxx, dsPIC33xxx.
- AVR Device :
It supports serial and HV serial programming.
AT90Sxxxx, ATmega- 48, 8, 88, 8515, 8535, 16, 164, 168, 32, 324, 328, 64, 644, 1284.
ATtiny- 11, 12, 13, 313, 24, 25, 26, 261, 4313, 44, 45, 461, 48, 84, 85, 88, 861.
- EEPROM Device :
24xxxx, 25xxx, 93xx6, DS24xx, 11xxx.
Step 2: Controller Part:
It is the major part of the programmer. It consist of PIC18F2550 microcontroller as the brain of programmer. The USB-B connector is attached which communicates through PC. It consist of two indicator LED’s, one for the indicating in programmer connection other shows the programming status.
The major three series set (J1, J2, and J3) headers are used for the communication with the slave microcontroller device. The usage of pins are different in different microcontrollers. A reset switch is added to the controller unit to set the reset of programmer. The PIC18F2550 is flashed with the firmware hex code attached below. You can use other serial or parallel PIC programmers for programming it..
Step 3: HID (Human Interfacing Device) Detecting :
It is not a mandatory step.
If you are not using my PCB or using the Breadboard/Perf board/custom PCB. It verify the communication between the microcontroller and the PC. It is better to do the (Human Interface Device) HID detect testing which will rectify much errors such as microcontroller, crystal and USB problems.
- Connect the circuit as per the fig 2.
- Connect the USB with PC.
- Check the blinking of LED1 is flashing firstly at first and then it slows the blink.
- If the programmer is detected go to next step. If the programmer is not detected cross check the connections and the instructions.
- Open the OpenProg.exe and check the device connected.
Step 4: Full Circuit - Controller Part
- Connect the components as per the Fig 3 and Connect the USB connector with PC.
- Open the OpenProg and check the programmer is detected.
- Click options-->hardware test. Hardware test is used to test whether the programmer is working properly. It checks the whole programming pins and we can debug easily in the error area. The hardware test shows the voltage across the VDDU, VPPU, CLK, DATA, PGM in different instants.
Measure the voltage between the pins VDDU, VPPU, CLK, DATA, PGM and check it with the values in the screen. VPP can be a 1V difference because of DC to DC conversion.
If the voltage of these pins of controller part and what is displayed in the screen are similar the programmer is working perfectly. If the voltage is different check the circuit of respective pins.
Step 5: PCB Design:
(Don’t confuse with the name in PCB design as “PIC PROGRAMMER”, I put this name first)
The Fig 4 shows the PCB design of controller part. The PCB is designed in Eagle 7.2. The board size is 7.5 X 7 cm. I etched in an automated mechanical etching machine, which gives much quality and faster etching. The PCB can also be make with homemade chemical etching, google it for more details.
The components JA, JB, JC, are jumpers. Carefully check it and put the jumpers firstly during the assembly of components. Use a 28-pin IC base for the safety of PIC18F2550 during soldering. The PCB files are attached below.
Step 6: Expansion Board
Expansion board interfaces the programmer with the microcontroller. The different series of microcontroller is having different pin and configuration for programming. It gives the advantage of easy to program the microcontroller to the user.
Expansion board can be easily made using the perf board or in breadboard, because it is very simple circuit. I made the expansion board using perf board. For different series of microcontrollers, different expansion board is used. In 3.3V expansion (LVICP) board a 5V to 3.3V,a voltage regulator such as LM1117 or similar is need.
Fig 5 and Fig 6 shows the expansion boards and circuit diagram for different series of microcontrollers. (A clear circuit diagram is provided in the attachment.)
Note: A 3.3V device should only be programmed using 3.3V expansion board, otherwise a permanent damage may occur.
3.3V device are: PIC12F1xxx, 16F1xxx, 18FxxJxx, 18FxxKxx, 24Fxxxx, 24Hxxx, dsPIC33xxx.
In which some of them is having 5V variant. If you need to program at 5V you can select the option “Don’t require LV boards”. Also don’t put any 24F-33F in the 30F socket which works at 5V.
Step 7: DsPIC30Fxxxx Expansion Board
Here I am displaying the dsPIC30Fxxxx expansion board as an example :
I made this expansion board in Perf board which is cheap and best. I also added ZIF socket so that the microcontroller can easily attached to the expansion board, instead of ZIF socket you can also add IC base or female headers.
The circuit diagram of this expansion is at fig 7. This expansion is using only the J1 for the programming. The pins using are VDDU, VPPU, CLK, DATA, GND. The PGM pin is not used.
Step 8: Programming a Device
After making the Controller part and Expansion board, We can straight away go for the Programming the device :
- Find the device and series of the device to be programmed. Select the suitable expansion board of the device.
Attach the device to the Expansion board.
Attach the Expansion board to the controller unit.
Connect USB B connector cable to the programmer and connect to the PC.
Open the OpenProg.exe and make sure that programmer is detected.
Open devices and select the device which is to be programmed.
To Read : Press the green arrow in the top to read the device.
To Write / Flash : Press the left button on top to select the .hex code and press Ok. After it, Press the Red arrow button which is next to green arrow button to program the device.
Check the LED2 is blinking while programming. It shows the programming status.
Check the programming status in the software and confirm the Flashing is successful.
You are successfully programmed the device.
Step 9: Reference
Thankx to Albert Tom to his work to the open programmer. Also his work of developing OpenProg and OpenGui.