Simple JDM programmer for PIC microcontrollers - Microcontroller programmers - Microcontroller device diagrams. How to program PIC microcontrollers or Simple JDM programmer Jdm programmer with external power supply


For many radio amateurs, it is not a problem to quickly assemble a circuit you like on a microcontroller. But many beginners to work with microcontrollers are faced with the question of how to program it. One of the simplest programmer options is the JDM programmer.

Program - programmer ProgCode v 1.0

This program works in WindowsXP. Allows you to program PIC controllers of the middle family (PIC16Fxxx) through the COM port of the computer. The indicator of the programmer connection (in the upper right corner of the window), if there is no programmer on the port selected in the settings, turns red. If the programmer is connected, the program detects it and the indicator in the upper right corner takes the form shown in Figure 1.

The control panel is located in the left part of the program window. This panel can be minimized by clicking on the button in the toolbar or by clicking on the left edge of the window (this is convenient when the program window is maximized to full screen).

Figure (screenshot of ProgCode v1.0 program)


If a HEX file is loaded into the program, then it is advisable to select in the list of controllers the MC for which the loaded firmware is designed for. If this is not done, then the file designed for a microcontroller with a memory larger than the one selected in the list will be cut off and parts of the program will be lost - with this option of loading the file, a warning is displayed.

If this did not happen, then you can select the desired controller after loading the file into the program.

The SFR file format

The ProgCode programmer supports working with its own file format. These files have the .sfr extension and allow you to store additional information about the program intended for the microcontroller. This file stores information about the type of microcontroller. This allows when loading an SFR file without worrying about pre-selecting the MK type in the settings.

Port and protocol settings when connecting the programmer

After installing the program - by default, all the settings are set that are necessary for the programmer to work with the JDM scheme shown on this page.
Signal inversion in the above circuit is needed only for the OutData output, since in this circuit the signal is inverted by the matching transistor. Inversion is disabled on all other pins.



The pulse delay can be equal to 0. Its adjustment is provided for "especially difficult" controllers that cannot be flashed. The same applies to the recording pause overhead - it is zero by default. If you increase the values ​​of these settings, the programming time of the controller will increase significantly.

The checkbox "check on write" must be checked if you need to check "on the fly" everything that is written to the microcontroller for correctness and compliance with the source file. If this checkbox is unchecked, the check is not performed at all and there will be no error messages, even if such errors are actually present.
Port speed selection - the speed can be any. For the JDM programmer, this parameter is irrelevant.

In WindowsXP, buffering is applied through COM ports information. These are called FIFO buffers. To avoid errors when programming with JDM, this mechanism must be disabled. This can be done in the Windows Device Manager.

We go to the control panel, then:
Administration - Computer Management - Device Manager

Then we select the port to which the JDM programmer is connected (for example COM1) - look at the properties - the port parameters tab - optional. And uncheck the box "Use FIFO buffers"

Figure - Configuring a COM port for working with a JDM programmer



After that, we restart the computer.


Local Project Browser

In addition to directly programming the controllers, the program implements a convenient browser for projects on MK, located both on local computer folders and on the Internet. This is done for the convenience of work. Often, the projects you need are in different folders, and you have to spend time getting to the right directory in order to view the project. Here it is easy to add the necessary folders to the list of folders and view any project with two or three clicks of the mouse.

When you double-click on it in the browser panel, any file will open in the program itself - this applies to pictures, html files, doc, rtf, djvu (with plugins installed), pdf, txt, asm. The file can also be opened by double-clicking in the browser using an external program installed on the computer. To do this, the extension of the required file type must be registered in the "File associations" list. If you do not specify the path to the opening program, Windows will open the file in the program by default (this is convenient for opening archives that are not always unambiguously opened). If the path to the opening program is specified in the list, the file will open in the specified program. It is convenient to view files like SPL, LAY, DSN in this way.

Figure (screenshot of ProgCode v1.0 program browser)



This is how the file associations settings window looks like:




Internet Project Browser

The browser of projects on the Internet, as well as the local browser of projects, allows you to quickly go to the desired site on the Internet with a couple of clicks, view the project and, if necessary, immediately flash the program into the MC.



When browsing projects on the Internet, if on the project page there is a link to a file with the SFR extension (this is the file format of the ProgCode program), then when you click on it, such a file will open in a new program tab and is immediately ready for flashing into the microcontroller.
The list of links can be edited using the "Edit" button. This will open a window for editing the list of links:





