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.

Advantage:

  • 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.

  1. Connect the circuit as per the fig 2.
  2. Connect the USB with PC.
  3. Check the blinking of LED1 is flashing firstly at first and then it slows the blink.
  4. If the programmer is detected go to next step. If the programmer is not detected cross check the connections and the instructions.
  5. Open the OpenProg.exe and check the device connected.

Step 4: Full Circuit - Controller Part

  1. Connect the components as per the Fig 3 and Connect the USB connector with PC.
  2. Open the OpenProg and check the programmer is detected.
  3. 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.
  4. 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.

  5. 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.

http://openprog.altervista.org/OP_eng.html

Comments

author
Asishjohney made it!(author)2016-08-06

You can try to program PIC18F2550 using arduino from this tutorial, I am not tried yet. Comment me if it is working.

https://sites.google.com/site/thehighspark/arduino-pic18f

author
jjohn1977 made it!(author)2017-01-29

Could someone please tell me what BC12 is on the circuit diagram of the controller part? Is it a choke??

author
Asishjohney made it!(author)2017-01-31

Bc12 represents a ferrite bead. U can use an inductor of 100uH.

author
JensenC made it!(author)2016-08-24

newbie here, i am always having an error with the hardware test:

USB voltage too low (VUSB<4.5V)

- checked my usb ports and got 5v
- indicated ports(including PGM, Data, Clock) on the hardware test are accurate (which is 4.5v)

please help

author
Asishjohney made it!(author)2016-08-25

Did u do step 3 which is HID detection?

What is the voltage getting at VDDU and VPPU??

author
JensenC made it!(author)2016-08-25

yes, the programmer is detected but said to be having low voltage

during hardware tests VPPU and VDDU are having a voltage that is less by 0.5V from what the hardware tests indicates

author
Asishjohney made it!(author)2016-08-26

check mainly the VPPU and VDDU transistor connections. Carefully check the BC547 and BC557 transistors and its terminals.

author
JensenC made it!(author)2016-08-25

btw, thank you for responding!

author
TechT2 made it!(author)2016-08-10

Thanks for that high quality loader

author
TalonM1 made it!(author)2016-08-04

Hi,

I know it is possible to program the PIC18F2550 to do simple tasks with an arduino, but is it possible to do the initial programming of the chip through an arduino too? Would be great if I could use my arduino and not have to buy a PIC programmer, just for the initial step.

Thanks

author
Asishjohney made it!(author)2016-08-06

Yeah, u can program the PIC18F2550 using arduino,

But I am not yet tried yet. try this tutorial : https://sites.google.com/site/thehighspark/arduino-pic18f

author
zarkani made it!(author)2016-07-04

Hi,

How to program the programmer itself for the first time? I see a firmware file in the attachment, How to upload the firmware?

Thanks,

author
Asishjohney made it!(author)2016-07-04

You need to use another programmer to flash the firmware to PIC18F2550, U can use a basic serial PIC programmer for it.

author
zarkani made it!(author)2016-07-05

Thanks,

What do you suggest? Can you put an instructable for the basic programmer?

author
Asishjohney made it!(author)2016-07-06

If ur PC is having RS232, U can make the basic programmer easily : http://www.circuitvalley.com/2011/05/microchip-pic-serial-port-
programmer.html?m=1

Otherwise, use anyother's programmer, u need to use it only one time to program the PIC18F2550.

author
JacobZ1 made it!(author)2016-07-05

if I already have to purchase or build a PIC programmer, it defeats the purpose since I use AVR all the time. great build and thanks for sharing, but not for me.

author
tallal made it!(author)2016-07-05

hi that the really easy circuit compared to others . just confused about few things

1) what is PGM for

2)is the data for PGD and clock for PGC

and can i just use the J3 for ICSP programming

author
Asishjohney made it!(author)2016-07-05

Thnkx for ur support,

1. PGM pin is used to select the type of programming in PIC : HVP(high voltage programming) and LVP(Low voltage Programming)

2. yes PGD and PGC represents data and clock. If you are programming only PIC for ICSP , J3 is used.

author
tallal made it!(author)2016-07-05

but how do i select HVP or LVP like connect it to +5v or ground ?

author
Asishjohney made it!(author)2016-07-06

In some older PIC it needs hvp and needs high voltage to enter in to programming mode. So the PGM triggers to provide VPP= 13V for hvp and VPP=5v for lvp.

author
Asishjohney made it!(author)2016-07-05

Thnkx for ur support,

1. PGM pin is used to select the type of programming in PIC : HVP(high voltage programming) and LVP(Low voltage Programming)

2. yes PGD and PGC represents data and clock. If you are programming only PIC for ICSP , J3 is used.

author
pinheadBE made it!(author)2016-07-05

Very interesting I already have a full-featured PIC programmer, but occasionnaly needs an AVR one.

This was looking promising, until..... the source code for the firmware is not provided.

I always prefer to have the source code, so in case it would need to be modified or updated.

Anyway, a very good job with all those expansions boards

author
Asishjohney made it!(author)2016-07-05

Thanku pinheadBE,

I added the firmware source code to the attachment recently, Check the attachment.

All the very best.

author
pinheadBE made it!(author)2016-07-05

Wow! That's very kind of you! Thanks a lot.

Now, I'm hooked and will probably build one very soon.

author
pinheadBE made it!(author)2016-07-05

Wow! That's very kind of you! Thanks a lot.

Now, I'm hooked and will probably build one very soon.

author
Asishjohney made it!(author)2016-07-05

Thanku pinheadBE,

I added the firmware source code to the attachment recently, Check the attachment.

All the very best.

author
tcurdt made it!(author)2016-07-04

Is there a way to get this thing working with macOS?

author
Asishjohney made it!(author)2016-07-04

You can check in :
http://www.zdnet.com/article/how-to-run-windows-applications-on-a-mac-without-installing-windows/
I think the programmer will surely work, coz it doesn't need drivers.

author
tcurdt made it!(author)2016-07-05

I was more after a native solution - but thanks!

author
timarlop made it!(author)2016-07-04

Great instructable!

This is what I needed for programming dspic and atmega, thanks.

author
Asishjohney made it!(author)2016-07-04

Thnkx.
Well try it, any clarifications comment me.

author
AXR+AMAR made it!(author)2016-07-03

Superb...!

author
Asishjohney made it!(author)2016-07-03

Thankx yaar..

author
DIY+Hacks+and+How+Tos made it!(author)2016-07-03

Nice PIC project.

author
Asishjohney made it!(author)2016-07-03

Thankx :)

About This Instructable

10,524views

128favorites

License:

Bio: Am passionate in electronics mainly embedded areas. Always been an electronic hobbyist and enthusiast.
More by Asishjohney:DIY- UNIVERSAL PIC AND AVR PROGRAMMER
Add instructable to: