Difference between revisions of "PICKit 2"

From the Linux and Unix Users Group at Virginia Teck Wiki
Jump to: navigation, search
imported>Cov
(Compile pk2cmd)
imported>Cov
Line 6: Line 6:
 
You'll need to add a group for the device and add yourself to that group.
 
You'll need to add a group for the device and add yourself to that group.
 
<pre>
 
<pre>
sudo addgroup embedded
+
$ sudo addgroup embedded
sudo addgroup $USER embedded
+
$ sudo addgroup $USER embedded
 
</pre>
 
</pre>
  
Line 13: Line 13:
 
Now you need to ask udev to give the recently created group permission to access the USB device.
 
Now you need to ask udev to give the recently created group permission to access the USB device.
 
<pre>
 
<pre>
echo '#PICKit                           
+
$ echo '#PICKit                           
 
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0032", MODE="0660", GROUP="embedded"  
 
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0032", MODE="0660", GROUP="embedded"  
 
#PICKit2
 
#PICKit2

Revision as of 00:34, 3 February 2011

The PICKit 2 is a microprocessor programming and debugging peripheral. It is used in ECE 4534 Embedded System Design. Below are instructions on how to get it working.

The following instructions were written for Ubuntu 10.04 and may not work on other platforms or versions. If you would like to see additional coverage, please add it yourself or make a request on the wiki's wanted page.

Group Account

You'll need to add a group for the device and add yourself to that group.

$ sudo addgroup embedded
$ sudo addgroup $USER embedded

Udev Rules

Now you need to ask udev to give the recently created group permission to access the USB device.

$ echo '#PICKit                           
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0032", MODE="0660", GROUP="embedded" 
#PICKit2
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0033", MODE="0660", GROUP="embedded" 
#ICD2
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="8000", MODE="0660", GROUP="embedded" 
#ICD21
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="8001", MODE="0660", GROUP="embedded"' | sudo tee /etc/udev/rules.d/25-embedded.rules

Apply the Rules

You can restart to make the newly added rules take effect.

Compile pk2cmd

$ sudo apt-get install build-essential libusb-dev
$ wget http://ww1.microchip.com/downloads/en/DeviceDoc/pk2cmdv1.20LinuxMacSource.tar.gz
$ tar xf pk2cmdv1.20LinuxMacSource.tar.gz
$ cd pk2cmdv1.20LinuxMacSource
$ make linux

External Links