Contacts

Do-it-yourself pic programmers. Homemade programmer for PIC controllers. Features of practical use

One day I decided to assemble a simple LC meter for pic16f628a and naturally it had to be flashed with something. I used to have a computer with a physical COM port, but now I only have USB and a pci-lpt-2com board. To begin with, I assembled a simple JDM programmer, but as it turned out, it did not want to work with either the pci-lpt-com board or the usb-com adapter (low voltage of RS-232 signals). Then I rushed to look for usb pic programmers, but there, as it turned out, everything was limited to the use of expensive pic18f2550/4550, which I naturally didn’t have, and it’s a pity to use such expensive MKs if I very rarely do anything at peaks (I prefer av- Yes, flashing them is not a problem, they are much cheaper, and it seems to me that it is easier to write programs on them). After delving for a long time on the Internet in one of the many articles about the EXTRA-PIC programmer and its various variants, one of the authors wrote that extrapic works with any com ports and even a usb-com adapter.

The circuit of this programmer uses a max232 logic level converter.

I thought if I use usb adapter, then it will be very stupid to convert the levels of usb to usart TTL, TTL to RS232, RS232 back to TTL twice, if you can just take the TTL signals of the RS232 port from the usb-usart converter chip.

So I did. I took the CH340G chip (which has all 8 com port signals) and connected it instead of max232. And this is what happened.

In my circuit there is a jumper jp1, which is not in the extra peak, I installed it because I didn’t know how the TX output would behave at the TTL level, so I made it possible to invert it on the remaining free NAND element and, as it turned out, it was right there is a logical one at the TX pin, and therefore there is 12 volts at the VPP pin when turned on, but nothing will happen during programming (although you can invert TX in software).

After assembling the board, it was time for testing. And here came the main disappointment. The programmer was identified immediately (with the ic-prog program) and started working, but very slowly! In principle - as expected. Then in the com port settings I set the maximum speed (128 kilobaud) and began testing all the found programs for JDM. As a result, PicPgm turned out to be the fastest. My pic16f628a was fully flashed (hex, eeprom and config) plus verification for about 4-6 minutes (reading is slower than writing). IcProg also works, but slower. There were no programming errors. I also tried to flash eeprom 24c08, the result is the same - everything sews, but very slowly.

Conclusions: the programmer is quite simple, it does not contain expensive parts (CH340 - 0.3-0.5 $, k1533la3 can generally be found among radio junk), works on any computer, laptop (and you can even use tablets on Windows 8/10). Cons: it is very slow. It also requires external power for the VPP signal. As a result, it seemed to me that for infrequent flashing of peaks, this is an easy to repeat and inexpensive option for those who do not have an ancient computer with the necessary ports at hand.

Here is a photo of the finished device:

As the song says, “I made him out of what was.” The set of parts is very diverse: both SMD and DIP.

For those who dare to repeat the scheme, as usb-uart converter Almost any will do (ft232, pl2303, cp2101, etc.), instead of k1533la3 the k555 will do, I think even the k155 series or the foreign analogue 74als00, perhaps it will even work with logical NOT elements like k1533ln1. I am attaching my own printed circuit board, but anyone can redraw the wiring there for the elements that were available.

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
IC1 ChipCH340G1 To notepad
IC2 ChipK1533LA31 To notepad
VR1 Linear regulator

LM7812

1 To notepad
VR2 Linear regulator

LM7805

1 To notepad
VT1 Bipolar transistor

KT502E

1 To notepad
VT2 Bipolar transistor

KT3102E

1 To notepad
VD1-VD3 Rectifier diode

1N4148

2 To notepad
C1, C2, C5-C7 Capacitor100 nF5 To notepad
C3, C4 Capacitor22 pF2 To notepad
HL1-HL4 Light-emitting diodeAny4 To notepad
R1, R3, R4 Resistor

1 kOhm

3

