Wednesday 17 June 2009

pickit2 setup with pk2cmd under ubuntu 8.04

1. Download pk2cmd and unzip the files in a suitable directory (If link is broken search for the main web page of the pickit2 in the microchip website)

2. Read the readme file. Basically:
$ sudo cp pk2cmd /usr/local/bin
$ sudo chmod 755 /usr/local/bin/pk2cmd
$ sudo mkdir /usr/share/pk2
$ sudo cp PK2DeviceFile.dat /usr/share/pk2
$ sudo chmod 755 /usr/share/pk2/PK2DeviceFile.dat

Add to your .bashrc the two directories. usr/local/bin:usr/share/pk2 and source if necessary

Follow the these instructions
Sort story:

For distributions using "udev" (Debian Sid, Ubuntu 6,7,8,...)

The following procedure may be used to be able to connect to the ICD2/Pickit programmers
as a regular user on distributions using udev [thanks to David Williams]:
  • Create file /etc/udev/rules.d/026_microchip.rules:
#PICKit
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0032", MODE="0660", GROUP="microchip"
#PICKit2
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0033", MODE="0660", GROUP="microchip"
#ICD2
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="8000", MODE="0660", GROUP="microchip"
#ICD21
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="8001", MODE="0660", GROUP="microchip"
  • Create a group named "microchip" and add your username to this group:
sudo addgroup microchip
(Note: for Arch Linux, it is "groupadd".)
sudo gpasswd -a your_user_name microchip
3. Reboot

4. Test by
$ sudo pk2cmd -P
If root is fine then
$ pk2cmd -P

5. The following websites are also useful:
http://mcuee.blogspot.com/2008/04/pk2cmd-linux-port-under-ubuntu.html
http://home.pacbell.net/theposts/picmicro/

No comments: