Update: Thomas Sailer has added several new features and fixed (at least) one bug in the original code. Tom's version of the software is here. In the meantime, here's a patch Tom submitted to fix the bug he found. This bug causes incorrect behavior when the .hex input file contains data records that straddle memory segment boundaries. (For example, if the .hex file contains a record that starts at address 0x5 and continues through to address 0x15, the unpatched program will behave incorrectly.) Thanks again Tom!
Update: Source files have been patched to silence all gcc4 warnings. (Thanks to Thomas Sailer for this patch). Get the patched source archive or just the patch.
I have been using the super-convenient JDM programmer hardware and the prog84 console-based software for programming PIC16xx series devices. Both work superbly, but when I recently embarked on a new project involving the dsPIC line of microcontrollers I discovered that they use a different programming protocol not supported by prog84 or any other freeware tools I could find.
Hence these utilities. In their current form they work with the JDM programmer, but the hardware-specific portion of the code is trivial and should be easily tweakable for other programmers. (Note that programmers for PIC16xx series devices, including the JDM programmer, can be made to program dsPIC30F2010 devices with these trivial modifications.)
Both programs require the
-f hexfile option.
dspicprg burns the contents of the hex file
into the chip, and
dspicdmp writes the
contents of the chip to the hex file.
norika /home/homer/pic/tuner <> dspicprg -f tuner.hex Wrote 160 program words. Wrote 16 data words. Wrote 5 configuration words. Thank you for your support. norika /home/homer/pic/tuner <> dspicdmp -f dump.hex Thank you for your support.
Command-line options for both programs:
-c xx, --chiptype=xx
dspicprg doesn't do any verifying.
Maybe this should be added. For now, to verify
dspicdmp and compare the resulting
output to what you intended to program.
Source archive: dspicprg.tar.gz
|Main file for programmer:||dspicprg.c|
|Main file for dumper:||dspicdmp.c|
|Main header file:||dspicprg.h|
|STDP programming mode routines:||dsppstdp.c|
|STDP programming sequence definitions:||dsppseq.c|
|STDP programming sequence definitions header file:||dsppseq.h|
|Code/memory packing/unpacking routines:||dspppack.c|
|Routines for working with 'MemoryRow' structures:||dsppmrow.c|
|Routines for reading and writing intel hex files:||dspphex.c|
|Miscellaneous utility routines:||dsppmisc.c|
|Global variable definitions:||dsppglob.c|
dspicprg and dspicdmp utilities, by Homer Reid
|Last Modified: 11/16/16|