Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:pickle [2017/01/12 23:07]
127.0.0.1 external edit
projects:pickle [2023/11/05 18:07] (current)
darron [ICSP interfaces]
Line 1: Line 1:
-====  Pickle Microchip PIC ICSP====+==== Pickle Microchip PIC ICSP ==== 
 <wrap right> <wrap right>
-{{:projects:pickle:converter.jpg?200|Pi Zero programming dsPIC33EV}}+{{:projects:pickle:dspic-soic.jpg?200|Pi Zero programming dsPIC33EP}}
 </wrap> </wrap>
  
-Pickle has been written to allow programming of PICMicro devices in FreeBSD, NetBSD, Linux, Cygwin (Windows) and MACOS/X or any UNIX/POSIX based system, which includes the Raspberry Pi and embedded devices running OpenWRT.+Pickle is an PICMicro in-circuit serial programmer for FreeBSD, NetBSD, Linux, Cygwin (Windows) and MACOS/X or any UNIX/POSIX based system, which includes the Raspberry Pi and embedded devices running OpenWRT.
  
-All systems support high voltage programming (HVP) of PICMicros with the Velleman K8048 or K8076 kits, however, other high voltage programming kits and circuits may be supported by adjustment of the I/O rules.+All operating systems support high voltage programming (HVP) of PICMicros with the Velleman K8048 or K8076 kits using a RS232 interfaceyet many other high voltage programming kits may be supported with the appropriate configuration.
  
-Support is also available to program low voltage programming (LVP) compatible PICMicros directly from a Raspberry Pi version 1 or 2, OpenWRT enabled router or USB UART adapter. Look for devices marked LVP(PGM) or LVP(KEY) in the supported PIC devices list.+Support is also available to program low voltage programming (LVP) compatible PICMicros directly from a Raspberry Pi, OpenWRT enabled router or an USB UART adapter. Look for PICMicros marked LVP(PGM) or LVP(KEY) in the supported PICMicro device list.
  
-Please refer to the Microchip documentation for your device as to whether it supports high voltage (HVP) or low voltage (LVP) programming or both.+Refer to the Microchip documentation for your PICMicro as to whether it supports high voltage (HVP) or low voltage (LVP) programming or both.
  
-Currently supported PICMicro devices range from the PIC10 to the PIC32 but generally only devices in DIP format have been tested. This program may or may not support your device in another package type and your feedback is welcome should you gain success with the application.+Currently supported PICMicros range from the PIC10 to the PIC32. Predominantly PICMicros available in DIP packages are tested and supported.
  
-In order to use the program in Windows Cygwin you must first install and setup Cygwin including the necessary development tools for building the application. See [[:boards:cygwin|this]] page for details.+In order to use the program in Windows you must first install and setup Cygwin including the necessary development tools for building the application. See [[tools:cygwin|this]] page for details.
  
 Darron M Broad < darron at kewl dot org > Darron M Broad < darron at kewl dot org >
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
 === News === === News ===
 +
 <wrap right> <wrap right>
 {{:projects:pickle:pic32mm.jpg?200|PIC32MM}} {{:projects:pickle:pic32mm.jpg?200|PIC32MM}}
 </wrap> </wrap>
 +   
 +Pickle version 5.0 has been released. This version changes how ICSP interfaces are configured in the configuration file. The changes do not affect the RPi but do affect the legagy Velleman K8048.
  
-Support has been added for 8-bit PICMicros which have a new programming algorithm. Two families of PIC16F and one family of PIC18F have so far been released by Microchip and are supported.+Programming executive support has been added for PIC32MM 32-bit PICMicros.
  
-There is also support for programming the new PIC32MM 32-bit PICMicros. Currently the programming method used is slow and high speed programming with the programming executive is not available at this time. +<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
- +
-~~UP~~+
  
 === Licence === === Licence ===
 +
 Before you download and use the application you should read the [[:projects:pickle:licence|LICENCE]] found here. This licence details the rights and liabilities of using  the  application and it should be especially understood that I, the  author,  will not accept any responsibility for any side effects of  running it.  Do not download and run this program unless you are willing  to accept  the consequences of it failing for any reason. Before you download and use the application you should read the [[:projects:pickle:licence|LICENCE]] found here. This licence details the rights and liabilities of using  the  application and it should be especially understood that I, the  author,  will not accept any responsibility for any side effects of  running it.  Do not download and run this program unless you are willing  to accept  the consequences of it failing for any reason.
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
-=== Credits and thanks === +=== History ===
- +
- +
-Pickle was originally written by Darron M Broad in 2005 as `k8048' to support the PIC16F627. `k8048' was updated in 2007 adding various other devices and more active development has occured since 2012 adding many more. The project was renamed from `k8048' to pickle in January 2015 as the Velleman K8048 kit became less relevant and superseded by the Raspberry Pi as the primary development platform. +
- +
-Thanks go to Ian Stoyle who supplied a patch which added support for the  16F84 device which does not have a device id within its configuration.  This patch was the origin of the feature to override the device probe  and instead supply the device name of the target. +
- +
-Kristoffer Myskja reported that he had great success with the Velleman K8048 on a laptop without serial I/O by using a cardbus serial interface. This is probably the best option for a laptop without a UART. +
- +
-Johan Ahlander notified me that the application worked fine in NetBSD. +
- +
-Working with keen linux user and PIC coder Paul Van Gelder I added  support for the Velleman K8076 kit and 16F84A PICMicro. Thanks Paul! +
- +
-Many thanks to Chaitanya Rogers who donated money toward development and to acquire new PICmicros. All the PICMicros acquired with that donation are now supported, thank you. +
- +
-Thank you Josef Larsson for reporting that the 16F690 is compatible with  this application using ICSP. This device may also be used in the  Velleman K8048 14P socket with pins 8 to 13 unconnected. +
- +
-Thanks go to David Braithwaite as I now have a PIC18LF27J53 to investigate. This was sent free of charge with a RKP28sb PICMicro kit. This  PICMicro isn't compatible with the Velleman K8048 but is usable in a  direct connection to a Raspberry Pi with 3V3 low voltage programming. +
- +
-Thank you Gerhard Bertelsmann for adding erase support for the  PIC18F26K80 and for development and testing of OpenWRT GPIO support with  the Linux GPIO bit- bang driver kernel module. The PIC18F26K80 is one  of a number of devices which are available to program using the LVP(KEY)  mode of operation. +
- +
-I recently bought a PIC16F84 on Ebay for testing purposes. The seller  generously sent an extra as a spare part, thank you for that Dawn. +
- +
-Dustin Hoffman has reported that he has been using the PIC16F1503 device  successfully on the Raspberry Pi in LVP mode. This is an inexpensive  method of adding intelligent I/O to this computer. Thank you for this  information and good luck with your projects. +
- +
-Thanks go to Manoj Mokashi for submitting a patch to add a clocked output mode on TxD for UARTS which cannot send a continuous break condition. This solution requires a T flip flop connected to TxD. +
- +
-Simon Casey added support for various high pin count PIC24 devices, see the supported list for more information. Thank you very much for your hard work and good luck with your various projects! +
- +
-Special thanks go to Steve Marchant who made a contribution which has been used to acquire an Orange Pi computer. Evaluation of the Orange Pi has proven its full support in pickle. Good luck Steve. +
- +
-Jim Gregory has reported great success with this program using [[projects:gpio-bb|gpio-bb]] on an Orange Pi, thanks for your feedback and good luck with your many experiments. +
- +
-Lastly, thank you to Microchip for creating these versatile micro-controllers and also for their sample program which has supplied a  third of the available and tested devices. +
- +
-~~UP~~+
  
 <wrap right> <wrap right>
 {{:projects:pickle:ftdi-icsp.jpg?200|FTDI}} {{:projects:pickle:ftdi-icsp.jpg?200|FTDI}}
 </wrap> </wrap>
-=== Supported interfaces === 
  
-A number of back-end methods are built-in to program PICMicros.+Pickle was originally written by Darron M Broad in 2005 as `k8048' to support the PIC16F627. `k8048' was updated in 2007 adding various other devices and more active development has occured since 2012 adding many more. The project was renamed from `k8048' to pickle in January 2015 as the Velleman K8048 kit became less relevant and superseded by the Raspberry Pi as the primary development platform.
  
-    - The POSIX RS-232 serial protocol for the Velleman kits or USB UART adapter. +=== Thanks ===
-    - The Raspberry Pi GPIO interface for the Velleman kits, direct to breadboard or the ChipKITPi. +
-    - Linux MCP23017 I2C direct to breadboard. +
-    - GPIO bit-bang driver for Linux direct to breadboard. +
-    - The AllWinner A20/H2+/H3 GPIO interface direct to breadboard for Banana and Orange Pi. +
-    - FTDI bit-bang driver for Linux.+
  