Circuits using microcontrollers are gaining quite a lot of popularity on the Internet. A microcontroller is a special chip that, in essence, is a small computer with its own input/output ports and memory. Thanks to the microcontroller, you can create very functional circuits with a minimum of passive components, for example, Digital Watch, players, various LED effects, automation devices.

In order for the microcircuit to begin performing any functions, it needs to be flashed, i.e. load the firmware code into its memory. This can be done using a special device called a programmer. The programmer connects the computer on which the firmware file is located with the microcontroller being flashed. It is worth mentioning that there are microcontrollers of the AVR family, for example, Atmega8, Attiny13, and pic series, for example PIC12F675, PIC16F676. The Pic series belongs to Microchip, and the AVR series belongs to Atmel, so the firmware methods for PIC and AVR are different. In this article we will look at the process of creating an Extra-pic programmer, with which you can flash a pic series microcontroller.
The advantages of this particular programmer include the simplicity of its circuitry, reliability of operation, and versatility, because it supports all common microcontrollers. The computer is also supported by the most common firmware programs, such as Ic-prog, WinPic800, PonyProg, PICPgm.

Programmer circuit


It contains two microcircuits, the imported MAX232 and the domestic KR1533LA3, which can be replaced with the KR155LA3. Two transistors, KT502, which can be replaced with KT345, KT3107 or any other low-power PNP transistor. KT3102 can also be changed, for example, to BC457, KT315. The green LED serves as an indicator of power availability, the red LED lights up during the microcontroller firmware process. The 1N4007 diode is used to protect the circuit from the supply of voltage of incorrect polarity.

Materials


List of parts required to assemble the programmer:
  • Stabilizer 78L05 – 2 pcs.
  • Stabilizer 78L12 – 1 pc.
  • LED 3 V. green – 1 pc.
  • LED 3 V. red – 1 pc.
  • Diode 1N4007 – 1 pc.
  • Diode 1N4148 – 2 pcs.
  • Resistor 0.125 W 4.7 kOhm – 2 pcs.
  • Resistor 0.125 W 1 kOhm – 6 pcs.
  • Capacitor 10 uF 16V – 4 pcs.
  • Capacitor 220 uF 25V – 1 pc.
  • Capacitor 100 nF – 3 pcs.
  • Transistor KT3102 – 1 pc.
  • Transistor KT502 – 1 pc.
  • Chip MAX232 – 1 pc.
  • Chip KR1533LA3 – 1 pc.
  • Power connector – 1 pc.
  • Female COM port connector - 1 pc.
  • DIP40 socket – 1 pc.
  • DIP8 socket – 2 pcs.
  • DIP14 socket – 1 pc.
  • DIP16 socket – 1 pc.
  • DIP18 socket – 1 pc.
  • DIP28 socket – 1 pc.
In addition, you need a soldering iron and the ability to use it.

PCB manufacturing

The programmer is going to printed circuit board dimensions 100x70 mm. The printed circuit board is made using the LUT method, the file is attached to the article. There is no need to mirror the image before printing.


Download the board:

(downloads: 639)

Programmer assembly

First of all, jumpers are soldered onto the printed circuit board, then resistors, diodes. Lastly, you need to solder the sockets and power connectors and COM port.



Because There are a lot of sockets on the printed circuit board for flashed microcontrollers, but not all of their pins are used; you can use this trick and remove unused contacts from the sockets. At the same time, less time will be spent on soldering and inserting a microcircuit into such a socket will be much easier.


The COM port connector (called DB-9) has two pins that must be “stuck” into the board. In order not to drill extra holes on the board for them, you can unscrew the two screws under the sides of the connector, and the pins will fall off, as will the metal edging of the connector.


After soldering all the parts, the board must be washed from flux, and the adjacent contacts must be ringed to see if there are any short circuits. Make sure that there are no microcircuits in the sockets (you need to remove both MAX232 and KR1533LA3), connect the power. Check if there is a voltage of 5 volts at the outputs of the stabilizers. If everything is fine, you can install the MAX232 and KR1533LA3 microcircuits, the programmer is ready for use. The supply voltage of the circuit is 15-24 volts.



