	
				PICPROG V 0.2

		     (C) 1999, 2000 by Raffael Stocker

			   Covered by the GNU GPL
		 	See COPYING for Information

What is picprog?
================

picprog is a kernel module  for Linux Version  2.2.x (tested with 2.2.5, 2.2.10 
and 2.2.12). It allows you to program Arizona Microchip's PIC16C84 and PIC16F84 
microcontrollers via the parallel interface.  You need the PC-based development 
programmer as published in Arizona Microchip's AN586 application note. 
See http://www.microchip.com for information.

Installing it
=============

First get picprog-0.2.tar.gz from ftp://ftp.fh-deggendorf.de/pub/linux/kernel. 
The newest version can always be found there.
Install it with

	tar xvzf picprog-0.2.tar.gz

Then simply do a

	make 

in the created directory and hope to get it compiled. If that doesn't work, 
then you probably have a problem.

If it works, you will have two files, picprog.o and progutil, in your
directory. progutil is a little application to use the module's features.
Now edit your /etc/conf.modules to include following:

	alias char-major-<your major> picprog
	options picprog picprog_major=<your major> io=<your io's>

Then do a

	su -c "make install"

to install the files and create device nodes called /dev/picp[0-3]. Edit
the Makefile to choose a different name or major. make also runs depmod -a
to update your module-dependencies.

You should now be able to work with the module.

WARNING: I didn't test the module with more than one programmers.
So if that worked, I would be surprised.

Using it
========

The mapping of the device-files to the ports is as follows:

	/dev/picp0	0x378
	/dev/picp1	0x278
	/dev/picp2	0x2bc
	/dev/picp3	0x3bc

To program the microcontrollers simply do a 

	cat program.bin > /dev/picp0

or a

	cat /dev/picp0 > program.bin

to read them (from port 0x378 in this case).

Programs are always in binary and exactly 2048 bytes long (addresses 0
to 1024). For programming of data eeprom and Configuration Word see 
progutil. It supports only binary data for now, but inhex and others
will be included soon.

Known bugs
==========

Exception handling in progutil is poor. It just reports errors and exits.
I feel this could be done better. It also supports only binary data for now.

To do
=====

Instantiate DataFile in progutil to support other data formats as well.
Use getopt_long or popt in progutil, write an option to specify fuse settings
on the command line. Write better exception handling.
Probably much more. Collect ideas and let me know them (or--better--implement them).

The Author
==========

Fan mail, bug reports and patches can be sent to raffael.stocker@stud.fh-deggendorf.de

Please drop me a line if you like/hate this software!


Raffael Stocker (19-Feb-2000)

May the source be with you!
