.de FN \fI\|\\$1\|\fP .. .TH progM01 3 "Mon 29 Mar 2003" "Linux" "World Power Systems" .UC 4 .SH NAME progM01 \- WPS Model A1 Programmer Adapter host software See \fBOVERVIEW\fR and \fBTECHNICAL INFORMATION\fR sections of this man page for further information. .SH SYNOPSYS .B progM01 {command} {options} COMMANDS -- one of these is required -p file Program PIC with contents of file (erases first). -e Bulk-erase PIC, only. -r Reset the target device. -m Read contents of PIC to stdout. -a Test for presence of A1 Programmer and target PIC, only. OPTIONS -c Make additional verify pass after -p programming. -z List all errors, even if they run off the screen. -t device Output to device (default /dev/ttyS0). -b nnn Bit rate when -t used (default 115200). -v Verbosity in all things, including config register. -h This usage. .SH DESCRIPTION .PP \fBprogM01\fR is a companion to the WPS Model A1 Programmer and Model 01a Control Engine. A serial interface is required on the host machine. In turn, the A1 Adapter could be used with any compatible Microchip Inc PIC in-circuit-programming circuit. The Model A1 Programmer is itself a PIC16F628A plus as few as possible components to talk to the host server running the progM01 program and to the target PIC on the Model 01a. The code and schematics are available for free at http://wps.com/products/Model-A1 and http://wps.com/products/Model-01. This is a "command line" program. See the program USAGE section for command line options. SUPPORTED PIC CHIPS: PIC16F627A PIC16F628A PIC16F648A Or anything with compatible programming pins and requirements. .SH OPERATION \fBprogM01\fR requires that one command be given on the command line. Options are, well, optional. .B COMMANDS -- one of these is required .TP .B -p file \fBfile\fR is assumed to be an Intel hex file, produced by most PIC compilers and assemblers. (Intel Hex 8-bit Merged, aka INHX8M, to be exact.) The target PIC is erased first. .TP .B -r Reset the target PIC, only. .TP .B -e Erase the target PIC, only. .TP .B -m Read the contents of the target PIC, and output to stdout, one line per program location. .TP .B -a Test for the presence of the A1 Programmer Adapter and target PIC, only. .B OPTIONS .TP .B -c Make an additional verify pass after \fB-p\fR programming. Obviously makes no sense for other commands. .TP .B -z List all errors, even if they run off the screen. .TP -t device Use the specified character device \fBdevice\fR to talk to the A1 Programmer Adapter. The default is /dev/ttyS0. .TP .B -b nnn Use serial bit rate \fBnnn\fR to talk to the A1. This really isn't of much use as the A1 assumes the default bit rate of 115200 unless you've burned non-standard code into it. .TP .B -v Verbosity in all things, including expanding the config register bits. .TP .B -h Usage. .SH OVERVIEW The Model 01a is a 3" x 5.5" self-contained controller board designed for embedded applications. It's based around Microchip Inc's in-circuit-programmable 14-bit PICs, and contains I/O expansion, a power supply and various goodies that I found useful in five years of using my previous controller board design. The Model 01a, Model A1 Programmer, and the progM01 host software work together as a system. The Model 01a is self contained; the Model A1 contains the electronics needed to program the PIC on the Model 01a, and the progM01 program on the host talks to the A1 Programmer via a serial port. The philosophy is that the Model 01a should be inexpensive, the Model A1 Programmer contain the necessary electronics to program the PIC, and the host-side software should be easily portable to any operating system. A major feature is in-circuit programming; the Model A1 Programming Adapter plugs onto a small dedicated header on the Model 01a card and loads new code into the PIC without removing it from the socket, turning off the power, or otherwise disturbing your project. Loading new code into the PIC takes only seconds. The per-board overhead for the in-circuit programming feature consists of a 6-pin header and a few resistors. The PIC chosen, either PIC16F628A (1K program, 128 byte RAM), PIC16F627A (2K program, 224 RAM) or PIC16F648A (4K program, 256 RAM) also has a built-in UART (dedicated serial port hardware) that alone will speed up serial-communication-based programs many times over other PIC parts, as well as more timers and other generally useful features. Summary of Model 01a/Model A1 HARDWARE features: PIC16F628A, PIC16F627A or PIC16F648A controller. * In-circuit programming. * 24 bits of high-current (0.5A) high-voltage (50V) open-collector drivers, each 8-bit group has jumperable pullups/pulldowns. * High-current (0.5A) high-voltage (50V) buffered direct PB outputs with group jumperable pullups/pulldowns. * 8-bit inputs with resistor networks (pullup, pulldown). * Two 10-bit or 12-bit voltage-output serial DACs. * Two un-dedicated opamp circuits with full input, output and feedback networks reasonably possible. * Specific breakouts for UART (RXD, TXD, CTS, RTS). * RS-485 driver (wired for fake-RS-232). * Built-in +5V linear regulator (you supply AC or DC 9V or higher). * Use internal 4MHz oscillator or external crystal, 18.432MHz recommended. * All digital I/O uses two-row .1" spacing, for solder or pin-headers. Summary of Model 01a/Model A1 SOFTWARE features: * Code compatible with older 14-bit PIC code; use your existing compiler or free compilers and assemblers. * Free source code libraries on the website for UART, shift-register I/O, etc. * The host-side software for the Model A1 Programmer Adapter is written in Perl and distributed under GPL, will run on linux, microsoft or apple operating systems (requires a serial port on the host machine). The code is heavily commented and documented. * Completely implements Microchip Inc's recommended programming and verification sequences. * Accepts the usual INHX8M hex files. .SH TECHNICAL INFORMATION Communication with the A1 Programmer is via serial interface. All of the chip-specific timing is done in the A1 Programmer; this program only has to output correctly formatted data, and does no system-specific timing, therefore it should be portable to any system with a serial port. Additionally, most of the commands issued by this program are ASCII printable characters. All communication and synchronization between the host computer and the Model A1 is character based; no RS-232 handshake signals are used. This version is written for redhat linux but it should port to MSDOS/Windows easily enough, as long as you can make it talk to the serial port. Non-blocking I/O is preferred but blocking will do in a pinch (all you'll lose is soft failure if the A1 Adapter isn't connected to the serial port.) The operating system need only provide access to the following serial port signals: RxD, TxD Receive and transmit data (no duh) GND Signal ground The Model A1 Programmer is itself a PIC16F628A plus as few as possible components to talk to the host server running the progM01 program and to the target PIC on the Model 01a. The code and schematics are available for free at http://wps.com/products/Model-A1. The A1 Adapter could be used with any compatible Microchip Inc PIC in-circuit-programming circuit. Only "high voltage" programming mode is supported, which is the one you want, believe me (RTFM). .SH PIC PROGRAMMING COMMANDS The Microchip-defined programming codes and sequence are produced in the \fBprogM01\fR program, and sent to the Model A1 Programmer Adapter via the serial port. The Model A1 then generates the control signals necessary to write the code into the target PIC chip. The Model A1 is "dumb", and requires \fBprogM01\fR to issue the commands in the right sequence, but the Model A1 handles all of the internal timing and interface requirements. PIC programming commands are one or three bytes. A few return data to the host. Some commands has a minimum execution time (eg. program and erase). The A1 Adapter takes care of this; this host software doesn't need to worry about it. There is absolutely no timing or speed-dependent functions in the progM01 program. The detailed PIC programming sequence is defined in the Microchip documentation. The A1 Adapter code comments contain implementation details; see http://wps.com/products/Model-A1 for source and listings of this GPL-licensed software. .SH ENVIRONMENT .SH REQUIRES Basically no particular system requirements, other than serial port access. .SH FILES Files provided include: progM01 host software, Perl ma1.asm Model A1 Programmer Adapter assembly source ma1.hex Model A1 Programmer Adapter object ma1.lst Model A1 Programmer Adapter listing intelhex.pdf Hex file documentation p16f628a.inc gpasm (gputils) PIC definition include file PIC-BRG-calculator.xls Bit rate generator handy chart .SH AUTHOR Written by Tom Jennings .SH COPYRIGHT Copyright \(co 2002-2003 Tom Jennings .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. So there.