The programmer board contains 4 sockets for microcontrollers and one for flashing memory chips. Before installing the microcontroller to be flashed on the board, you need to check whether its pinout matches the pinout on the programmer board. The programmer can be connected to the computer's COM port directly or via an extension cable. Happy build!

So, the time has come to study microcontrollers, and then program them, and I also wanted to assemble devices on them, the circuits of which are now on the Internet in abundance. Well, we found a diagram, bought a controller, downloaded the firmware... and what should we use to flash it with??? And here a radio amateur who begins to master microcontrollers is faced with the question of choosing a programmer! I would like to find the best option in terms of versatility - simplicity of circuit - reliability. “Branded” programmers and their analogues were immediately excluded due to the rather complex circuit, which includes the same microcontrollers that need to be programmed. That is, it turns out to be a “vicious circle”: in order to make a programmer, you need a programmer. So the search and experiments began! In the beginning, the choice fell on PIC JDM. This programmer works from the com port and is powered from there. This option was tested, confidently programmed 4 out of 10 controllers, with a separate power supply the situation improved, but not much; on some computers it refused to do anything at all, and it does not provide protection from the “fool”. Next, the Pony-Prog programmer was studied. In principle, almost the same as JDM. The “Pony-prog” programmer is very simple diagram, powered from the computer's com port, and therefore, on forums and on the Internet, questions about failures when programming a particular microcontroller very often appear. As a result, the choice was made on the “Extra-PIC” model. I looked at the diagram - very simple, competent! At the input there is a MAX 232 converting signals serial port RS-232 into signals suitable for use in digital circuits with TTL or CMOS levels does not overload the computer's COM port, since it uses the RS232 operating standard and does not pose a danger to the COM port. Here is the first plus!
Works with any COM ports, both standard (±12v; ±10v) and non-standard COM ports of some models of modern laptops that have reduced signal line voltages, up to ±5v - another plus! Supported by popular programs IC-PROG, PonyProg, WinPic 800 (WinPic800) and others - the third plus!
And it’s all powered by its own power source!
It was decided - we need to collect! So in the magazine Radio 2007 No. 8 a modified version of this programmer was found. It allowed programming microcontrollers in two modes.
There are two known ways to put PICmicro microcontrollers into programming mode:
1.With the supply voltage Vcc turned on, raise the voltage Vpp (at the -MCLR pin) from zero to 12V
2.With the Vcc voltage off, raise the Vpp voltage from zero to 12V, then turn on the Vcc voltage
The first mode is mainly for devices of early development; it imposes restrictions on the configuration of the -MCLR pin, which in this case can only serve as an input for the initial installation signal, and many microcontrollers provide the ability to turn this pin into a regular line of one of the ports. This is another plus of this programmer. Its diagram is shown below:

Larger
Everything was assembled on a breadboard and tested. Everything works perfectly and reliably, no glitches were noticed!
A signet was drawn for this programmer.
depositfiles.com/files/mk49uejin
everything was assembled into an open case, the photo of which is below.




The connecting cable was made independently from a piece of eight-core cable and standard Komov connectors, no null modems will work here, I warn you right away! You should be careful when assembling the cable; you will immediately get rid of headaches in the future. The cable length should be no more than one and a half meters.
Cable photo


So, the programmer is assembled, the cable is also assembled, it’s time to check all this equipment for functionality, look for glitches and errors.
First of all, we install the IC-prog program, which can be downloaded from the developer’s website www.ic-prog.com. Unpack the program into a separate directory. The resulting directory should contain three files:
icprog.exe - programmer shell file.
icprog.sys - driver required to work under Windows NT, 2000, XP. This file must always be located in the program directory.
icprog.chm - Help file.
Installed, now we need to configure it.
For this:
1.(Windows XP only): Right click on the icprog.exe file. “Properties” >> “Compatibility” tab >> Check the box for “Run this program in compatibility mode for:” >> select “Windows 2000”.
2.Run the icprog.exe file. Select “Settings” >> “Options” >> “Language” tab >> set the language to “Russian” and click “Ok”.
Agree with the statement “You need to restart IC-Prog now” (click “Ok”). The programmer shell will restart.
Settings" >> "Programmer