Description of the process of programming microcircuits

Most modern microcircuits contain flash memory that is programmed using the I2C protocol or similar protocols.
Rewritable memory is in PIC, AVR and other controllers, 24Cxx memory chips, and the like, various MMC and SD memory cards, ordinary USB flash cards that are connected to a computer via a USB connector.

Consider writing information to the flash memory of a microcontroller PIC 16 F 628 A

There are 2 lines DATA and CLOCK through which it is transmittedinformation. Line CLOCK serves to supply clock pulses, and the line DATA to transfer information.

To transfer 1 bit of information to the microcontroller, it is necessary to set 0 or 1 (depending on the value of the bit) on the data line (DATA) and create a voltage drop (transition from 1 to 0) on the clock line (CLOCK).
One bit is not enough for a controller. He waits after five more to take this 6-bit message as a command. The controller really likes commands, and they should consist of exactly 6 bits - such is the nature of the PIC 16.
Here is a list and meaning of commands that the PIC is able to understand. There are not so many commands - the vocabulary of this controller is small, but you should not think that it is completely stupid - there are devices with fewer commands

"LoadConfiguration" 000000 - Load configuration

"LoadDataForDataMemory" - 000011 - Loading data into data memory (EEPROM)
"IncrementAddress" 000110 - Increase the address of the PC MK
"ReadDataFromProgramMemory" 000100 - Reading data from program memory
"ReadDataFromDataMemory" 000101 - Reading data from data memory (EEPROM)
"BeginProgrammingOnlyCycle" 011000 - Start programming cycle
"BulkEraseProgramMemory" 001001 - Full erase program memory
"BulkEraseDataMemory" 001011 - Full erasure of data memory (EEPROM)

The controller responds to these commands differently. In different ways, after issuing the command, you need to continue the conversation with him.
In order to start a full-fledged programming process, you must also apply a voltage of 12 volts to the MCLR controller output, then apply a supply voltage to it. It is in this sequence of voltage supply that there is a certain meaning. After power-up, if the PIC is configured to operate from an internal RC generator, it can start executing its own program, which is unacceptable during programming, since a failure is inevitable.
Pre-supplying 12 volts to the MCLR avoids this scenario.
When writing information to the flash memory of MK programs after the command

"LoadDataForProgramMemory" 000010 - Loading data into program memory

it is necessary to send the data itself to the controller - 16 bits,
which look like this:

"0xxxxxxxxxxxxxx 0".

The crosses in this word are the data itself, and the zeros at the edges are sent as a border - this is the standard for PIC 16. There are only 14 significant bits in the word. This series of controllers has a 14-bit command format.
After the end of the data word transfer, the PIC waits for the next command.
Since our goal is to write a word to the MK program memory, the next command should be the command

"BeginEraseProgrammingCycle" 001000 - Start programming cycle

Having received it, the controller is disconnected from the outside world for 6 milliseconds, which it needs to complete the recording process.

The signals at the outputs of the microcontroller are generated by a computer using special programs - programmers. For signal transmission, COM, LPT or USB ports can be used. Such programs as PonyProg, IsProg, WinPic800 work with JDM programmer.


JDM programmer circuit

Very simple circuit the programmer is shown in the figure. In this circuit, although control of the voltage supply sequence is not implemented, but it is very simple and it is possible to assemble such a circuit very quickly, using a minimum of parts.
Picture (diagram of JDM programmer)


One of the questions when connecting a programmer to a computer is how to provide selective isolation. To avoid damage to the COM port in the event of a circuit malfunction. Some circuits use the MAX232 chip, which provides selective isolation and level matching. In this scheme, the issue is solved easier - using battery power. The signal level from the computer is limited by the Zener diodes VD1, VD2, and VD3. Despite the simplicity of the JDM programmer circuitry, most types of PIC microcontrollers can be programmed with it.

A jumper between the COM6 (DSR) and COM7 (RTS) pins is designed so that the program can determine that the programmer is connected to the computer.

The connection of the programmer outputs to a specific MC depends on the MC type. Often, several panels are mounted on the programmer board, which are designed for a certain type of controller.

The table shows the purpose of the legs of some types of MK during programming.

The PIC16F84, PIC16F84A MCUs have the same arrangement of pins for programming.



