repost of http://jallib.blogspot.nl/2009/08/pic-18f14k50-based-usb-wisp-programmer.html
Today the description of a USB WISP programmer. A while back I had some trouble with my ICD2 clone, therefore I decided to make a WISP programmer. Since I’ve written the USB libraries for JAL(lib) and because I just had ordered a tube of 10 PIC18f14k50, I decided to redesign the original WISP so it uses the PIC18f instead of the the PIC16f648 (which I did not have in my junk box), and use the USB-Serial library so I can still use the various host applications but I can plug it in directly to the USB port. The additional benifits are:
- Very cheap (just a PIC18f14k50 + resistor and capacitors, total costs ~5 Euro)
- Have a fast serial connection
- Can use exsisting WISP host applications (like Rob’s XWISP2)
- Can be directly powered from the USB port (no external power supply needed)
- When adding a 3.3V regulator, board can also be used to program LF devices (if Vpp = 9v)
- Added an additional connector for future use, like JTAG & I2C and RS-232 TTL
The schematic is very straigtforward, the blue boxed areas contain the optional section of the USB WISP programmer
I’ve made a few modifications to the original design, first the Target power is controlled by a PNP transistor, which acts as switch (so target power can be turned on/off), because USB 5v does not like to be short circuited for a short period, as is done in the WISP 648. In addition I’ve added a PNP transistor to control the Target VPP line, this is for future use.
I also made a small PCB, however, Wouter van Ooijen (the designer of the Wisp 648 programmer, see www.voti.nl
) asked me not to publish the PCB layout. So don’t ask me for it, if you want to build this project you have to design you own PCB, if you can’t, buy a Wisp 648 kit from Wouter. The assembled PCB is depicted below:
The Source code
I just made minor modifications to the original source code (see www.voti.nl). The changes are:
- Include usb_serial library
- Change UART functions, so they send and receive chars from the USB library
- Tune the timing delays (becuase effective speed is raised from 20->48 MHz)
- Had to adapt the HEX<->ASCII function, because the original code still uses some inline assembly which did not work properly for the PIC18f
- Call USB-Flush in the main routing
There still some work left, i.e. the port trough function is not working yet, the advantage of this design is the the UART can be used (even the polarity inversion of the UART signals can be programmed with the PIC18f14k50), so pass trough can work with speeds up to 115200 baud.
The USB Wisp is operation for a couple of weeks, so far it worked flawlessly. With a small change in the XWISP2 configuration file, I was able to program the PIC14k50 as well. But of course, there is a big discalaimer, I only have a couple of PICs, so the solution is not tested extensivly, thus if you want a good and robust PIC programmer I advice you to buy or build the original WISP 648.
This small exerise shows the strenght(s) of JalV2 and Jallib, it shows how easy it is to port a large application from a PIC16f devices to a PIC18f device and that only a little effort is required to move from a RS-232 (UART) communcation interface to a USB (serial) based communication interface.