1.Check the settings, select the COM port you are using, click “Ok”.
2.Next, “Settings” >> “Options” >> select the “General” tab >> check the “On” item. NT/2000/XP driver" >> Click "Ok" >> if the driver has not been installed on your system before, click "Ok" in the "Confirm" window that appears. The driver will be installed and the programmer shell will restart.
Note:
For very “fast” computers, you may need to increase the “I/O Latency” parameter. Increasing this parameter increases the reliability of programming; however, the time spent on programming the chip also increases.
3. “Settings” >> “Options” >> select the “I2C” tab >> check the boxes: “Enable MCLR as VCC” and “Enable block recording.” Click “Ok”.
4. “Settings” >> “Options” >> select the “Programming” tab >> uncheck the item: “Check after programming” and check the box “Check during programming”. Click "Ok".
So it's set up!
Now we should test the programmer in a place with IC-prog. And here everything is simple:
Next, in the IC-PROG program, in the menu, run: Settings >> Programmer Test

Before performing each point of the testing methodology, do not forget to set all “fields” in initial position(all “checkboxes” are unchecked), as shown in the figure above.
1.Tick the “On” field. Data Output", in this case, a “checkmark” should appear in the “Data Input” field, and the log level should be set on the (DATA) contact of connector X2. “1” (at least +3.0 volts). Now, close the contact (DATA) and the contact (GND) of connector X2 with each other, and the mark in the “Data Input” field should disappear while the contacts are closed.
2.When checking the “On” field Clocking", on the (CLOCK) pin of connector X2, the log level should be set. "1". (at least +3.0 volts).
3.When checking the “On” field Reset (MCLR)", on the contact (VPP) of connector X3, the level should be set to +13.0 ... +14.0 volts, and the D4 LED (usually red) should light up. If the mode switch is set to position 1, the HL3 LED will light up
If during testing, any signal does not pass through, you should carefully check the entire path of this signal, including the connection cable to the computer’s COM port.
Testing the data channel of the EXTRAPIC programmer:
1. Pin 13 of the DA1 chip: voltage from -5 to -12 volts. When checking the box: from +5 to +12 volts.
2. Pin 12 of the Da1 chip: voltage +5 volts. When checking the box: 0 volts.
3. Pin 6 of the DD1 chip: voltage 0 volts. When checking the box: +5 volts.
3. 1 and 2 pins of the DD1 microcircuit: voltage 0 volts. When checking the box: +5 volts.
4. Pin 3 of the DD1 chip: voltage +5 volts. When checking the box: 0 volts.
5. Pin 14 of the DA1 chip: voltage from -5 to -12 volts. When checking the box: from +5 to +12 volts.
If all testing was successful, the programmer is ready for use.
To connect the microcontroller to the programmer, you can use suitable sockets or make an adapter based on a ZIF socket (with zero pressing force), for example, like here radiokot.ru/circuit/digital/pcmod/18/.
Now a few words about ICSP - In-Circuit Programming
PIC controllers.
When using ICSP on the device board, it is necessary to provide the ability to connect a programmer. When programming using ICSP, 5 signal lines must be connected to the programmer:
1. GND (VSS) - common wire.
2. VDD (VCC) - plus supply voltage
3. MCLR" (VPP) - microcontroller reset input / programming voltage input
4. RB7 (DATA) - bidirectional data bus in programming mode
5. RB6 (CLOCK) Synchronization input in programming mode
The remaining microcontroller pins are not used in in-circuit programming mode.
Option for connecting ICSP to PIC16F84 microcontroller in DIP18 package:

