PICP Users Manual
Linux (and Windows) Interface to PICSTART Plus and Warp-13 programmers
Copyright 2004 by Jeffery L. Post
Version 0.6.4 - October, 2004
GNU General Public License
TABLE OF CONTENTS
Introduction
Picp is a Linux (and Windows) command line interface to
Microchip's PICSTART Plus and
Newfound Electronic's Warp-13 PIC programmers. Originally written by
Andrew Pines, picp is now maintained by
Jeff Post and the latest version can be downloaded from
here.
Thanks to Jim Robertson of
Newfound Electronics, who generously donated a Warp-13a programmer and
technical advice so that picp would work with both the Warp-13 and PICSTART
Plus programmers.
Picp is licensed under the GNU General Public License.
Command Line Interface
Usage:
picp [-c] [-d] [-v] ttyname devtype [-i] [-h] [-q] [-v] [-s [size]] [-b|-r|-w|-e][pcidof]
where:
ttyname is the serial (or USB) device the PICSTART or Warp-13 is attached to
(e.g. /dev/ttyS0 or com1)
devtype is the pic device to be used (12C508, 16C505, etc.)
-b blank checks the requested region or regions
-c enable comm line debug output to picpcomm.log (must be before ttyname)
-d (if only parameter) show device list
-e erases the requested region (flash parts only)
-f ignores verify errors while writing
-h show this help
-i use ISP protocol (must be first option after devtype)
-q sets quiet mode (excess messages supressed)
-r initiates a read (Intel Hex record format)
-s [size] shows a hash mark status bar of length [size] while erasing/writing
-w writes to the requested region
-wpx will suppress actual writing to program space (for debugging picp)
-v shows PICSTART Plus version number
-v (if only parameter) show picp version number
Read/Write/Erase parameters:
p [filename] = program memory, optionally reading/writing filename
c [val] = configuration bits (val is a numeric word value when writing)
i [val] = ID locations
d [filename] = data memory, optionally reading/writing filename
o [val] = oscillator calibration space
f = entire flash device (only applies to -e, erase)
filename is an optional input or output file (default is stdin/stdout)
Example:
picp -c /dev/ttyS1 16f84 -wp widget.hex
Programs a 16F84 device with the program in the file widget.hex using the ttyS1
serial port, and writes comm line debug information in the file picpcomm.log.
*The -i option causes picp to use a slightly different protocol for communicating
with the Warp-13 programmer when programming 18fxxx chips connected to the ISP
port of the Warp-13. This appears to be necessary only when using BluePole
firmware version 1.5. Use this option only if you experience problems without it.
Back to top
Comm Protocol
This is a summary of the Picstart Plus (Warp-13) protocol known as of
July, 2004. This information is the result of tests performed by Andrew
Pines, Gabor Kiss, and Jeff Post. It is believed to be accurate, but
there are no guarantees.
-> shows data from the computer to the PS+/Warp-13.
<- shows data from the PS+/Warp-13 to the computer.
... means a repetition.
-------------------------------------------------------------------------------
Picstart Plus commands in numerical order:
(Only those with a name, eg CMD_BLANK_CHECK, are used by picp)
CMD_BLANK_CHECK 'B'
0x42 | -> | Blank check full |
| <- | 0x42 |
| <- | status |
0x43 | -> | Diagnostics |
| <- | 0xdd |
subcode | -> | |
| <- | echo |
0x44 | -> | Blank check partial |
| <- | 0x44 |
| <- | status |
CMD_WRITE_PGM 'Q'
0x51 | -> | Write program |
| <- | 0x51 |
word to write | -> | |
| <- | word read back |
| ... | |
| <- | status |
CMD_READ_PGM 'T'
0x54 | -> | Read program |
| <- | 0x54 |
| <- | word read |
| ... | |
| <- | status |
CMD_READ_OSC 'c'
0x63 | -> | Read calibration values |
| <- | 0x63 |
| <- | word read |
| ... | |
| <- | status |
CMD_READ_DATA 'd'
0x64 | -> | Read data |
| <- | 0x64 |
| <- | byte read |
| ... | |
| <- | status |
CMD_READ_ID 'e'
0x65 | -> | Read ID |
| <- | 0x65 |
| <- | word read |
| ... | |
| <- | status |
CMD_READ_CFG 'f'
0x66 | -> | Read config |
| <- | 0x66 |
| <- | word read |
| ... | |
| <- | status |
CMD_WRITE_CFG 'g'
0x67 | -> | Write config |
| <- | 0x67 |
word to write | -> | |
| <- | each word echoed back |
| ... | |
| <- | status |
CMD_WRITE_ID 'h'
0x68 | -> | Write ID |
| <- | 0x68 |
word to write | -> | |
| <- | word read back |
| ... | |
| <- | status |
CMD_WRITE_DATA 'i'
0x69 | -> | Write data |
| <- | 0x69 |
byte to write | -> | |
| <- | byte read back |
| ... | |
| <- | status |
CMD_WRITE_CFG_WORD 'p'
0x70 | -> | Write one config word |
| <- | 0x70 |
word to write | -> | |
| <- | word read back |
| <- | status |
(For 18xxx chips only. Each word must be preceeded by 'set range'.)
CMD_WRITE_OSC 'q'
0x71 | -> | Write calibration values |
| <- | 0x71 |
word to write | -> | |
| <- | word read back |
| ... | |
| <- | status |
0x80 | -> | Get processor info length |
| <- | 0x80 |
| <- | 0x2c (44) |
CMD_LOAD_INFO
0x81 | -> | Load processor info |
| <- | 0x81 |
44 bytes | -> | |
chksum | -> | |
| <- | status |
CMD_LOAD_EXT_INFO
0x82 | -> | Load extended config masks |
| <- | 0x82 |
8+8 words | -> | |
chksum | -> | |
| <- | status |
CMD_REQUEST_MODEL
0x88 | -> | Ping |
| <- | 0xab response identifying PS+ (or Warp-13) |
CMD_REQUEST_VERSION
0x8d | -> | Get version |
| <- | 0x8d |
| <- | major |
| <- | middle |
| <- | minor |
CMD_SET_ADDR
0x8e | -> | Set range |
| <- | 0x8e |
5 bytes | -> | send each byte |
| <- | each byte echoed |
| ... | |
CMD_ERASE_FLASH
0x8f | -> | Erase flash device |
| <- | 0x8f |
| <- | status |
0x90 | -> | Compute program checksum |
| <- | 0x90 |
| <- | checksum_h |
| <- | checksum_l |
| <- | status |
0x91 | -> | Compute config checksum |
| <- | 0x91 |
| <- | checksum_h |
| <- | checksum_l |
| <- | status |
0x92 | -> | Compute ID checksum |
| <- | 0x92 |
| <- | checksum_h |
| <- | checksum_l |
| <- | status |
0x93 | -> | Compute data checksum |
| <- | 0x93 |
| <- | checksum_h |
| <- | checksum_l |
| <- | status |
0x94 | -> | Compute cal checksum |
| <- | 0x94 |
| <- | checksum_h |
| <- | checksum_l |
| <- | status |
Back to top
Known Issues
Some data in picdev.c is known to be incorrect (but what the correct data should
be is not known). If you have problems with a particular PIC device, you may have
to completely erase the device (-ef for flash devices) before programming it.
If you know the correct data for some device, please notify the author at
'j_post <AT> pacbell <DOT> net'.
Support for 18Fxxx devices has been tested only with a 18f458 chip. Bug reports
regarding 18fxxx chips will be greatly appreciated. Please email a zip or gz file
with the picpcomm.log file and any other information relevant to the problem.
Some picp commands (-ep for example) don't work with 18fxxx chips. Analysis of
the comm line protocol indicates that picp is sending the correct information to
the programmer, and the programmer responds properly, yet the command has no
effect. It is not known at this time whether this is a 'feature' of 18fxxx chips
or a deficiency in the programmer.
Many functions have still not been implemented. Work is continuing on these
issues. Please send bug reports and feature wish lists to the author at the
above email address. Comments on this documentation are also appreciated.
Back to top