Got me a PICkit2 programmer clone and a SOIC8 test clip from the good people at banggood. If you intend to use linux as your programming environment - get the PICkit2, NOT the PCIkit3. There is no linux driver for PICkit3.
I'm currently setting pk2cmd up on my Ubuntu machine, following http://iam-saminda.blogspot.co.nz/2015/03/chipset-programming-with-linux-1-pickit.html and http://hackaday.com/2010/11/03/how-to-program-pics-using-linux/
$ sudo apt-get install build-essential libusb-devDownload the PICkit2 driver source. It doesn't seem to be hosted by microchip any more, but it is on sourceforge. https://sourceforge.net/projects/pic-linux/
untar the source and cd into the directory.
$ cd pk2cmdv1.20LinuxMacSource $ make linux $ sudo make install
Check that it installed (with the pickit2 plugged in):
$ pk2cmd -?V
Executable Version: 1.20.00
Device File Version: 1.55.00
OS Firmware Version: 2.32.00
Operation Succeeded
The PICkit2 was surprisingly simple to setup. The only hiccup I encountered is to tell pk2cmd where to find the PK2DeviceFile.dat file. Specify the directory containing it with -B/usr/share/pk2/ or put it in your PATH or current directory.
Now we need to plug the programmer onto the chip.
Find the pinout of the PICkit2 on page 9 of its datasheet.
http://ww1.microchip.com/downloads/en/DeviceDoc/51553E.pdf
I wrote the signal names on the back so that info is always where it needs to be.
We've got to prepare the servo PCB a little for in circuit programming.
- Detach the hot glue holding the resonator, and carefully bend it out of the way.
- Get rid of the excess solder between the cap and pin 8 so the clip will fit.
Trim the sides of the test clip so that it fits between the gaps of the other components (regulator, cap and resistor). Attach the test clip snugly.
(First time I did this, I just soldered wires to the appropriate pins).
Now for the moment of truth ... to ask it what the chip is on the other end (remember we don't know even if it is a PIC at all yet), ... drum roll please ..., No, then just blink the LEDs on the programmer then ...
$ pk2cmd -B/usr/share/pk2/ -P Auto-Detect: No known part found.Ah NO! Fail. What's wrong?
I reseat the soic8 test clip two dozen times. Trim it some more. Bend the pins inward so they make better contact. Still no luck. So I start desoldering bits:
- The resonator - maybe the factory program is starting up before the programmer can get it into programming mode.
- The potentiometer input - maybe it is providing too much load on the program data pin.
- A capacitor connected to the program data pin - maybe it is loading the pin with too much capacitance. A bit of RC time constant action reducing the slew rate.
Success!
$ pk2cmd -B/usr/share/pk2/ -P Auto-Detect: Found part PIC12F675.
Our device is a PIC12F675! http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC12F675
So we need to remove the capacitor attached to pin 7 of the PIC. It is affecting the slew rate on PGD/ICSPDAT signal from the PIC. This was its purpose of course - to be a low-pass anti-aliasing/noise reducing filter for the potentiometer input, but it does its job too well for in-circuit programming.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hey! Interesting project you've got here!
How do you plan on controlling the i2c lines with no pins to spare?
Are you sure? yes | no
You could always try the 1Wire... even on the power line!
Are you sure? yes | no
I considered 1-wire, see the next log post.
The servo will draw up to a couple of amps - which would make 1-wire on the power line a real challenge for the driver (huge mosfet, and very low ohm, high power pullup resistor - then multiply by the the number of servos!).
Are you sure? yes | no
Thanks.
I've just written a log post in response to your question. :)
Are you sure? yes | no
For future reference, the PicKit 2 is still up, but they don't make it easy to find.
Go here http://www.microchip.com/pagehandler/en-us/devtools/mplabxc/home.html?tab=t3
And then hit "Downloads Archives" and scroll way down.
Definitely doesn't help that direct links are totally broken on their tabbed site.
Are you sure? yes | no