1. "MCLR line" is decoupled from the device circuit by jumper J2, which opens in the in-circuit programming (ICSP) mode, transferring the MCLR pin to exclusive control of the programmer.
2. The VDD line in ICSP programming mode is disconnected from the device circuit by jumper J1. This is necessary to avoid current consumption from the VDD line by the device circuit.
3.Line RB7 (bidirectional data bus in programming mode) is isolated in terms of current from the device circuit by resistor R1 with a nominal value of at least 1 kOhm. In this regard, the maximum inflow/outflow current provided by this line will be limited by resistor R1. If it is necessary to ensure maximum current, resistor R1 must be replaced (as in the case of VDD) with a jumper.
4. Line RB6 (PIC synchronization input in programming mode), like RB7, is isolated in terms of current from the device circuit by resistor R2, rated at least 1 kOhm. In this regard, the maximum inflow/drainage current provided by this line will be limited by resistor R2. If it is necessary to ensure maximum current, resistor R2 must be replaced (as in the case of VDD) with a jumper.
ICSP pin locations for PIC controllers:


This diagram is for reference only, it is better to check the programming conclusions from the microcontroller datasheet.
Now let's look at the microcontroller firmware in the IC-prog program. We will look at the example of the design from here rgb73.mylivepage.ru/wiki/1952/579
Here is the device diagram


here is the firmware
We are flashing the PIC12F629 controller. This microcontroller uses the osccal constant for its operation - it is a hexadecimal calibration value of the internal MC generator, with the help of which the MC reports the time when executing its programs, which is written in the last peak data cell. We connect this microcontroller to the programmer.
The screenshot below shows in red numbers the sequence of actions in the IC-prog program.


1. Select the type of microcontroller
2. Press the “Read microcircuit” button
In the “Program Code” window, in the very last cell there will be our constant for of this controller. Each controller has its own constant ! Don't erase it, write it down on a piece of paper and stick it on the microcircuit!
Let's move on


3. Click the “Open file...” button and select our firmware. The firmware code will appear in the program code window.
4. We go down to the end of the code, right-click on the last cell and select “edit area” in the menu, enter the value of the constant that you wrote down in the “Hexadecimal” field, and click “OK”.
5. Click “program microcircuit”.
The programming process will begin; if everything was successful, the program will display a corresponding notification.
We take the chip out of the programmer and insert it into the assembled breadboard. Turn on the power. Press the start button. Hurray it works! Here is a video of the flasher working
video.mail.ru/mail/vanek_rabota/_myvideo/1.html
That's sorted out. But what should we do if we have a source code file in asm assembler, but we need a hex firmware file? A compiler is needed here. and it exists - this is Mplab, in this program you can both write firmware and compile it. Here is the compiler window


Installing Mplab
We find the MPASMWIN.exe program in the installed Mplab, usually located in the folder - Microchip - MPASM Suite - MPASMWIN.exe
Let's launch it. In the (4) Browse window we find our source code (1).asm, in the (5) Processor window we select our microcontroller, click Assemble and in the same folder where you specified the source code your firmware will appear.HEX That's all ready!
I hope this article will help beginners in mastering PIC controllers! Good luck!

It just so happened that I began my acquaintance with microcontrollers with AVR. For the time being, I avoided PIC microcontrollers. But, nevertheless, they also have unique designs that are interesting to repeat! But these microcontrollers also need to be flashed. I am writing this article mainly for myself. In order not to forget technology, how to flash a PIC microcontroller without problems and waste of time.

How to program PIC microcontrollers or Simple JDM programmer

For the first circuit - I tried long and hard to make a PIC programmer using circuits found on the Internet - nothing came of it. It's a shame, but I had to turn to a friend to flash the MK. But it’s not a good idea to constantly run around with friends! This same friend recommended a simple circuit that works from a COM port. But even when I assembled it, nothing worked. After all, it’s not enough to assemble the programmer - you also need to customize the program for it, which we will use to flash it. But that’s exactly what I couldn’t do. There are a whole bunch of instructions on the Internet, and few of them helped me...