The assignment of pins for PIC16Fxxx series microcontrollers, depending on the type of package, is in most cases standard, but if there are doubts about this, then it is most reliable to check the datasheet for a specific copy of the MK. Part of the documentation is present on the Russian site http://microchip.ru A complete collection of datasheets and other documentation is located on the website of the PIC microcontroller manufacturer: http://microchip.com

Index of projects

The program allows you to directly access the index page, view the description of the desired project in a couple of clicks and immediately flash the program into the controller.



If necessary, flash the controller with the selected firmware - click on the SFR file, for example Timer_a.sfr
The program downloads the file from the server to a new tab.



After that, it remains only to insert the MK into the socket of the programmer, if this has not yet been done, and click on the "Write all" button.
The program is recorded in the MC. After that, the controller is inserted into the device board and the device is ready for operation.
Tell in:
For many radio amateurs, it is not a problem to quickly assemble a circuit you like on a microcontroller. But many beginners to work with microcontrollers are faced with the question of how to program it. One of the simplest programmer options is the JDM programmer.
Program - programmer ProgCode v 1.0 This program works in WindowsXP. Allows you to program PIC controllers of the middle family (PIC16Fxxx) through the COM port of the computer. The indicator of the programmer connection (in the upper right corner of the window), if there is no programmer on the port selected in the settings, turns red. If the programmer is connected, the program detects it and the indicator in the upper right corner takes the form shown in Figure 1. The control panel is located in the left part of the program window. This panel can be minimized by clicking on the button in the toolbar or by clicking on the left edge of the window (this is convenient when the program window is maximized to full screen).

Figure (screenshot of ProgCode v1.0 program)


If a HEX file is loaded into the program, then it is advisable to select in the list of controllers the MC for which the loaded firmware is designed for. If this is not done, then the file designed for a microcontroller with a memory larger than the one selected in the list will be cut off and parts of the program will be lost - with this option of loading the file, a warning is displayed.

If this did not happen, then you can select the desired controller after loading the file into the program.

SFR file format The ProgCode programmer supports working with its own file format. These files have the .sfr extension and allow you to store additional information about the program intended for the microcontroller. This file stores information about the type of microcontroller. This allows when loading an SFR file without worrying about pre-selecting the MK type in the settings.

Port and protocol settings when connecting the programmer After installing the program - by default, all the settings are set that are necessary for the programmer to work with the JDM scheme shown on this page.
Signal inversion in the above circuit is needed only for the OutData output, since in this circuit the signal is inverted by the matching transistor. Inversion is disabled on all other pins.



The pulse delay can be equal to 0. Its adjustment is provided for "especially difficult" controllers that cannot be flashed. The same applies to the recording pause overhead - it is zero by default. If you increase the values ​​of these settings, the programming time of the controller will increase significantly.

The checkbox "check on write" must be checked if you need to check "on the fly" everything that is written to the microcontroller for correctness and compliance with the source file. If this checkbox is unchecked, the check is not performed at all and there will be no error messages, even if such errors are actually present.
Port speed selection - the speed can be any. For the JDM programmer, this parameter is irrelevant.

WindowsXP uses buffering of information transmitted through COM ports. These are called FIFO buffers. To avoid errors when programming with JDM, this mechanism must be disabled. This can be done in the Windows Device Manager.

We go to the control panel, then:
Administration - Computer Management - Device Manager

Then we select the port to which the JDM programmer is connected (for example COM1) - look at the properties - the port parameters tab - optional. And uncheck the box "Use FIFO buffers"

Figure - Configuring a COM port for working with a JDM programmer



After that, we restart the computer.


Browser of local projects In addition to direct programming of controllers, the program implements a convenient browser of projects on MK, located both on local folders of the computer and on the Internet. This is done for the convenience of work. Often, the projects you need are in different folders, and you have to spend time getting to the right directory in order to view the project. Here it is easy to add the necessary folders to the list of folders and view any project with two or three clicks of the mouse.

When you double-click on it in the browser panel, any file will open in the program itself - this applies to pictures, html files, doc, rtf, djvu (with plugins installed), pdf, txt, asm. The file can also be opened by double-clicking in the browser using an external program installed on the computer. To do this, the extension of the required file type must be registered in the "File associations" list. If you do not specify the path to the opening program, Windows will open the file in the program by default (this is convenient for opening archives that are not always unambiguously opened). If the path to the opening program is specified in the list, the file will open in the specified program. It is convenient to view files like SPL, LAY, DSN in this way.