-== POSIX RS-232 ==+Special [[projects:pickle:thanks|thanks]] go to various people who helped over the years with this project!
  
-This is available on every platform with a UART but due to the bit-bang  nature of operation, a standard motherboard UART is recommended for high  speed.+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
-Testing with a standard UART has been done on FreeBSD and Linux, and for  USB, a Prolific PL-2303 serial adapter has been tested on Linux by both  myself an Fred Marquis. The PL-2303 has also been tested on MACOS/X by  Tobias Braun who reported success (Thank you Tobias).+=== ICSP interfaces ===
  
-Although the Prolific PL-2303 device works, it is very slow in operation  due to USB control messages for this device taking a minimum of 3ms.+Hardware with ICSP support.
  
-USB devices, such as the cp2102 serial interface in Linux can be used in the low voltage programming modesee [[:interfaces:cp2102|here]] for an example method of connection.+^Device^Description^Speed^Data^ 
 +|[[projects:pickle#bananapi|BPI]]/[[projects:pickle#orangepi0|OPI]] (1)|Linux AllWinner Banana Pi (A20) and Orange Pi (H2+/H3) GPIO.|Fast|[[:boards:bpi|BPi]] [[:boards:opi0|OPi0]]| 
 +|[[projects:pickle#linuxcp2104|CP2104]]    |Linux CP2104 GPIO.|Slow|CP210x_VCP_Linux_3.13| 
 +|[[projects:pickle#linuxftdi|FTDI]]        |Linux FTDI USB bit-bang.|Slow|libftdi or libftdi1| 
 +|[[projects:pickle#linuxgpiobb|GPIO-BB]]   |Linux GPIO bit-bang version 1.3.|Fast|[[projects:gpio-bb|GPIO Bit-bang]]| 
 +|[[projects:pickle#linuxmcp2221|MCP2221]]  |Linux MCP2221 GPIO.|Slow|Wire as PI/O below | 
 +|[[projects:pickle#linuxmcp23016|MCP23016]]|Linux MCP23016 I2C.|Slow|Wire as PI/O below| 
 +|[[projects:pickle#linuxmcp230xx|MCP230XX]]|Linux MCP23008/17 I2C.|Slow|[[:interfaces:slicepi|Slice of PI/O]]| 
 +|[[projects:pickle#linuxmcp23sxx|MCP23SXX]]|Linux MCP23S08/17 SPI.|Slow|Wire as PI/O above| 
 +|[[projects:pickle#linuxpcf8574|PCF8574]]  |Linux PCF8574 I2C.|Slow|Single data I/O| 
 +|SYSFSGPIO|Linux SYSFS|Slow|Single data I/O| 
 +|[[projects:pickle#rpi1|RPI]] (2)          |Linux Raspberry Pi GPIO (Pi0/Pi1/Pi2/Pi3/Pi4).|Fast|[[:boards:rpi|RPi]] [[:boards:chipkitpi|chipKITPi]]| 
 +|[[projects:pickle#k8048tty|TTY]]          |POSIX Serial bit-bang.|Variable|8250/16550 is fastUSB is slow, Eg. [[:interfaces:cp2102|CP2102]]|
  
-== Raspberry Pi GPIO ==+(1) Memory mapped I/O on BPI can cause a lock-up on latest kernels. Use GPIO-BB instead.\\ 
 +(2) Board auto-detect does not work with newer Kernels.
  
-RPi GPIO requires voltage level shifters when connected to the Velleman  K8048 kit. An example circuit for the Velleman K8048 is demonstrated [[:boards:rpi:k8048|here]].+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
-For the [[:boards:rpi|RPi]] GPIO direct connection to a PICMicro on a breadboard. +=== PICMicros ===
- +
-For the PIC32 on the [[:boards:chipkitpi|chipKITPi]] attached to a RPi. +
- +
-== Linux MCP23017 I2C =+
- +
-Linux MCP23017 I2C is demonstrated on a RPi with a [[:interfaces:slicepi|Slice of PI/O]] expansion board. +
- +
-== GPIO bit-bang driver for Linux == +
- +
-The GPIO bit-bang driver for Linux kernel module installation is documented [[projects:gpio-bb|here]] for the RPi and OpenWRT. +
- +
-== AllWinner A20/H2+/H3 Banana and Orange Pi GPIO == +
- +
-See [[:boards:bpi|BPi]] or [[:boards:opi0|OPi0]] for a direct GPIO connection to a PICMicro on a breadboard. +
- +
-== FTDI bit-bang == +
- +
-This utilises the FTDI library in Linux to bit bang the pins on a FTDI break out board. This uses an accelerated I/O mode and has only been tested to work with 8-bit PICMicros such as the PIC16 and PIC18 in LVP mode of operation. +
- +
-== Interface status == +
- +
-^Hardware interface ^Status ^Device name | +
-|Motherboard 8250/16550 UART |Works well |Generic | +
-|PCI LGS GM16C550 UART |Works well (tested in Cygwin) |Intek21 PCI IO 2S-550 Board | +
-|MCT U232 USB serial converter |Not working |Targus PA088 | +
-|pl2303 USB serial converter |Works slowly |Best Connectivity (Dabs Value) | +
-|FTDI USB serial converter |Not working |ECS i-Buddie USB Dock | +
-|Raspberry Pi GPIO Velleman K8048 |Works well |74HC03 (voltage level shifting) | +
-|Raspberry Pi GPIO |Works well |Breadboard at 3V3 | +
-|Linux (R-PI) MCP23017 I2C |Works slowly |Slice of PI/O | +
-|Linux GPIO bit-bang driver |Works well |Breadboard at 3V3 | +
-|cp2102 USB serial converter (LVP) |Works slowly |BAITE betemcu.cn | +
-|Generic CH341 USB serial converter |Works slowly |QinHeng Electronics HL-340 USB-Serial adapter | +
-|AllWinner A20/H2+/H3 GPIO |Works well |Breadboard at 3V3 | +
-|FTDI bit-bang (LVP) |Works well |FTDI USB | +
- +
-~~UP~~ +
- +
-=== Supported PICMicro devices ===+
  
 <wrap right> <wrap right>
Line 146: Line 82:
 </wrap> </wrap>
  
-The following tables list all the supported devicesDevices in each table are grouped by family and at least one device of each family has been tested to work.+The following tables list all the supported PICMicrosPICMicros in each table are grouped by family and at least one device of each family has been tested.
  
 [[:projects:pickle:12-bit|12-bit word / 8-bit data PIC10F/12F/16F architecture]] [[:projects:pickle:12-bit|12-bit word / 8-bit data PIC10F/12F/16F architecture]]
Line 162: Line 98:
 [[:projects:pickle:32-bit|32-bit word / 32-bit data PIC32 architecture]] [[:projects:pickle:32-bit|32-bit word / 32-bit data PIC32 architecture]]
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
-=== Tested PICMicro devices ===+=== Tested PICMicros ===
  
 <wrap right> <wrap right>
Line 170: Line 106:
 </wrap> </wrap>
  
-The devices in the following table have been tested are known to work in specific modes of operation.+The PICMicros in the following table have been tested are known to work in specific modes of operation
 + 
 +Code Y/N indicates whether an [[:projects:icspio|ICSP I/O]] test has been written for this device.
  
-The modes are as follows:+The three modes are as follows:
  
     * HVP. High voltage programming at 9 or 13V.     * HVP. High voltage programming at 9 or 13V.
Line 178: Line 116:
     * LVP(KEY). Low voltage programming with VPP at VDD and entry using a 32-bit key.     * LVP(KEY). Low voltage programming with VPP at VDD and entry using a 32-bit key.
  
-Test code indicates whether [[:projects:icspio|ICSP I/O]] test code has been written for this device.+The legacy Velleman K8048/K8076 is incompatible with many modern devices and any advice is noted.
  
-New algorithm noted in the last column refers to the new PIC16F/18F programming algorithm incompatible+New algorithm noted in the comment column refers to the new PIC16F/18F programming algorithm incompatible
 with the older ICSP programming method. with the older ICSP programming method.
  
-^Test code ^Device name ^Added by ^Tested by ^HVP ^LVP(PGM) ^LVP(KEY) ^Velleman K8048 ^Comments |+Code PICMicro ^ Added by ^ Tested by ^ HVP ^ LVP(PGM) ^ LVP(KEY) ^ Velleman K8048 ^ Comments ^
 |Y |PIC16F84A |Darron Broad |Paul Van Gelder |13 |N |N |  | | |Y |PIC16F84A |Darron Broad |Paul Van Gelder |13 |N |N |  | |
 |Y |PIC16F627 |Darron Broad |  |13 |5 |N |  | | |Y |PIC16F627 |Darron Broad |  |13 |5 |N |  | |
Line 231: Line 169:
 |Y |PIC16F1936 |Darron Broad |  |9 |N |5 |VPP 9V. | | |Y |PIC16F1936 |Darron Broad |  |9 |N |5 |VPP 9V. | |
 |Y |PIC16F1847 |Darron Broad |  |9 |N |5 |VPP 9V. | | |Y |PIC16F1847 |Darron Broad |  |9 |N |5 |VPP 9V. | |
-|Y |PIC18F25K50 |Darron Broad |  |9 |N |5 |VPP 9V. | |+|Y |PIC18F25K50 |Darron Broad |  |9 |N |5 | | |
 |Y |PIC18F14K50 |Darron Broad |  |9 |5 |N |Incompatible (PGC/PGD 3V3 limit). | | |Y |PIC18F14K50 |Darron Broad |  |9 |5 |N |Incompatible (PGC/PGD 3V3 limit). | |
 |Y |PIC18LF27J53 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | | |Y |PIC18LF27J53 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | |
Line 291: Line 229:
 |Y |dsPIC33EV256GM102 |Darron Broad |  |N |N |5 |VPP 5V. ICSP only. | | |Y |dsPIC33EV256GM102 |Darron Broad |  |N |N |5 |VPP 5V. ICSP only. | |
 |Y |PIC16F18346 |Darron Broad |  |9 |N |5 |VPP 9V. not tested. | | |Y |PIC16F18346 |Darron Broad |  |9 |N |5 |VPP 9V. not tested. | |
-|Y |PIC16F15355 |Darron Broad |  |9 |N |5 |VPP 9V. not tested. |New algorithm.| +|Y |PIC16F15355 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.| 
-|Y |PIC18F26K40 |Darron Broad |  |9 |N |5 |VPP 9V. not tested. |New algorithm.|+|Y |PIC18F26K40 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.|
 |Y |PIC16F18875 |Darron Broad |  |9 |N |5 |VPP 9V. not tested. |New algorithm.| |Y |PIC16F18875 |Darron Broad |  |9 |N |5 |VPP 9V. not tested. |New algorithm.|
 +|Y |dsPIC33EP64GS502 |Darron Broad | |N |N |3V3 |Incompatible (architecture). | |
 +|Y |PIC24FJ256GA702 |Darron Broad | |N |N |3V3 |Incompatible (architecture). | |
 +|Y |PIC32MM0032GPL028 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | |
 +|Y |dsPIC33EP512MC502 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | |
 +|Y |dsPIC33EP128GS702 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | |
 |N |PIC16F873A |Chris Williams |  |13 |5 |N |  | | |N |PIC16F873A |Chris Williams |  |13 |5 |N |  | |
 |N |PIC16F1503 |Darron Broad |Dustin Hoffman |9 |N |5 |VPP 9V. | | |N |PIC16F1503 |Darron Broad |Dustin Hoffman |9 |N |5 |VPP 9V. | |
Line 304: Line 247:
 |N |PIC24FJ1024GB610 |Simon Casey | |N |N |3V3 |Incompatible (architecture). | | |N |PIC24FJ1024GB610 |Simon Casey | |N |N |3V3 |Incompatible (architecture). | |
 |N |PIC24FJ128GA410 |Simon Casey | |N |N |3V3 |Incompatible (architecture). | | |N |PIC24FJ128GA410 |Simon Casey | |N |N |3V3 |Incompatible (architecture). | |
-|N |PIC32MM0032GPL028 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). |PE not supported. | +|N |PIC16F18313 |Darron Broad |  |9 |N |5V |VPP 9V. not tested. | | 
-^Test code ^Device name ^Added by ^Tested by ^HVP ^LVP(PGM) ^LVP(KEY) ^Velleman K8048 ^Comments |+|N |PIC16F1822 |Darron Broad |  |9 |N |5V |VPP 9V. not tested. | | 
 +|N |PIC16F1840 |Darron Broad |  |9 |N |5V |VPP 9V. not tested. | | 
 +|N |PIC16F1501 |Darron Broad |  |9 |N |5V |VPP 9V. not tested. | | 
 +|N |PIC16F1571 |Darron Broad |  |9 |N |5V |VPP 9V. not tested. | | 
 +|N |PIC16F1572 |Darron Broad |  |9 |N |5V |VPP 9V. not tested. | | 
 +|N |PIC18F25K42 |Darron Broad |  |9 |N |5V |VPP 9V.|New algorithm.| 
 +|N |PIC18F26J50 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | 
 +|N |PIC16F19156 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.| 
 +|N |PIC18F26K42 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.| 
 +|N |PIC16F18446 |Darron Broad |  |9 |N |5 |VPP 9V. Use 14P socket. |New algorithm.| 
 +|N |PIC18F25Q10 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.| 
 +|N |dsPIC33EP32GS202 |Darron Broad |  |N |N |3V3 |Incompatible (architecture). | | 
 +|N |PIC32MM0256GPM028 |Pete Restall|  |N |N |3V3 |Incompatible (architecture). | | 
 +|N |PIC18F26K83 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.| 
 +|N |PIC18F27Q43 |Darron Broad |  |9 |N |5 |VPP 9V. |New algorithm.| 
 +Code PICMicro ^ Added by ^ Tested by ^ HVP ^ LVP(PGM) ^ LVP(KEY) ^ Velleman K8048 ^ Comments ^
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
 === Installation === === Installation ===
  
-Download the latest archive file [[http://wiki.kewl.org/downloads/pickle-4.0f.tar.gz|pickle-4.0f.tar.gz]] then decompress and extract the application source code from the archive. Once you perform   `sudo make install', the application will be ready for use.+Download the latest archive file [[https://wiki.kewl.org/downloads/pickle-5.01.tgz|pickle-5.01.tgz]] or check out the latest development version here [[http://hg.kewl.org/pub/pickle/archive/tip.tar.gz|tip.tar.gz]].
  
-This has been tested on FreeBSD 5 and 6 yet should work on all FreeBSD   variants and other BSD derived systemsIt has also been test to work in   Linux 2.6 but only compiled for 2.4.+Decompress and extract the application source code from the archivePerform `sudo make && sudo make install', the application will be ready for use.
  
-A binary build is now available only for RPi with Raspbian Jessie [[http://wiki.kewl.org/downloads/pickle-4.0f-raspbian-jessie.tgz|pickle-4.0f-raspbian-jessie.tgz]]. This pre-built binary must be extracted as root into /opt/pickle.+This has been tested on FreeBSD 5 and 6 yet should work on all FreeBSD variants and other BSD derived systems. It has also been test to work in Linux 2.6 but only compiled for 2.4.
  
-Here are some sample sessions obtaining the source of the  application and then compiling and installing it.+A binary build is available for the RPi [[https://wiki.kewl.org/downloads/pickle-5.02-pi.tgz|pickle-5.02-pi.tgz]]. This pre-built binary must be extracted as root into / as /opt/pickle/
 + 
 +Here are some sample sessions obtaining the source of the application and then compiling and installing it.
  
 == FreeBSD == == FreeBSD ==
 +
 +As root.
  
 <code> <code>
Line 327: Line 289:
 rehash rehash
 cd /root cd /root
-fetch "http://wiki.kewl.org/downloads/pickle-4.0f.tar.gz+fetch "https://wiki.kewl.org/downloads/pickle-5.01.tgz
-tar zxf pickle-4.0f.tar.gz+tar zxf pickle-5.01.tgz
 cd pickle cd pickle
-gmake +gmake k8048 
-gmake install+gmake k8048-install
 </code> </code>
  
-== Generic ==+== Linux ==
  
 <code> <code>
-wget "http://wiki.kewl.org/downloads/pickle-4.0f.tar.gz+wget "https://wiki.kewl.org/downloads/pickle-5.01.tgz
-tar zxf pickle-4.0f.tar.gz+tar zxf pickle-5.01.tgz
 cd pickle cd pickle
-gnumake +make linux 
-sudo gnumake install+sudo make linux-install
 </code> </code>
  
Line 347: Line 309:
  
 <code> <code>
-wget "http://wiki.kewl.org/downloads/pickle-4.0f.tar.gz+wget "https://wiki.kewl.org/downloads/pickle-5.01.tgz
-tar zxf pickle-4.0f.tar.gz+tar zxf pickle-5.01.tgz
 cd pickle cd pickle
-make +make cygwin 
-make install+make cygwin-install
 cd ~ cd ~
 vi .pickle vi .pickle
Line 363: Line 325:
 Below is an example where we build the latest version of pickle from the code repository (use at your own risk). Below is an example where we build the latest version of pickle from the code repository (use at your own risk).
  
-== Debian or Debian derived ==+== Debian ==
  
 <code> <code>
Line 371: Line 333:
 hg clone http://hg.kewl.org/pub/pickle hg clone http://hg.kewl.org/pub/pickle
 cd pickle cd pickle
-make +make linux 
-make install+make linux-install
 </code> </code>
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
 === Configuration === === Configuration ===
  
-dot file in your home directory (.pickleis used to configure the application.+<wrap right> 
 +{{:projects:pickle:k8048-rpi.jpg?200|Velleman K8048 RPi}} 
 +</wrap> 
 + 
 +There are two ways to configure pickle; either use a dot file named `.pickle' in your home directory, else create a directory named `.pickle' and store the configuration in a file there named `config'
 + 
 +The second option is to allow selectable configurations with the `PICKLE' environment variable, and also for storage of Programming Executive files for the 32-bit PICMicros.
  
 The options are as follows. The options are as follows.
  
 <code> <code>
-# I/O device: tty, ttyUSB, RPI, I2C (MCP23017) or GPIO BIT-BANG 
 # #
-#DEVICE=/dev/ttyu0 +# I/O device 
-#DEVICE=/dev/ttyS0 +
-#DEVICE=/dev/ttyUSB0 +#DEVICE=BPI                     # Banana Pi SBC 
-DEVICE=RPI +#DEVICE=CP2104                  # CP2104 USB UART 
-#DEVICE=RPI2 +#DEVICE=FTDI                    # FTDI FT230X, FT4232H, FT2232H or FT232 USB UART 
-#DEVICE=/dev/i2c-1 +#DEVICE=GPIO-BB                 # Linux GPIO bit-bang kernel module 
-#DEVICE=/dev/gpio-bb+#DEVICE=MCP2221                 # Microchip USB bridge 
 +#DEVICE=MCP23016                # Microchip I2C I/O expander 
 +#DEVICE=MCP230XX                # Microchip 23008/23017 I2C I/O expanders 
 +#DEVICE=MCP23SXX                # Microchip 23S08/23S17 SPI I/O expanders 
 +#DEVICE=PCF8574                 # Philips I2C I/O expander 
 +#DEVICE=RPI                     # Raspberry Pi/0/2/3/4 SBCs 
 +#DEVICE=TTY                     # POSIX RS-232 UART 
 + 
 +# I/O interface 
 +#IFACE=/dev/ttyUSB0             # CP2104 or TTY 
 +#IFACE=0                        # FTDI 
 +#IFACE=/dev/gpio-bb             # GPIO-BB 
 +#IFACE=/dev/i2c-1               # MCP23016, MCP230XX or PCF8574 
 +#IFACE=/dev/spidev0.1           # MCP23SXX 
 +#IFACE=/dev/ttyS0               # TTY
  
 # I/O 1/2-bit delay/sleep time # I/O 1/2-bit delay/sleep time
 # #
-# For ttyS 1 is fine +# For ttyS   use 
-# For ttyUSB try 600+# For ttyUSB use 600 
 +# For RPI    use 1
 # #
 # When SLEEP is set to zero no delay is taken # When SLEEP is set to zero no delay is taken
-# When SLEEP is less than 10, then SLEEP x I/O bit time is taken for R-PI and tty+# When SLEEP is less than 10, then SLEEP x I/O bit time is taken for RPI and tty
 # When SLEEP is less than 100 a busy loop is utilised # When SLEEP is less than 100 a busy loop is utilised
-# When SLEEP is>=100 then system usleep is used.+# When SLEEP is >=100 then system usleep is used.
 # #
 # For GPIO BIT-BANG SLEEP configures the low and high clock durations in the driver # For GPIO BIT-BANG SLEEP configures the low and high clock durations in the driver
 # #
-ttyu/ttyS+TTY ttyS
 #SLEEP=1 #SLEEP=1
-# ttyUSB+TTY ttyUSB
 #SLEEP=600 #SLEEP=600
-RASPBERRY PI VELLEMAN K8048+RPI VELLEMAN K8048
 #SLEEP=10 #SLEEP=10
-RASPBERRY PI GPIO +RPI GPIO 
-SLEEP=1 +#SLEEP=1 
-MCP23017 I2C+# I2C/SPI
 #SLEEP=0 #SLEEP=0
-# GPIO BIT-BANG+# GPIO-BB
 #SLEEP=1 #SLEEP=1
  
 # I/O bit rules. # I/O bit rules.
 #       These rules determine the polarity of the control lines and whether #       These rules determine the polarity of the control lines and whether
-#       data input requires data output pulled high.+#       data input requires data output pulled high or low.
 # 0x0001 PGD_OUT_FLIP # 0x0001 PGD_OUT_FLIP
 # 0x0002 PGC_OUT_FLIP # 0x0002 PGC_OUT_FLIP
Line 429: Line 411:
 # 0x0020 PGM_OUT_FLIP # 0x0020 PGM_OUT_FLIP
 # 0x0040 VPP_OUT_CLOCK # 0x0040 VPP_OUT_CLOCK
-#       These rules are for GPIOs on program exit.+# 0x0080 PGD_IN_PULLDOWN 
 +#       These rules release GPIOs on program exit by setting them to Input.
 # 0x0100 PGD_RELEASE # 0x0100 PGD_RELEASE
 # 0x0200 PGC_RELEASE # 0x0200 PGC_RELEASE
Line 435: Line 418:
 # 0x0800 VPP_RELEASE # 0x0800 VPP_RELEASE
 # 0x1000 VPP_RUN # 0x1000 VPP_RUN
-#       This rule enables shift with irq lock for GPIO BIT-BANG.+#       This rule enables shift with irq lock for GPIO BIT-BANG
 # 0x2000 BB_LOCK # 0x2000 BB_LOCK
-#       This rule re-enables the ALT0 function when an R-PI GPIO is released.+#       This rule resets any released pin to its previous function on exit (input, output or ALT).
 # 0x4000 ALT_RELEASE # 0x4000 ALT_RELEASE
-#+      This rule is for Winklepicker reset 
 +# 0x8000 TX_BREAK 
 # TTY VELLEMAN K8048 = PGD_IN_PULLUP + PGD_OUT_FLIP + PGC_OUT_FLIP + VPP_OUT_FLIP + PGD_IN_FLIP # TTY VELLEMAN K8048 = PGD_IN_PULLUP + PGD_OUT_FLIP + PGC_OUT_FLIP + VPP_OUT_FLIP + PGD_IN_FLIP
 # TTY VELLEMAN K8076 = PGD_IN_PULLUP # TTY VELLEMAN K8076 = PGD_IN_PULLUP
Line 448: Line 433:
 # TTY VELLEMAN K8076 # TTY VELLEMAN K8076
 #BITRULES=0x0010 #BITRULES=0x0010
-RASPBERRY PI VELLEMAN K8048+RPI VELLEMAN K8048
 #BITRULES=0x0010 #BITRULES=0x0010
-RASPBERRY PI GPIO +RPI GPIO 
-BITRULES=0x1000+#BITRULES=0x1000
 # MCP23017 I2C # MCP23017 I2C
 #BITRULES=0x1010 #BITRULES=0x1010
-# GPIO BIT-BANG+# GPIO-BB
 #BITRULES=0x1000 #BITRULES=0x1000
-# CHIPKIT PI PIC32 ICSP+RPI CHIPKIT PI PIC32 ICSP
 #BITRULES=0x4F00 #BITRULES=0x4F00
-HUMBLE CAN PROTOTYPE +TTY T-TYPE FLIP FLOP ON TXD FOR VPP 
-#BITRULES=0x5700+#BITRULES=0x004F
  
-# I/O busy cursor (0=DISABLED)+# I/O busy cursor speed (0=DISABLED)
 # #
-BUSY=0+#BUSY=0
  
-RASPBERRY PI VELLEMAN K8048 (README.raspi)+RPI VELLEMAN K8048 (https://wiki.kewl.org/dokuwiki/projects:k8048-rpi)
 # #
 # TX/!MCLR/VPP     - DSUB9(3) # TX/!MCLR/VPP     - DSUB9(3)
 #VPP=14 #VPP=14
 # PGM              - NOT SUPPORTED ON VELLEMAN K8048 # PGM              - NOT SUPPORTED ON VELLEMAN K8048
-#PGM=22 +#PGM=-1
-# RTS/PGC CLOCK    DSUB9(7) +
-#PGC=15 +
-# DTR/PGD DATA_OUT - DSUB9(4) +
-#PGDO=23 +
-# CTS/PGD DATA_IN  - DSUB9(8) +
-#PGDI=24 +
- +
-# RASPBERRY PI VELLEMAN K8048 (http://wiki.kewl.org/dokuwiki/boards:rpi:k8048) +
-+
-# TX/!MCLR/VPP     - DSUB9(3) +
-#VPP=14 +
-# PGM              - NOT SUPPORTED ON VELLEMAN K8048 +
-#PGM=22+
 # RTS/PGC CLOCK    - DSUB9(7) # RTS/PGC CLOCK    - DSUB9(7)
 #PGC=18 #PGC=18
Line 491: Line 463:
 #PGDI=25 #PGDI=25
  
-RASPBERRY PI GPIO (separate PGD DATA I/O)+RPI GPIO (separate PGD DATA I/O)
 #                  = SLICE OF PI/O = #                  = SLICE OF PI/O =
 # !MCLR/VPP        - PI/O G04 # !MCLR/VPP        - PI/O G04
Line 504: Line 476:
 #PGDI=23 #PGDI=23
  
-R-PI OR GPIO BIT-BANG (single PGD DATA I/O)+RPI OR GPIO-BB (single PGD DATA I/O)
 #                  = SLICE OF PI/O = #                  = SLICE OF PI/O =
 # !MCLR/VPP        - PI/O G04 # !MCLR/VPP        - PI/O G04
Line 515: Line 487:
 #PGD=24 #PGD=24
  
-R-PI OR GPIO BIT-BANG (single PGD DATA I/O) +RPI OR GPIO-BB (single PGD DATA I/O) 
-#                  = CHIPKIT PI = +#                  = CHIPKIT PI I/O 
-# !MCLR/VPP        - RPi-Connect 18 +# !MCLR/VPP        - RPI-Connect 18 
-VPP=9 +#VPP=9 
-# PGM              - RPi-Connect 12 +# PGM              - RPI-Connect 12 
-PGM=22 +#PGM=22 
-# PGC CLOCK        - RPi-Connect 16 +# PGC CLOCK        - RPI-Connect 16 
-PGC=10 +#PGC=10 
-# PGD DATA_I/    RPi-Connect 20 +# PGD DATA_I/    RPI-Connect 20 
-PGD=11+#PGD=11
  
-R-PI OR GPIO BIT-BANG (single PGD DATA I/O)+RPI OR GPIO-BB (single PGD DATA I/O)
 #                  = CHIPKIT PI PIC32 ICSP = #                  = CHIPKIT PI PIC32 ICSP =
 # !MCLR/VPP        - /RESET # !MCLR/VPP        - /RESET
Line 537: Line 509:
 #PGD=15 #PGD=15
  
-R-PI OR GPIO BIT-BANG (single PGD DATA I/O) +I2C/SPI ADDRESS
-#                  = HUMBLE CAN PROTOTYPE = +
-# !MCLR/VPP        - /RESET +
-#VPP=18 +
-# PGM              - N/A +
-#PGM=-1 +
-# PGD TXD          - PGD RX2 +
-#PGD=14 +
-# PGC RXD          - PGC TX2 +
-#PGC=15 +
- +
-# MCP23017 I2C ADDRESS (README.i2c)+
 # #
-MCP=0x20+#ADDR=0x20
  
-# ICSP I/O 1/2-bit sleep time for `kio'. +# ICSP I/O 1/2-bit sleep time for `pio'. 
-SLEEP=30+#FWSLEEP=30
  
 # Debug level (0=NONE, 1=ERROR, 10=INFO) # Debug level (0=NONE, 1=ERROR, 10=INFO)
-DEBUG=1+#DEBUG=1 
 + 
 +# PIC14-NEW, PIC16, and PIC16-NEW CONFIG MASK 
 +
 +# 1 CONFIGVER        APPLY TO VERIFY (DEFAULT) 
 +# 2 CONFIGAND        APPLY TO DUMP   (DEFAULT) 
 +# 4 CONFIGSET        APPLY TO WRITE 
 +
 +# DOES NOT APPLY TO PIC18J SERIES 
 +
 +#CONFIG=0 # DISABLED
 </code> </code>
  
-== FreeBSD using a Velleman K8048 with a serial UART ==+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\ 
 + 
 +=== Example configuration === 
 + 
 +<BOOKMARK:bananapi> 
 +== Linux AllWinner Banana Pi (A20) ==
  
 <code> <code>
-DEVICE=/dev/ttyu0 +DEVICE=BPI 
-SLEEP=0 +SLEEP=1 
-BITRULES=0x001F +BITRULES=0x1000 
-BUSY=0+VPP=270 
 +PGM=-1 
 +PGC=266 
 +PGD=272
 </code> </code>
  
-== RPi version 1 using a Velleman K8048 with a 74HC03 ==+<BOOKMARK:orangepi0> 
 +== Linux AllWinner Orange Pi 0 (H2+) ==
  
 <code> <code>
-DEVICE=RPI +DEVICE=OPI0 
-SLEEP=10 +BITRULES=0x1000 
-BITRULES=0x0010 +SLEEP=1 
-VPP=14 +VPP=12 
-PGC=18 +PGC=11 
-PGDO=24 +PGD=6 
-PGDI=2+PGM=-1
 </code> </code>
  
-== Cygwin for Windows using a Velleman K8048 with an Intek21 PCI IO 2S-550 Board ==+<BOOKMARK:linuxcp2104> 
 +== Linux CP2104 GPIO ==
  
 <code> <code>
-DEVICE=/dev/ttyS2+
 +# IO0 ---------> MCLR 
 +# IO1 ---------> PGC 
 +# IO2 ---390R--> PGD 
 +# IO3 <--390R--- PGD 
 +
 +# /dev/ttyUSB0 
 +
 +DEVICE=CP2104 
 +IFACE=/dev/ttyUSB0 
 +BITRULES=0x1000 
 +VPP=0 
 +PGC=1 
 +PGDO=2 
 +PGDI=3 
 +</code> 
 + 
 +<BOOKMARK:linuxftdi> 
 +== Linux FTDI USB bit-bang == 
 + 
 +<code> 
 +# DB0 TXD 
 +# DB1 RXD 
 +# DB2 RTS# 
 +# DB3 CTS# 
 +# DB4 DTR# 
 +# DB5 DSR# 
 +# DB6 DCD# 
 +# DB7 RI# 
 +DEVICE=FTDI 
 +IFACE=0 
 +BITRULES=0x1000
 SLEEP=0 SLEEP=0
-BITRULES=0x001F +VPP=0 
-BUSY=0+PGC=1 
 +PGD=3 
 +PGM=-1 # DISABLED 
 +DEBUG=0
 </code> </code>
  
-== RPi version 1 GPIO Low Voltage Programming (LVP) with PGM ==+<BOOKMARK:linuxgpiobb> 
 +== Linux GPIO bit-bang ==
  
 <code> <code>
-DEVICE=RPI+DEVICE=GPIO-BB 
 +IFACE=/dev/gpio-bb
 SLEEP=1 SLEEP=1
-BITRULES=0x0000 +BITRULES=0x1000 
-VPP=4+VPP=9
 PGM=22 PGM=22
-PGC=25 +PGC=10 
-PGDO=24 +PGD=11
-PGDI=23+
 </code> </code>
  
-== RPi version 2 GPIO Low Voltage Programming (LVP) without PGM ==+<BOOKMARK:linuxmcp2221> 
 +== Linux MCP2221 GPIO ==
  
 <code> <code>
-DEVICE=RPI2+
 +# GP3 PGDI <---------- PGD 
 +# GP2 VPP  ----------> MCLR 
 +# GP1 PGC  ----------> PGC 
 +# GP0 PGDO ----1K----> PGD 
 +
 +DEVICE=MCP2221 
 +BITRULES=0x1000 
 +SLEEP=0 
 +PGDI=3 
 +VPP=2 
 +PGC=1 
 +PGDO=0 
 +PGM=-1  # N/A 
 +</code> 
 + 
 +<BOOKMARK:linuxmcp23016> 
 +== Linux MCP23016 I2C == 
 + 
 +<code> 
 +VPP=0 
 +PGC=1 
 +PGDO=2 
 +PGDI=3 
 +PGM=-1 
 +DEVICE=MCP23016 
 +IFACE=/dev/i2c-1 
 +ADDR=0x20 
 +SLEEP=0 
 +#VPP_RUN + PGD_IN_PULLUP 
 +BITRULES=0x1010 
 +</code> 
 + 
 +<BOOKMARK:linuxmcp230xx> 
 +== Linux MCP23008/17 I2C == 
 + 
 +<code> 
 +VPP=0 
 +PGC=1 
 +PGDO=2 
 +PGDI=3 
 +PGM=-1 
 +DEVICE=MCP230XX 
 +IFACE=/dev/i2c-1 
 +ADDR=0x20 
 +SLEEP=0 
 +#VPP_RUN + PGD_IN_PULLUP 
 +BITRULES=0x1010 
 +</code> 
 + 
 +<BOOKMARK:linuxmcp23sxx> 
 +== Linux MCP23S08/17 SPI == 
 + 
 +<code> 
 +VPP=0 
 +PGC=1 
 +PGDO=2 
 +PGDI=3 
 +PGM=-1 
 +DEVICE=MCP23SXX 
 +IFACE=/dev/spidev0.0 
 +ADDR=0x20 
 +SLEEP=0 
 +#VPP_RUN + PGD_IN_PULLUP 
 +BITRULES=0x1010 
 +BAUDRATE=1000000 
 +</code> 
 + 
 +<BOOKMARK:linuxpcf8574> 
 +== Linux PCF8574 I2C == 
 + 
 +<code> 
 +VPP=0 
 +PGDI=1 
 +PGDO=1 
 +PGC=2 
 +PGM=-1 
 +DEVICE=PCF8574 
 +IFACE=/dev/i2c-1 
 +ADDR=0x20 
 +SLEEP=0 
 +#VPP_RUN + PGC_RELEASE + PGD_RELEASE + PGD_IN_PULLUP 
 +BITRULES=0x1310 
 +</code> 
 + 
 +<BOOKMARK:rpi1> 
 +== Linux RPi 1 GPIO == 
 + 
 +<code> 
 +DEVICE=RPI1
 SLEEP=1 SLEEP=1
-BITRULES=0x4F00+BITRULES=0x1000
 VPP=9 VPP=9
 PGM=-1 PGM=-1
Line 614: Line 720:
 </code> </code>
  
-== Linux MCP23017 I2C LVP ==+<BOOKMARK:rpi4> 
 +== Linux RPi 4 GPIO ==
  
 <code> <code>
-DEVICE=I2C+DEVICE=RPI # AUTO-DETECT
 SLEEP=1 SLEEP=1
-BITRULES=0x0010 +BITRULES=0x1000 
-MCP=0x20+VPP=
 +PGM=-1 
 +PGC=10 
 +PGD=11
 </code> </code>
  
-== Linux FTDI bit-bang LVP ==+<BOOKMARK:k8048tty> 
 +== POSIX Serial bit-bang ===
  
-<code># TX  0 +Velleman K8048 
-# RX  1 + 
-# RTS 2 +<code> 
-# CTS 3 +DEVICE=TTY 
-# DTR 4 +IFACE=/dev/ttyS0
-# DSR 5 +
-# DCD 6 +
-# RI  7 +
-DEVICE=FTDI +
-BITRULES=0x1000+
 SLEEP=1 SLEEP=1
-VPP=+BITRULES=0x001F
-PGC=1 +
-PGD=3 +
-PGM=-1  # DISABLED+
 </code> </code>
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\ 
 + 
 +=== Programming Executive ===
  
-=== Advanced configuration === 
 <wrap right> <wrap right>
 {{:projects:pickle:pic32icsp.jpg?200|Pi Zero programming PIC32MX}} {{:projects:pickle:pic32icsp.jpg?200|Pi Zero programming PIC32MX}}
Line 653: Line 757:
 This software is loaded into the chip to speed up ICSP. This software is loaded into the chip to speed up ICSP.
  
-Pickle supports ICSP with the programming executive (PE) on the PIC32 but not +Pickle supports ICSP with the programming executive (PE) on the PIC32 but not the dsPIC/PIC24 devices. Currently there are no plans to add PE support for the dsPIC/PIC24.
-the dsPIC/PIC24 devices. Currently there are no plans to add PE support for the +
-dsPIC/PIC24.+
  
 By default, PIC32 PE mode is not enabled and a few steps must be completed to activate this mode of operation. By default, PIC32 PE mode is not enabled and a few steps must be completed to activate this mode of operation.
Line 681: Line 783:
 </code> </code>
    
-A file named RIPE_11_000301.hex will now exist in the .pickle directory. When +A file named RIPE_11_000301.hex will now exist in the .pickle directory. When we use p32, and it finds this file, it will automatically load it into the chip.
-we use p32, and it finds this file, it will automatically load it into the chip.+
  
-The following PE files are all that's required for the PIC32MX range of micros.+The following PE files are all that's required for the PIC32 range of PICMicros.
  
-^ md5sum ^filename |+^ md5sum ^filename ^
 |2662befb94584d40b905a9040a9ed2f4 |RIPE_06_000201.hex| |2662befb94584d40b905a9040a9ed2f4 |RIPE_06_000201.hex|
 |4cb8f6492b1234a45c92979a36d91587 |RIPE_11_000301.hex| |4cb8f6492b1234a45c92979a36d91587 |RIPE_11_000301.hex|
 |aea1a950b72471e54b82852b93105d6a |RIPE_15_000502.hex| |aea1a950b72471e54b82852b93105d6a |RIPE_15_000502.hex|
 +|bb462553082999b4bd8b4e94154fd0d7 |RIPE_20a_000510.hex|
 +|903282c9b4966817b7d7ee961c60cff4 |RIPE_20b_000510.hex|
  
 To test that the PE has been registered correctly, we can issue the id command, To test that the PE has been registered correctly, we can issue the id command,
Line 696: Line 799:
  
 <code> <code>
-p32 id+p32 id
 [1D000000] [PROGRAM]  00008000 WORDS [1D000000] [PROGRAM]  00008000 WORDS
 [1F80F220] [DEVICEID] 14D06053 PIC32MX150F128B [1F80F220] [DEVICEID] 14D06053 PIC32MX150F128B
Line 712: Line 815:
 and 5.5 seconds with it. and 5.5 seconds with it.
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
 === Running the application === === Running the application ===
Line 726: Line 829:
  
 FILES: FILES:
- /home/darron/.pickle + /home/darron/.pickle/config 
-                Configuration.+                Configuration file. 
 + 
 +ENVIRONMENT: 
 + PICKLE 
 +                Configuration file.
  
 FRONTENDS: FRONTENDS:
- FILE + INHX32 
-                File input (INHX32 format)+                File or standard input. 
- STDIN + STK500 
-                Standard input (INHX32 format). +                POSIX serial or network input.
- TTY +
-                POSIX serial I/O.+
  
 BACKENDS: BACKENDS:
- BIT-BANG+ BPI/OPI 
 +                Linux AllWinner Banana Pi (A20) and Orange Pi (H2+/H3) GPIO. 
 + CP2104 
 +                Linux CP2104 GPIO. 
 + FTDI 
 +                Linux FTDI USB bit-bang. 
 + GPIO-BB
                 Linux GPIO bit-bang version 1.3.                 Linux GPIO bit-bang version 1.3.
- FTDI BIT-BANG + MCP2221 
-                Linux FTDI bit-bang+                Linux MCP2221 GPIO
- MCP23017 + MCP23016 
-                Linux MCP23017 I2C.+                Linux MCP23016 I2C. 
 + MCP230XX 
 +                Linux MCP23008/17 I2C. 
 + MCP23SXX 
 +                Linux MCP23S08/17 SPI. 
 + PCF8574 
 +                Linux PCF8574 I2C.
  RPI  RPI
-                Raspberry Pi GPIO.+                Linux Raspberry Pi GPIO (Pi0/Pi1/Pi2/Pi3/Pi4).
  TTY  TTY
-                POSIX serial I/O. +                POSIX Serial bit-bang.
- +
-ENVIRONMENT: +
- PICKLE +
-                Configuration file.+
  
 EXAMPLES: EXAMPLES:
Line 764: Line 877:
  n16 [LVP] OPERATION [ARG]  n16 [LVP] OPERATION [ARG]
                 16-bit word PIC18F operations.                 16-bit word PIC18F operations.
- p24 [SELECT DEVICE] [LVP|HVP] OPERATION [ARG]+ p24 [SELECT|PARTITION DEVICE] [LVP|HVP] OPERATION [ARG]
                 24-bit word PIC24/dsPIC operations.                 24-bit word PIC24/dsPIC operations.
  p32 OPERATION [ARG]  p32 OPERATION [ARG]
Line 770: Line 883:
  pctrl RUN|STOP|RESTORE  pctrl RUN|STOP|RESTORE
                 Control master clear.                 Control master clear.
- pload PROGRAM|VERIFY TTY|IP FILE [16]+ pio COMMAND [ARG] 
 +                ICSPIO operations. 
 + pload PROGRAM|VERIFY TTY|IP FILE [16|24|32]
                 Program or verify file on TTY or network.                 Program or verify file on TTY or network.
  ptest TEST [ARG]  ptest TEST [ARG]
Line 776: Line 891:
  
 VERSION: VERSION:
- 4.0f+ 5.01
 </code> </code>
  
Line 789: Line 904:
  
 FILES: FILES:
- /home/darron/.pickle + /home/darron/.pickle/config 
-                Configuration.+                Configuration file.
  
 ENVIRONMENT: ENVIRONMENT:
Line 798: Line 913:
 EXAMPLES: EXAMPLES:
  p12 select  p12 select
-                Dump supported devices.+                Show supported devices.
  p12 select PIC1XFXXX blank  p12 select PIC1XFXXX blank
                 Blank device (disable protection and bulk erase).                 Blank device (disable protection and bulk erase).
Line 819: Line 934:
  p12 select PIC1XFXXX verify [file.hex]  p12 select PIC1XFXXX verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- p12 select PIC1XFXXX view [file.hex]+ p12 select PIC1XFXXX view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  p12 select PIC1XFXXX /dev/ttyUSB0 | 8048  p12 select PIC1XFXXX /dev/ttyUSB0 | 8048
Line 825: Line 940:
  
 VERSION: VERSION:
- 4.0+ 5.0
 </code> </code>
  
Line 838: Line 953:
  
 FILES: FILES:
- /home/darron/.pickle + /home/darron/.pickle/config 
-                Configuration.+                Configuration file.
  
 ENVIRONMENT: ENVIRONMENT:
Line 847: Line 962:
 EXAMPLES: EXAMPLES:
  p14 select  p14 select
-                Dump supported devices.+                Show supported devices.
  p14 select 16F84 OPERATION [ARG]  p14 select 16F84 OPERATION [ARG]
                 Select device PIC16F84.                 Select device PIC16F84.
Line 868: Line 983:
  p14 id  p14 id
                 Display device identification.                 Display device identification.
 + p14 loader
 +                Output boot loader configuration.
  p14 osccal  p14 osccal
                 Display oscillator calibration.                 Display oscillator calibration.
Line 876: Line 993:
  p14 verify [file.hex]  p14 verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- p14 view [file.hex]+ p14 view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  p14 /dev/ttyUSB0 | 8048  p14 /dev/ttyUSB0 | 8048
Line 882: Line 999:
  
 VERSION: VERSION:
- 4.0+ 5.0
 </code> </code>
  
Line 904: Line 1021:
 EXAMPLES: EXAMPLES:
  n14 select  n14 select
-                Dump supported devices.+                Show supported devices.
  n14 lvp OPERATION [ARG]  n14 lvp OPERATION [ARG]
                 LVP 32-bit key entry.                 LVP 32-bit key entry.
Line 919: Line 1036:
  n14 id  n14 id
                 Display device identification.                 Display device identification.
 + n14 loader
 +                Output boot loader configuration.
  n14 program [file.hex] [noblank]  n14 program [file.hex] [noblank]
                 Blank and program file.hex or stdin to flash (INHX32 format).                 Blank and program file.hex or stdin to flash (INHX32 format).
  n14 verify [file.hex]  n14 verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- n14 view [file.hex]+ n14 view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  n14 /dev/ttyUSB0 | 8048  n14 /dev/ttyUSB0 | 8048
Line 929: Line 1048:
  
 VERSION: VERSION:
- 4.0f+ 5.0
 </code> </code>
  
Line 942: Line 1061:
  
 FILES: FILES:
- /home/darron/.pickle + /home/darron/.pickle/config 
-                Configuration.+                Configuration file.
  
 ENVIRONMENT: ENVIRONMENT:
Line 951: Line 1070:
 EXAMPLES: EXAMPLES:
  p16 select  p16 select
-                Dump supported devices.+                Show supported devices.
  p16 select 18LF2539 OPERATION [ARG]  p16 select 18LF2539 OPERATION [ARG]
                 Select device PIC18LF2539.                 Select device PIC18LF2539.
Line 972: Line 1091:
  p16 id  p16 id
                 Display device identification.                 Display device identification.
 + p16 loader
 +                Output boot loader configuration.
  p16 program [file.hex] [noblank]  p16 program [file.hex] [noblank]
                 Blank and program file.hex or stdin to flash (INHX32 format).                 Blank and program file.hex or stdin to flash (INHX32 format).
  p16 verify [file.hex]  p16 verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- p16 view [file.hex]+ p16 view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  p16 /dev/ttyUSB0 | 8048  p16 /dev/ttyUSB0 | 8048
Line 982: Line 1103:
  
 VERSION: VERSION:
- 4.0+ 5.0
 </code> </code>
  
Line 1004: Line 1125:
 EXAMPLES: EXAMPLES:
  n16 select  n16 select
-                Dump supported devices.+                Show supported devices.
  n16 lvp OPERATION [ARG]  n16 lvp OPERATION [ARG]
                 LVP 32-bit key entry.                 LVP 32-bit key entry.
Line 1019: Line 1140:
  n16 id  n16 id
                 Display device identification.                 Display device identification.
 + n16 loader
 +                Output boot loader configuration.
  n16 program [file.hex] [noblank]  n16 program [file.hex] [noblank]
                 Blank and program file.hex or stdin to flash (INHX32 format).                 Blank and program file.hex or stdin to flash (INHX32 format).
  n16 verify [file.hex]  n16 verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- n16 view [file.hex]+ n16 view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  n16 /dev/ttyUSB0 | 8048  n16 /dev/ttyUSB0 | 8048
Line 1029: Line 1152:
  
 VERSION: VERSION:
- 4.0f+ 5.0
 </code> </code>
  
Line 1036: Line 1159:
 <code> <code>
 $ p24 $ p24
-USAGE: p24 [SELECT DEVICE] [LVP|HVP] OPERATION [ARG]+USAGE: p24 [SELECT|PARTITION DEVICE] [LVP|HVP] OPERATION [ARG]
 24-bit word PIC24/dsPIC operations. 24-bit word PIC24/dsPIC operations.
  
Line 1042: Line 1165:
  
 FILES: FILES:
- /home/darron/.pickle + /home/darron/.pickle/config 
-                Configuration.+                Configuration file.
  
 ENVIRONMENT: ENVIRONMENT:
Line 1051: Line 1174:
 EXAMPLES: EXAMPLES:
  p24 select  p24 select
-                Dump supported devices.+                Show supported devices.
  p24 select 33EP128GP502 OPERATION [ARG]  p24 select 33EP128GP502 OPERATION [ARG]
                 Select device dsPIC33EP128GP502.                 Select device dsPIC33EP128GP502.
  p24 select 24FJ128GB202 OPERATION [ARG]  p24 select 24FJ128GB202 OPERATION [ARG]
                 Select device PIC24FJ128GB202.                 Select device PIC24FJ128GB202.
 + p24 partition 33EP64GS502 OPERATION [ARG]
 +                Select and partition device dsPIC33EP64GS502.
  p24 lvp OPERATION [ARG]  p24 lvp OPERATION [ARG]
                 LVP 32-bit key entry.                 LVP 32-bit key entry.
Line 1074: Line 1199:
  p24 id  p24 id
                 Display device identification.                 Display device identification.
 + p24 loader
 +                Output boot loader configuration.
  p24 program [file.hex] [noblank]  p24 program [file.hex] [noblank]
                 Blank and program file.hex or stdin to flash (INHX32 format).                 Blank and program file.hex or stdin to flash (INHX32 format).
  p24 verify [file.hex]  p24 verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- p24 view [file.hex]+ p24 view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  p24 /dev/ttyUSB0 | 8048  p24 /dev/ttyUSB0 | 8048
Line 1084: Line 1211:
  
 VERSION: VERSION:
- 4.0+ 5.0
 </code> </code>
  
Line 1097: Line 1224:
  
 FILES: FILES:
- /home/darron/.pickle+ /home/darron/.pickle/config
                 Configuration file.                 Configuration file.
  
Line 1106: Line 1233:
 EXAMPLES: EXAMPLES:
  p32 select  p32 select
-                Dump supported devices.+                Show supported devices.
  p32 boot [n] [address]  p32 boot [n] [address]
                 Display all or n words of boot flash content from address.                 Display all or n words of boot flash content from address.
Line 1123: Line 1250:
  p32 verify [file.hex]  p32 verify [file.hex]
                 Verify file.hex or stdin in flash (INHX32 format).                 Verify file.hex or stdin in flash (INHX32 format).
- p32 view [file.hex]+ p32 view [file.hex] [raw]
                 View file.hex or stdin (INHX32 format).                 View file.hex or stdin (INHX32 format).
  p32 /dev/ttyUSB0 | 8048  p32 /dev/ttyUSB0 | 8048
Line 1129: Line 1256:
  
 VERSION: VERSION:
- 4.0+ 5.0
 </code> </code>
  
-== ptestPerform various hardware and communication tests ==+== pctrlControl master clear on GPIO ==
  
 <code> <code>
-ptest +pctrl 
-USAGE: ptest TEST ARG +USAGE: pctrl RUN|STOP|RESTORE [BEFORE][AFTER][DURATION] 
-Hardware tests.+Control master clear.
  
-Error: Missing args.+Error: Missing arg.
  
 FILES: FILES:
- /home/darron/.pickle + /home/darron/.pickle/config 
-                Configuration.+                Configuration file.
  
 ENVIRONMENT: ENVIRONMENT:
  PICKLE  PICKLE
                 Configuration file.                 Configuration file.
 +
 +COMMANDS:
 + RUN            Raise master clear to take the device out of reset.
 + STOP           Lower master clear to put the device into reset.
 + RESTORE        Lower then raise master clear to reset the device.
 +
 +ARGUMENTS:
 + BEFORE         Delay in milliseconds before command.
 + AFTER          Delay in milliseconds after command.
 + DURATION       Duration of reset for RESTORE command.
 +
 +DEFAULTS:
 + BEFORE         0ms.
 + AFTER          0ms.
 + DURATION       10ms.
  
 EXAMPLES: EXAMPLES:
- ptest VPP|PGC|PGD|PGM 5 + pctrl RUN 10 
-                VPP, PGC, PGD or PGM LOW->HIGH->LOW output test with 5 seconds mark time. +                Wait 10ms then raise master clear to take the device out of reset
- ptest 0 10 + pctrl STOP 0 10 
-                PGD input test with 10 iterations of 1 second per step+                Lower master clear to put the device into reset then wait 10ms
- ptest 1 10 + pctrl RESTORE 0 0 100 
-                D-SUB-9 test with 10 seconds per step+                Lower for 100ms then raise master clear to reset the device.
- ptest 2 10 +
-                ICSP test with 10 seconds per step. +
- ptest 3 0 +
-                D-SUB-9 RTS 7 (PGC) DTR 4 (PGD) test with no mark time. +
- ptest 3 1 +
-                D-SUB-9 RTS 7 (PGC) DTR 4 (PGD) test with SLEEP mark time. +
- ptest 3 100 +
-                D-SUB-9 RTS 7 (PGC) DTR 4 (PGD) test with 100 microseconds mark time. +
- ptest 4 100 +
-                16F627 debug test with 100 microseconds clock mark time. +
- ptest 5 100 +
-                ICSPIO test with 100 microseconds clock mark time. +
- ptest 6 10 +
-                RPi GPIO test with 10 seconds mark time.+
  
 VERSION: VERSION:
- 4.0f+ 5.0
 </code> </code>
  
-== pctrlControl master clear on GPIO (R-PI or OpenWRT) ==+== pioPerform ICSPIO operations ==
  
 <code> <code>
-pctrl +pio 
-USAGE: pctrl RUN|STOP|RESTORE +USAGE: pio COMMAND [ARG] 
-Control master clear.+ICSPIO operations.
  
-Error: Missing arg.+Error: Missing arg(s).
  
 FILES: FILES:
- /home/darron/.pickle+ /home/darron/.pickle/config
                 Configuration.                 Configuration.
  
Line 1191: Line 1319:
  PICKLE  PICKLE
                 Configuration file.                 Configuration file.
 +
 +COMMANDS:
 + LED            0x00..0x3F              Set Velleman K8048 LEDs.
 + SWITCH                                 Get Velleman K8048 switches.
 + SLEEP                                  Sleep until watchdog time-out.
 + WATCHDOG       E|D                     Set watchdog enable/disable.
 + CLOCK          0..7                    Set internal RC clock divider.
 + DIRECTION      A..D|G 0x00..0xFF       Set port data direction.
 + OUTPUT         A..D|G 0x00..0xFF       Set port data output.
 + INPUT          A..D|G                  Get port data input, output on stdout.
 + ANALOG         0..N|D                  Set analog channel enable/disable.
 + SAMPLE                                 Get analog channel input.
 + EEREAD         0x00..0xFF              Get data EEPROM.
 + EEWRITE        0x00..0xFF 0x00..0xFF   Set data EEPROM.
 + READ           0x0000..0xFFFF          Get program flash.
 + VREF           0..15|D                 Set vref voltage level or disable.
 +              0..0xFF                 Send an 8-bit arg & get an 8-bit answer.
 + 16             0..0xFFFF               Send a 16-bit arg & get an 8-bit answer.
 + 24             0..0xFFFFFF             Send a 24-bit arg & get an 8-bit answer.
 + 32             0..0xFFFFFFFF           Send a 32-bit arg & get an 8-bit answer.
 + TEST           0..0xFF                 Send an 8-bit test arg & get no reply.
 + ERROR                                  Get last firmware error.
  
 EXAMPLES: EXAMPLES:
- pctrl RUN + pio WATCHDOG D 
-                Raise master clear to take the device out of reset+                Turn off watchdog
- pctrl STOP + pio DIRECTION C 0xF0 
-                Lower master clear to put the device in reset+                Set port C bits 0..3 as output and bits 4..7 as input
- pctrl RESTORE + pio OUTPUT C 0x0A 
-                Lower then raise master clear to reset the device.+                Set port C bits 0..3 to 0x0A.
  
 VERSION: VERSION:
- 4.0+ 5.0
 </code> </code>
  
Line 1229: Line 1379:
                 Program stdin (INHX32 format) on 192.168.1.100 port 8048.                 Program stdin (INHX32 format) on 192.168.1.100 port 8048.
  pload program /dev/ttyAMA0 led.hex 24  pload program /dev/ttyAMA0 led.hex 24
-                Program led.hex (INHX32 format) on /dev/ttyAMA0 using 24-bit boot loader addressing.+                Program led.hex (INHX32 format) on /dev/ttyAMA0 using 24-bit addressing
 + 
 +VERSION: 
 + 5.0 
 +</code> 
 + 
 +== ptest: Perform various hardware and communication tests == 
 + 
 +<code> 
 +$ ptest 
 +USAGE: ptest TEST ARG 
 +Hardware tests. 
 + 
 +Error: Missing args. 
 + 
 +FILES: 
 + /home/darron/.pickle/config 
 +                Configuration file. 
 + 
 +ENVIRONMENT: 
 + PICKLE 
 +                Configuration file. 
 + 
 +EXAMPLES: 
 + ptest VPP|PGC|PGD|PGM 5 
 +                VPP, PGC, PGD or PGM LOW->HIGH->LOW output test with 5 seconds mark time. 
 + ptest INPUT 10 
 +                PGD input test with 10 iterations of 1 second per step. 
 + ptest DSUB9 10 
 +                D-SUB-9 test with 10 seconds per step. 
 + ptest ICSP 10 
 +                ICSP test with 10 seconds per step. 
 + ptest CLOCK 0 
 +                PGC/RTS(7) clock test with no mark time. 
 + ptest CLOCK 10 
 +                PGC/RTS(7) clock test with 10us mark time. 
 + ptest 16F627 100 
 +                PIC16F627 debug test with 100us clock mark time. 
 + ptest ICSPIO 100 
 +                ICSPIO test with 100us clock mark time. 
 + ptest RPI 10 
 +                RPI GPIO test with 10 seconds mark time. 
 + ptest ALLWINNER 10 
 +                BPI/OPI GPIO test with 10 seconds mark time.
  
 VERSION: VERSION:
- 4.0+ 5.01
 </code> </code>
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\
  
 === Using the Application === === Using the Application ===
Line 1271: Line 1464:
 == PIC16F627 debug assembly test mode == == PIC16F627 debug assembly test mode ==
 <code> <code>
-ptest 100+ptest 16f627 100
  
-TEST MODE 4 [16F627 debug.asmCTRL-C TO STOP+TEST 16F627 debug.asm [CTRL-C TO STOP]
  
 io_test4: read byte: 02 . io_test4: read byte: 02 .
Line 1383: Line 1576:
 I hope you enjoy using this application, good luck. I hope you enjoy using this application, good luck.
  
-~~UP~~+<wrap right>[[projects:pickle#pickle_microchip_pic_icsp|TOC]]</wrap>\\