------------
WHAT IS IT ?
------------
mp84 is a tool to program a PIC16F84 in a serial mode using a programmer by W. 
Zabolotny and W. Zaworski from Institute of Electronics Fundamentals, Warsaw 
University of Technology.

The programmer is connected to the parallel port of IBM PC. It is a production 
programmer, e.g. it supports the so-called "margining": verification at 
variable level of Vcc. mp84 programs the chip at Vcc value of 5V and then 
verifies programmed data at 4.5V and 5.5V, as specified in "PIC16F8X EEPROM 
Memory Programming Specification". mp84 uses Intel 8-bit HEX files (like these 
produced by MPLAB). A tool from converting MS-Windows text files to Unix format 
is included, so that one can easily use files from MPLAB or other DOS-based 
assembler.

----------
INSTALLING
----------
Type 'make' to build the program. Note that mp84 needs direct access to the I/O 
ports, so it must be run suid root to work properly. After compiling, make will 
ask for root password so that it can set the permissions correctly.

You can type 'make install' to install the program and its man page; again, it 
requires root password to be entered.

-------------
CONFIGURATION
-------------
mp84 uses a system-wide configuration file '/etc/mp84.conf'; however, it can be 
overridden by '~/.mp84rc' file, so that each user can use his own 
configuration. Right now, the file contains only one information: the base I/O 
port number of parallel port the programmer is attached to. For lp1, it's 0378, 
for lp2 0278 and for lp0 it's 03BC. To change this setting, just edit the line:
base = 0378

If none of '/etc/mp84.conf' and '~/.mp84rc' is found, mp84 uses 0378 as the 
default value.

-----
USAGE
-----
To program the chip, type:
    mp84 -p file.hex
To verify if the chip is programmed with specified file, type:
    mp84 -v file.hex
To read the chip's memory to a file, type:
    mp84 -r file.hex
To program four ID values of the chip, type:
    mp84 -i ID1/ID2/ID3/ID4
(Note that IDs should be specified in hexadecimal and separated by slashes)
To read chips's ID information, type:
    mp84 -d
To read the configuration word, type:
    mp84 -s
To program the configuration word, type:
    mp84 -o conf-word
(Note that the conf-word should be in hexadecimal. Only four lowest bits are
 used - you cannot modify bits that are responsible for memory protection)
To enable code protection, type:
    mp84 -c
To disable code protection, type:
    mp84 -u
(NOTE: disabling code protection results in erasing the whole chip's memory)

You can specify that only certain areas of the memory will be programmed or 
read, by using one or more of the [PDIS] options:
    mp84 -PD -p file.hex
P is for program memory, D for data memory, I for ID locations and S for status 
word.

Several options can be used simultaneously, for example:
    mp84 -P -uc -p file.hex
This will first disable code protection, then program only code memory with 
contents of 'file.hex', and then enable code protection again.

By default, mp84 asks the operator to press ENTER before it starts working
and after it finishes. This is intended to protect the chip from incidental
damage by other program that could write to the LPT port (this can happen in
multitasking environments). Before pressing ENTER for the first time, make sure
no other program that could be accessing the LPT port is running (for example,
the lpd with non-empty queue). You can restart such programs after mp84 finishes
programming. If you are sure that no other program will have access to your LPT
port, you can use the "-q" option to disable this feature of mp84.

You can disable margining verification by using the "-n" option. However, the
chip will still be verified at Vdd=5V.

Use dos2unix and unix2dos tools to convert from/to MS-DOS files. Their usage is:
    dos2unix file1 [file2...]
    unix2dos file1 [file2...]
They require perl interpreter to be istalled.

--------------
ERROR MESSAGES
--------------
Some most common error messages you may experience:

'Programmer not found'
The programmer is not plugged in, or is not turned on, or the base port 
specified in cofiguration file is incorrect.

'Corrupted file'
The HEX file contains invalid information - probably you forgot to convert it 
from the MS-DOS format.

'Programming error'
An error occured during programming. The chip may be damaged, or it has code 
protection turned on. Try using -u option.

'Verification error'
An error occured during verification at 4.5V or 5.5V. The chip may be damaged, 
or voltage levels on the programmer may be set incorrectly.

------
AUTHOR
------
The author of mp84 is Michal Pleban <michau@jezus.pl>

More information about the programmer can be found at:
http://www.ise.pw.edu.pl/~wzab/picprog/picprog.html

---------
COPYRIGHT
---------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
