				  SENDHEX
				  =======

This archive contains some programs to allow Derren Crome's PIC
programmer to be used with Microchip hex files.  The original
programmer, described in EPE magazine in February 1996, is quite
popular and the supporting software is available here:

  ftp://ftp.epemag.wimborne.co.uk/pub/PICS/PIC.programmer

Unusually, source in the form of a C++ program SEND.CPP is provided.
Mr Crome chose to adapt the shareware assembler TASM for his project
and his program is designed to download TASM object files (binary format)
to the PIC.  As Microchip's own assembler MPASM is free and as most PIC
programs found on the net and elsewhere are written for MPASM it would
be nice if the EPE programmer could use MPASM programs too.  Unfortunately, 
MPASM generates hex files and these are quite different from the format
expected by SEND.  Probably the best idea is to replace SEND with another
program that understands hex files.  However, it's easier to write a
program to convert hex to TASM object format and keep SEND - the program
HEX2OBJ.EXE provided in this archive does just that.

A rather strange feature of SEND is that it appears to load the object
file starting at address 4 (don't ask me why) and always puts the code for
"GOTO 5" in location 0 (the 16C84 reset address).  To convert a hex file
(EXAMPLE.ASM say) to a TASM object file (EXAMPLE.OBJ say) suitable
for SEND you should use this command:

    HEX2OBJ EXAMPLE.ASM EXAMPLE.OBJ 4

The 4 tells HEX2OBJ to skip 4 words at the beginning of the hex
file.  If you want to use the original version of SEND you don't
need to read any further.

I have also included a modified version of SEND with this archive.
This version should behave exactly the same way as the original
if run as SEND but if run like this:

    SEND 0

It will load object files starting at address 0.

The batch file SENDHEX.BAT can be used to download hex files that
include code in the first four addresses (i.e. most hex files :-).
You use SENDHEX in place of SEND like this:

    SENDHEX EXAMPLE

In this example SENDHEX creates EXAMPLE.OBJ from EXAMPLE.HEX and then
runs SEND 0; when SEND asks for the object file name just type
EXAMPLE to download EXAMPLE.OBJ.  Note, you run SENDHEX with the
filename only (i.e. EXAMPLE not EXAMPLE.HEX).

I haven't built Mr Crome's programmer.  (I have plenty of other
16C84 programmers without building another one.  In fact I have
designed something similar to the EPE programmer called TOPIC - see
my WWW site for the details.)  This means I can't be sure my modified
version of SEND works and if you have any trouble just use the original
version of SEND together with HEX2OBJ as described above.  If you need
to do this remember that you cannot program the first four PIC locations
and all your programs must be designed to start at address 5.

There are plenty of other programs apart from MPASM that generate
hex files; for example various C compilers and the Parallax 8051
like assembler SPASM (use the /S switch if you ever use it).  Now
you should be able to try some of these with your PIC programmer.
Have fun.


David Tait                                        27th November 1996
Electrical Engineering Division
School of Engineering
The University
Manchester M13 9PL
UK

david.tait@man.ac.uk
http://www.man.ac.uk/~mbhstdj