Figure (screenshot of ProgCode v1.0 program browser)



This is how the file associations settings window looks like:




Projects Browser on the InternetThe Projects Browser on the Internet, as well as a local project explorer, allows you to quickly go to the desired site on the Internet with a couple of clicks, view the project and, if necessary, immediately flash the program into the MC.



When browsing projects on the Internet, if on the project page there is a link to a file with the SFR extension (this is the file format of the ProgCode program), then when you click on it, such a file will open in a new program tab and is immediately ready for flashing into the microcontroller.
The list of links can be edited using the "Edit" button. This will open a window for editing the list of links:





Description of the process of programming microcircuits Most modern microcircuits contain flash memory, which is programmed using the I2C protocol or similar protocols.
Rewritable memory is in PIC, AVR and other controllers, 24Cxx memory chips, and the like, various memory cards such as MMC and SD, ordinary USB flash cards that are connected to a computer via a USB connector. Consider writing information to the flash memory of the PIC16F628A microcontroller. DATA and CLOCK lines, through which information is transmitted. The CLOCK line is used to supply clock pulses, and the DATA line is used to transfer information.
To transfer 1 bit of information to the microcontroller, it is necessary to set 0 or 1 (depending on the value of the bit) on the data line (DATA) and create a voltage drop (transition from 1 to 0) on the clock line (CLOCK).
One bit is not enough for a controller. He waits after five more to take this 6-bit message as a command. The controller really likes commands, and they should consist of 6 bits - such is the nature of the PIC16.
Here is a list and meaning of commands that the PIC is able to understand. There are not so many commands - the vocabulary of this controller is small, but you should not think that it is completely stupid - there are devices with fewer "LoadConfiguration" commands 000000 - Loading configuration
"LoadDataForProgramMemory" 000010 - Loading data into program memory
"LoadDataForDataMemory" - 000011 - Loading data into data memory (EEPROM)
"IncrementAddress" 000110 - Increase the address of the PC MK
"ReadDataFromProgramMemory" 000100 - Reading data from program memory
"ReadDataFromDataMemory" 000101 - Reading data from data memory (EEPROM)
"BeginProgrammingOnlyCycle" 011000 - Start programming cycle
"BulkEraseProgramMemory" 001001 - Full erase program memory
"BulkEraseDataMemory" 001011 - Full erasure of data memory (EEPROM)
"BeginEraseProgrammingCycle" 001000 - Start programming cycle The controller responds to these commands differently. In different ways, after issuing the command, you need to continue the conversation with him.
In order to start a full-fledged programming process, you must also apply a voltage of 12 volts to the MCLR controller output, then apply a supply voltage to it. It is in this sequence of voltage supply that there is a certain meaning. After power-up, if the PIC is configured to operate from an internal RC generator, it can start executing its own program, which is unacceptable during programming, since a failure is inevitable.
Pre-supplying 12 volts to the MCLR avoids this scenario.
When writing information to the flash memory of MK programs after the command "LoadDataForProgramMemory" 000010 - Loading data into the program memory, it is necessary to send the data itself to the controller - 16 bits,
which looks like this: “0xxxxxxxxxxxxxx0.” The crosses in this word are the data itself, and the zeros at the edges are sent as framing - this is the PIC16 standard. There are only 14 significant bits in a word. This series of controllers has a 14-bit command format.
After the end of the data word transfer, the PIC waits for the next command.
Since our goal is to write a word to the MK program memory, the next command should be the command
"BeginEraseProgrammingCycle" 001000 - Start a programming cycle Having received it, the controller is disconnected from the outside world for 6 milliseconds, which it needs to complete the recording process. The signals at the outputs of the microcontroller are generated by a computer using special programs - programmers. For signal transmission, COM, LPT or USB ports can serve. Such programs as PonyProg, IsProg, WinPic800 work with JDM programmer.
JDM programmer diagram A very simple programmer diagram is shown in the figure. In this circuit, although control of the voltage supply sequence is not implemented, but it is very simple and it is possible to assemble such a circuit very quickly, using a minimum of parts.
Picture (diagram of JDM programmer)


