Skip to main content

Program PIC microcontrollers using LabJack U3

Project description

labjack_pic

Program PIC microcontrollers using LabJack U3

I have multiple PICkits 1, 2, and 3, but none of them can program the part I selected for my latest project. Rather than shell out for yet another PICkit, I wrote this script to program the part using a LabJack U3 which I already had lying around.

Connections

Connect GND, MCLR, ICSPDAT, ICSPCLK to FIOs on the LabJack. Defaults are:

  • MCLR on FIO4
  • ICSPDAT on FIO5
  • ICSPCLK on FIO6

You can select different pins with the --mclr, --icspdat, and --icspclk arguments.

If your circuit is OK with 5V power and doesn't draw too much current, you can power it with VS (USB power). Otherwise arrange some other power supply. LabJack outputs are 3.3 V, so lower voltages are a bad idea.

Installation

pip3 install labjack_pic

Usage

labjack_pic [filename.hex]

This programs the hex file:

  • If the hex file contains program code, it will bulk erase that area first
  • If the hex file contains config words, it will erase those first
  • If the hex file contains user id words, it will erase that area first
  • If the hex file contains EEPROM data, it will not erase that first. It will update any bytes specified.

Devices supported

This script only supports low-voltage programming. This means MCLR is not available as a general-purpose input in the circuit. This also means that this programmer cannot recover a part that has been programmed to MCLR-as-input.

Currently supports devices covered by Programming Specification 40002317, Programming Specification 40002266, and Programming Specification 40001683B

These are:

  • PIC16F1703
  • PIC16LF1703
  • PIC16F1704
  • PIC16LF1704
  • PIC16F1705
  • PIC16LF1705
  • PIC16F1707
  • PIC16LF1707
  • PIC16F1708
  • PIC16LF1708
  • PIC16F1709
  • PIC16LF1709
  • PIC16F17114
  • PIC16F17115
  • PIC16F17124
  • PIC16F17125
  • PIC16F17126
  • PIC16F17144
  • PIC16F17145
  • PIC16F17146
  • PIC16F17154
  • PIC16F17155
  • PIC16F17156
  • PIC16F17174
  • PIC16F17175
  • PIC16F17176
  • PIC16F18013
  • PIC16F18023
  • PIC16F18014
  • PIC16F18024
  • PIC16F18044
  • PIC16F18054
  • PIC16F18074
  • PIC16F18015
  • PIC16F18025
  • PIC16F18045
  • PIC16F18055
  • PIC16F18075
  • PIC16F18026
  • PIC16F18046
  • PIC16F18056
  • PIC16F18076

I would accept patches to support other PICs, but larger memory devices are probably going to be obnoxiously slow to program with LabJack hardware.

Performance

The SPI clock of the U3 is relatively slow. Writing takes maybe 2-3x as long as a proper programmer that can do the full 5 MHz clock.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labjack_pic-0.0.7.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

labjack_pic-0.0.7-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file labjack_pic-0.0.7.tar.gz.

File metadata

  • Download URL: labjack_pic-0.0.7.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for labjack_pic-0.0.7.tar.gz
Algorithm Hash digest
SHA256 fb635474bdb420db50983e4d771365642cddc3c90a0048182e4348b85ee74deb
MD5 6d2e45ae87b851baea8efc07f307fa78
BLAKE2b-256 07cd5d352bd230b9eeb7bd0896683c0073f3a1f15680211a5d13acdd332f54cd

See more details on using hashes here.

File details

Details for the file labjack_pic-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: labjack_pic-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for labjack_pic-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9702cc4cb3da1e7ef8c0cb4566f1880c14eb17dfe29872beddf0f3be31989f7a
MD5 af82b5fb64b14364105e0a7b32d5e80f
BLAKE2b-256 4081eb5386e3651f4fe6123c4d26474c4523d649207460049b76d57d30e4bd3e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page