Then, I managed to flash one microcontroller. But since I was doing the stitching under severe time pressure, I didn’t think to save at least a link to the instructions. And I didn’t find her afterwards. Therefore, I repeat - I am writing an article to have my own instructions.

So, a programmer for PIC microcontrollers. Simple, although not 5 wires like the AVR microcontrollers I still use. Here's the diagram:

Here is the printed circuit board ().

The COM connector is soldered with pins directly onto the contact pads (the main thing is not to get confused with the numbering). The second row of pins is connected to the board with small jumpers (I said it very unclearly, yeah). I’ll try to give you a photo... even though it’s scary (I don’t have a normal camera right now).
The worst thing is that PIC microcontrollers require 12 volts for firmware. And it’s better not 12, but a little more. Let's say 13. Or 13.5 (by the way, experts - correct me in the comments if I'm wrong. Please.). 12 volts can still be obtained somewhere. Where is 13? I simply got out of the situation - I took a freshly charged lithium-polymer battery, which had 12.6 volts. Well, or even a four-cell battery, with its 16 volts (I flashed one PIC like this - no problem).

But I got distracted again. So - instructions for flashing PIC microcontrollers. We are looking for the WinPIC800 program (unfortunately, the simple and popular icprog did not work for me) and setting it up as shown in the screenshot.

After that, open the firmware file, connect the microcontroller and flash it.

USB PIC controller programmer - 3.8 out of 5 based on 11 votes

Photos of the programmer provided by Ansagan Khasenov

This article discusses the practical aspects of assembling a simple USB programmer for PIC microcontrollers, which has the original name GTP-USB (Grabador TodoPic-USB). There is an older model of this GTP-USB plus programmer that supports and AVR microcontrollers, but is offered for money. Unambiguous information on the circuits and firmware for GTP-USB plus could not be found. If you have information on GTP-USB plus, please contact me.

So, GTP-USB. This programmer is assembled on a PIC18F2550 microcontroller. GTP-USB cannot be recommended for beginners, because... assembly requires flashing the PIC18F2550 and requires a programmer for this. A vicious circle, but not so vicious that it becomes an obstacle to assembly.

Indication elements are excluded from the original GTP-USB circuit to simplify the printed circuit board design. The main indicator is the monitor of your computer, on which you can monitor the programming process from the WinPic800 version 3.55G or 3.55B program.

Lightweight GTP-USB circuit.

Signal lines Vpp1 and Vpp2 are defined for microcontrollers in packages with varying amounts conclusions. The Vpp/ICSP line is defined for in-circuit programming. The rest of the lines are standard.

The programmer is assembled on a single-sided printed circuit board.

The adapter can be painlessly connected to any other PIC microcontroller programmer, which is certainly convenient.

After assembly, we turn it on for the first time. When GTP-USB is connected to the PC for the first time, a message appears

This is followed by the traditional driver installation prompt. The driver is located in the WinPic800 control program at the approximate path \WinPic800 3.55G\GTP-USB\Driver GTP-USB\.


We agree with the warnings and continue the installation.

Paying attention. This scheme The programmer and its firmware have been tested in practice and work with the WinPic800 control program versions 3.55G and 3.55B. Older versions, for example 3.63C, do not work with this programmer. Making the settings control program: in the Settings - Hardware menu, select GTP-USB-#0 or GTP-USB-#F1 and click Apply.

Click on the button on the panel and test the equipment. As a result of successful testing, a message appears (see below), which makes us happy.

This programmer worked perfectly with the following controllers (from what was available): PIC12F675, PIC16F84A, PIC16F628A, PIC16F874A, PIC16F876A, PIC18F252. Test of controllers, writing and reading data - completed successfully. The speed of work is impressive. Reading 1-2 sec. Recording 3-5 sec. No glitches were noticed. Some of the hardwired MKs have been tested in hardware - they work.


Did you like the article? Share it