One of the questions when connecting a programmer to a computer is how to provide selective isolation. To avoid damage to the COM port in the event of a circuit malfunction. Some circuits use the MAX232 chip, which provides selective isolation and level matching. In this scheme, the issue is solved easier - using battery power. The signal level from the computer is limited by the Zener diodes VD1, VD2, and VD3. Despite the simplicity of the JDM programmer circuit, it can be used to program most types of PIC microcontrollers. The jumper between the COM6 (DSR) and COM7 (RTS) pins is designed so that the program can determine that the programmer is connected to the computer.

The connection of the programmer outputs to a specific MC depends on the MC type. Often, several panels are mounted on the programmer board, which are designed for a certain type of controller.

The table shows the purpose of the legs of some types of MK during programming.




Figures with the purpose of the pins of the most common MCUs during programming are shown. Pinout (pinout) of the PIC16F876A, PIC16F873A microcontrollers in the DIP28 package.

Pinout (pinout) of PIC16F874A, PIC16F877A microcontrollers in DIP40 package.
Pinout (pinout) of PIC16F627A, PIC16F628A, PIC16F648A microcontrollers in DIP18 package.
The PIC16F84, PIC16F84A MCUs have the same arrangement of pins for programming.

The assignment of pins for PIC16Fxxx series microcontrollers, depending on the type of package, is in most cases standard, but if there are doubts about this, then it is most reliable to check the datasheet for a specific copy of the MK. Part of the documentation is present on the Russian site http://microchip.ru The complete collection of datasheets and other documentation is located on the site of the PIC microcontroller manufacturer: http://microchip.com
Index of projects The program allows direct access to the index page, a couple of clicks to view the description of the desired project and immediately flash the program into the controller.



If necessary, flash the controller with the selected firmware - click on the SFR file, for example Timer_a.sfr
The program downloads the file from the server to a new tab.



After that, it remains only to insert the MK into the socket of the programmer, if this has not yet been done, and click on the "Write all" button.
The program is recorded in the MC. After that, the controller is inserted into the device board and the device is ready for operation.

You can download the program on the file download page: http://cxema.my1.ru/load/proshivki/material_k_state_prostoj_jdm_programmator_dlja_pic_mikrokontrollerov/9-1-0-1613 Section:

It so happened that I started my acquaintance with microcontrollers with AVR. PIC microcontrollers for the time being - bypassed. But, nevertheless, they also have unique constructions interesting to repeat! But these microcontrollers also need to be flashed. I write this article mainly for myself. In order not to forget the technology, how to flash a PIC microcontroller without problems and senseless waste of time.

How to Program PIC Microcontrollers or Simple JDM Programmer

For the first circuit - I tried for a long time and persistently to make a PIC programmer according to the circuits found on the Internet - nothing came of it. It's a shame, but I had to contact a friend to ask for MK. But this is not the case - constantly running around friends! The same friend advised a simple scheme that works from the COM port. But even when I put it together, it still didn’t work. After all, it is not enough to assemble a programmer - you still need to configure the program with which we will flash it. But this is exactly what I did not succeed in. A whole cloud of instructions on the Internet, and few of them helped me ...

Then, I managed to flash one microcontroller. But since I was stitching in conditions of a hard time shortage, I did not think to save at least a link to the instructions. And after all, I did not find her later. Therefore, I repeat - I am writing an article in order to have my own instructions.

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

