Microchip PICkit 2 Programmer |
My PICkit 2 failed:
$./pk2cmd -PPIC16F1705 -GCRead successfully.
Configuration Memory
0000 0000
VPP Error detected. Check target for proper connectivity.
PICkit 2s are not expensive, more so the China clones now available online. Neither is its successor the PICkit 3, so I could easily have thrown it away. But it came with a great manual, complete with source code and schematics which is uncommon. Plus the original PICkit 2 is getting hard to find these days and PICkit 3 might have issues supporting some legacy CPUs. In any case I could repurpose it: not only it is a USB device, it has a ready-made connector with 2 IO ports and a nifty 12V-0V pin.
A VPP error is probably to do with the MCLR pin:
Pickit2 JTAG Connector Function
Pin 1 MCLR/Vpp
Pin 2 Vdd
Pin 3 Gnd
Pin 4 Data
Pin 5 Clk
Pin 6 N/C
6-way header |
To check MCLR(pin 1) I just stuck a 6-pin header into the PICkit 2 connector and measured it with respect to Pin 3 (Gnd). It helps to make a little bash script:
$cat ./testpickit2
for i in {1..5..1}
do
sleep 5
./pk2cmd -PPIC16F1705 -GC
done
MCLR (or Vpp) schematic diagram |
The multimeter measures MCLR at 0.15V. A sanity check with a good PICkit 2 showed this goes well up to 12V. The schematic shows an ingenious DC boost converter, using the CPU pin Vpp_Pump to periodically short the inductor L1 to ground. There is even Vpp_FEEDBACK pin to regulate its output. Two additional CPU pins, Vpp_ON and MCLR_TGT are used to switch the resulting regulated high voltage to pin 1 of the JTAG connector (ie the programming port).
I pried open the plastic case and the repair job just became a lot simpler. L1 the 680uH surface-mounted inductor fell off the PCB!
Detached inductor L1. The original position is circled in red |
This happens quite a bit with surface-mounted components, particularly when subjected to mechanical stress. The inductor is among the tallest component and would have been compressed by my fingers through the thin plastic case.
680uH Inductor. Note the plastic former is plated at the ends and the inductor wire is then soldered on. |
The plastic, metal-plated lead has snapped off one end. I thought it would be a slam-dunk to solder the unbroken end back on the PCB and solder the broken wire directly to the PCB. Boy I was wrong: the wire was so thin it was hardly visible under high magnification. Worse, when I stripped the enamel insulation using my soldering iron, this made the wire brittle and it eventually broke off.
New inductor (bottom left) is larger than the original |
A new 680uH inductor, 74404054681 INDUCTOR, 680UH, 0.25A, 20%, SEMI-SHLD from element14 cost RM5 (USD1). I chose it to match the leads pitch of 4mm; the other dimensions were uncomfortably larger than the original but this was the only part with a reasonably sane delivery date. I was concerned it might be too tall and prevent the plastic case from snapping shut.
Working PICkit 2 |
Soldering was a little tight: you need to solder the right-hand lead first and slide it right to make room for the iron tip at the left lead. But there was a happy ending: the case snapped shut and the PICKit 2 worked.
No comments:
Post a Comment