USB PIC Programmer with Arduino

| March 3, 2025 Updated
USB PIC Programmer with Arduino

Open source USB PIC Programmer project for Arduino (ATMEGA328) based PIC MCU. Programming can be done with minimum components and ICSP connection for Atmega328 (arduino nano/uno) based PIC microcontrollers.

You can also add new PIC models yourself, for this you need to edit the “pic.xml” file. Edit the values ​​inside the “name” tag to add a new chip

The following PIC models are currently supported:

PIC12: PIC12F1840,PIC12F629/675,PIC12F635,PIC12F683

PIC16: PIC16F1512,PIC16F1513,PIC16F1516,PIC16F1517,PIC16F1518,PIC16F1519,PIC16F1526, PIC16F1527,PIC16F1847,PIC16F1933,PIC16F1934,PIC16F1936,PIC16F1937,PIC16F1938,PIC16F1939, PIC16F1946,PIC16F1947,PIC16F627A,PIC16F628A,PIC16F648A,PIC16F676/630,PIC16F631, PIC16F636,PIC16F639,PIC16F677,PIC16F684,PIC16F685,PIC16F687,PIC16F688,PIC16F689, PIC16F690,PIC16F73,PIC16F74,PIC16F76,PIC16F77,PIC16F84A

PIC18: PIC18F2510,PIC18F2525,PIC18F2550,PIC18F2585,PIC18F25K80,PIC18F2610,PIC18F2620, PIC18F2680,PIC18F26K80,PIC18F4515,PIC18F4525,PIC18F4550,PIC18F45K80,PIC18F4585,PIC18F4610, PIC18F4620,PIC18F4680,PIC18F46K80

PIC10: PIC10F200, PIC10F202, PIC10F204, PIC10F206 PIC12: PIC12F510 PIC16F: PIC16F505, PIC16F506, PIC16F54, PIC16F57, PIC16F59
PIC16F183xx PIC10F32x, PIC16F150x, PIC16F88x
PIC16F170X, PIC16F18XX, PIC16F183XX, PIC16F184XX, PIC18FXXK22, PIC18FXXQ10
PIC16F871/872/873/874/876/877 PIC16F873A/874A/876A/877A PIC16F627/628

arduino-usb-pic-mcu-programmer-circuit

Programmer circuit made directly with ATMEGA328 without Arduino Module

atmega328p-arduino-usb-pic-mcu-programmer-circuit

To add a new PIC microcontroller, edit the values ​​inside the “name” tag in the pic.xml file

id – devid + revid

type – similarly family of programmable pic models, the numbers are taken completely arbitrary, we find a similar model in the programming algorithm from those supported in the datasheet

f_size – size of the code segment in bytes

f_psize – flash page size

ee_size – eeprom size in bytes

f_start – address of the beginning of the code segment (usually always equal to zero)

ee_start – address of the beginning of the data (eeprom) memory segment

ee_type – type of eeprom data arrangement in the hex file (1 – consecutive, 2 – empty bytes)

conf1-conf7 – offset addresses of conf bits in the hex file (non-existing conf must have the value “none”)

oscal1-oscal3 – generator calibration byte offset addresses, similar to conf

delay – timeout of programming a word/page delay

word – flash memory word mask: 16 bits – FFFF, 14 bits – 3FFF, etc.

The pic programming software has been tested on Windows x64, Linux Fedora 39 x64, Ubuntu 22.04 aarch64, FreeBSD 14.1 x64. The list of supported models is in the file “pic.xml”. The files are the same in both versions of the program.

To work on Linux, you will need to install QSetialPort (libqt6-serialport-dev) and qt6-base-dev, and probably a few other packages. You can check by running it from the terminal. If /dev/ttyUSB0 is not visible or inaccessible, the following command should be issued: “sudo chmod a+rw /dev/ttyUSB0”. In Ubuntu, the ch340 and brltty drivers may conflict, so the latter can be removed with “sudo apt autoremove brltty”. The Windows version of Qt is compiled with static libraries and is ready to run right away.

usb-programmer-libqt6-serialport-dev-arduino-sudo-chmod-arw-devttyusb

Source: github.com/AndrejChoo/USB-PIC-Programmer-on-Arduino?tab=readme-ov-file

Published: 2025/03/03 Tags: ,



Leave a Reply

Your email address will not be published. Required fields are marked *