Here is the PCB ().

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 (very confusingly said, 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 need 12 volts for firmware. Better not 12, but a little more. 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's 13? I just got out of the situation - I took a freshly charged lithium-polymer battery, which had 12.6 volts. Well, or generally a four-cell battery, with its 16 volts (I just flashed one PIC - no problem).

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

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

The development of electronics is progressing at a rapid pace, and more and more often the main element of a device is a microcontroller. It does the bulk of the work and frees the designer from the need to create sophisticated circuitry, thereby reducing the size of the PCB to a minimum. As everyone knows, the microcontroller is controlled by a program written to its internal memory. And if an experienced electronic programmer does not experience problems with the use of microcontrollers in their devices, then for a beginner radio amateur, an attempt to write a program into a controller (especially a PIC) can turn into a big disappointment, and sometimes a small pyrotechnic show in the form of a smoking microcircuit.

Oddly enough, but with all the greatness of the Internet, there is very little information about the firmware in it. PIC controllers, and the material that can be found is of a very dubious quality. Of course, you can buy a factory programmer for an inadequate price and sew as much as you like, but what to do if a person is not engaged in mass production. For these purposes, you can assemble a simple and inexpensive homemade product called JDM programmer according to the diagram below (Figure 1):



Figure # 1 - programmer diagram


Immediately I give a list of elements for those who are too lazy to peer at the diagram:

  • R1 - 10 kOhm
  • R2 - 10 kOhm (subscript). By adjusting the resistance of this resistor, you need to achieve about 13V at pin # 4 (VPP) during programming. In my case, the resistance is 1.2 kOhm
  • R3 - 200 Ohm
  • R4, R5 - 1.5 kOhm
  • VD1, VD2, VD3, VD4, VD6 - 1N4148
  • VD5 - 1N4733A (stabilization voltage 5.1V)
  • VD7 - 1N4743A (Voltage stabilization 13V)
  • C1 - 100 nF (0.1 μF)
  • C2 - 470 μF x 16 V (electrolytic)
  • SUB-D9F - COM port connector (MAMA or SOCKET)
  • DIP8 socket - depends on the controller you are using

The diagram uses an example of connecting such common controllers as PIC12F675 and PIC12F629, but this does not mean at all that the firmware of other series PIC will be impossible. To write a program to a controller of a different type, it is enough to throw the wires of the programmer in accordance with figure 2, which is given below.



Figure # 2 - options for PIC controller packages with the required pins


As you might guess, the case is used in the circuit of my programmer DIP8... With a strong desire, you can make a universal adapter for each type of microcircuit, thereby obtaining a universal programmer. But since with PIC controllers I rarely work, that's enough for me.

Although the circuit itself is quite simple and will not cause difficulties in assembly, it also requires respect. Therefore, it would be nice to make for it printed circuit board... After some manipulation with the program SprintLayout, with textolite, a drill and an iron, such a blank was born (photo # 3).



Photo # 3 - printed circuit board of the programmer


Download the source of the printed circuit board for the program SprintLayout you can follow this link:
(downloads: 680)
If desired, you can change it to suit your type of PIC controller. For those who decided to leave the board unchanged, I am posting a view from the side of the parts to facilitate installation (Figure 4).



Figure №4 - board from the mounting side


A little more witchcraft with a soldering iron and we have a ready-made device that can flash PIC controller across COM port your computer. The result of my efforts, still warm and not washed from the flux, is shown in photo # 5.



Photo # 5 - complete programmer


From now on, the first stage on the way to firmware PIC controller, has come to an end. The second stage will include connecting the programmer to a computer and working with the program IC-Prog.
Unfortunately, not all modern computers and laptops are able to work with this programmer due to the banal absence on them COM ports, and those that are installed on laptops do not issue the necessary for programming 12V... So I decided to turn to my first PC, which a long time ago was gathering dust and was waiting for its finest hour (and still waited).
So we turn on the computer and first of all install the program IC-Prog... You can download it from the author's website or follow this link:
(downloads: 778)
We connect the programmer to COM port and just start installed application... For correct operation, you need to perform a number of manipulations. Initially, you need to select the type of controller that you are going to sew. I have it PIC12F675... In the screenshot # 6, the field for choosing a controller is highlighted in red.



Screenshot 6 - choosing the type of microcontroller




Screenshot # 7 - Setting up the controller recording method


In the same window, go to the " Programming"and select the item" Programming check". Checking after programming may cause an error, since in some cases the firmware itself installs the read blocking fuses. Wed... In order not to fool yourself, it is better to disable this check. In short, follow the screenshot # 8.



Screenshot # 8 - verification setting


We continue working with this window and go to the " Are common". Here you need to set the priority of the program and be sure to use NT / 2000 / XP driver (screenshot # 9). In some cases, the program may offer to install this driver and a restart is required. IC-Prog.



Screenshot 9 - general settings


So, the work is over with this window. Now let's move on to the settings of the programmer itself. Choose from the menu " Settings "->" Programmer settings"or just press the key F3... The following window appears, shown in screenshot # 10.



Screenshot # 10 - Programmer settings window


First of all, we select the type of programmer - JDM Programmer... Next, set the radio button to use the driver Windows... The next step involves choosing COM port to which your programmer is connected. If he is alone, there are no questions at all, and if there is more than one, look in the device manager which one is currently in use. The I / O latency slider is for adjusting the write and read speed. This may be needed on fast computers and in case of problems with the firmware - this parameter must be increased. In my case, it remained by default equal to 10 and everything worked fine.

This completes the program setting IC-Prog is over and you can proceed to the process of the firmware itself, but first we read the data from the microcontroller and see what is written into it. To do this, on the toolbar, click on the microcircuit icon with a green arrow, as shown in screenshot # 11.



Screenshot 11 - the process of reading information from the microcontroller


If the microcontroller is new and has not been flashed before, then all its memory cells will be filled with values 3FFF except for the very last one. It will contain the value of the calibration constant. This is a very important and unique value for each controller. The accuracy of clocking depends on it, which, by selecting and setting this very constant, is set by the manufacturer. Screenshot 12 shows the memory cell in which the constant will be stored when reading the controller.



Screenshot # 12 - Calibration constant value


I repeat that the value is unique for each microcircuit and does not have to be the same as in the figure. Many, out of inexperience, overwrite this constant and subsequently PIC controller starts to work incorrectly if the project uses clocking from an internal generator. I advise you to write down this constant and stick an inscription with its value directly on the controller. This way you will avoid a lot of trouble in the future. So, the value is written down - let's move on. We open the firmware file, which usually has the extension .hex... Now instead of labels 3FFF, the programming buffer contains the code of our program (screenshot # 13).



Screenshot 13 - firmware loaded into the programming buffer


Above, I wrote that many overwrite the calibration constant by negligence. When does this happen? This happens when the firmware file is opened. The constant value is automatically changed to 3FFF and if you start the programming process, then there is no turning back. In the screenshot # 14, the memory cell where the constant was earlier is highlighted. 3450 (before opening hex file).

Once I decided to assemble a simple LC meter on pic16f628a and naturally I had to flash it with something. I used to have a computer with a physical com port, but now I only have a usb and a pci-lpt-2com board at my disposal. 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 is limited to the use of expensive pic18f2550 / 4550, which I naturally didn’t have, and it’s a pity to use such expensive MCUs if I rarely do something at the peaks (I prefer avr-s, it is not a problem to flash them , they are much cheaper, and it seems to me that it is easier to write programs in them). After digging for a long time on the Internet in one of the many articles about the EXTRA-PIC programmer and its various options, one of the authors wrote that extrapic works with any com-ports and even a usb-com adapter.

The logic level converter max232 is used in the circuit of this programmer.

I thought, if you use a usb adapter, it would be very stupid to do two times converting usb levels to usart TTL, TTL to RS232, RS232 back to TTL, if you can just take TTL signals of the RS232 port from the usb-usart converter chip.

And so he did. I took the CH340G microcircuit (which has all 8 com-port signals) and connected it instead of max232. And here's what happened.

In my circuit there is a jp1 jumper, which is not in the extrapic, I put it because I didn’t know how the TX pin would behave at the TTL level, so I made it possible to invert it on the remaining free NAND gate and did not miscalculate, as it turned out, directly there is a logical unit on the TX pin, and therefore 12 volts are present on the VPP pin when turned on, and nothing will happen during programming (although you can invert TX programmatically).

After assembling the board, it's time for testing. And then came the main disappointment. The programmer was detected immediately (with the ic-prog program) and started working, but very slowly! In principle, it is expected. Then, in the com port settings, I set the maximum speed (128 kilobod) and began testing all the found programs for JDM. As a result, PicPgm turned out to be the fastest. My pic16f628a was completely flashed (hex, eeprom and config) plus verification for about 4-6 minutes (and reading is slower than writing). IcProg works too, 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, there are no 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 infrequently flashing 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 blinded him out of what was." The set of parts is very diverse: both smd and DIP.

For those who dare to repeat the circuit, almost any one (ft232, pl2303, cp2101, etc.) is suitable as a usb-uart converter, instead of k1533la3 it will fit k555, I think even k155 series or foreign analogue 74als00, it may even work with logical NOT elements of the type k1533ln1. I am attaching my printed circuit board, but the layout there for those elements that were available, everyone can redraw for themselves.

List of radioelements

Designation A type Denomination Quantity NoteScoreMy notebook
IC1 ChipCH340G1 Into notepad
IC2 ChipK1533LA31 Into notepad
VR1 Linear regulator

LM7812

1 Into notepad
VR2 Linear regulator

LM7805

1 Into notepad
VT1 Bipolar transistor

KT502E

1 Into notepad
VT2 Bipolar transistor

KT3102E

1 Into notepad
VD1-VD3 Rectifier diode

1N4148

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

1 kΩ

3