You'll probably want to look at my
Python port of IFI PICLoader, which I called "pycloader".
I tried to make the modules which handle reading of the HEX file (which is based on a spec from Intel) and interfacing with the controller as usable as possible.
The
Intel Hex reader interface is more hackish than I'd like, but it works. It supports more record types than is actually used.
The
PIC interface (what you're interested in) is a little more manageable, IMHO. I've tried really hard to make sure it's all documented and laid out nicely and...
The C version is not really readable. I first tried porting it by doing a line-by-line port and simplifying. I then grabbed
PortMon from Sysinternals and just figured it out. The resultant protocol I documented (or tried to) on
my website. (Also in
CVS.)
Any suggestions would be appreciated.
And no, I don't understand the parameters to the ERASE command, yet.