Vous êtes sur la page 1sur 2

Piklab

Installation on Ubuntu 11.04 and Later


Piklab is a mature and extraordinarily well-designed IDE (integrated development environment) for Microchip's PIC series of microcontrollers. Piklab is more convenient (and faster!) than Microchip's own MPLAB. Even better, Piklab is a Linux program. Microchip recently introduced MPLAB-X, apparently recognizing the need for a cross-platform IDE. Piklab has one major advantage over MPLAB-X: it works. Unfortunately, the KDE developers have moved on to a new version of QT (the underlying UI library) without maintaining backward compatibility. Consequently, newer Linux versions, such as Ubuntu 11.04 and later, no longer support software that is based on QT version 3. This includes Piklab. This guide is a list of steps it took me to install Piklab on Ubuntu 11.10 ans 12.04. It is likely going to work with Ubuntu 11.04, Mint 12, and similar distributions. Acknowledgements: Adnan Mustafic contributed significantly to this list. Similar instructions can be found at the Big Bang blog. 1. Install the command-line utilities related to the PIC family: gputils sdcc This can be done with Aptitude. Alternatively, use "sudo apt-get install sdcc gputils" 2. Install several packages that are available in the Ubuntu repositories: libreadline6 libusb libstdc++ kdelibs5-data liblua50 liblualib50 libqt3-mt launchpad-integration Once again, this can be done with Aptitude. Aptitude has the advantage that is selects packages compatible with your architecture and distribution. 3. Next, obtain packages that are not in the repositories. Links are provided here for the amd64 architecture. You can search for the i386 versions by subsituting i386 for amd64 in the file names. kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb libavahi-qt3-1_0.6 This completes the installation of package dependencies for Piklab 4. Obtain a Piklab Debian package. One valid name to search for is "piklab_0.15.71_amd64.deb". Get Piklab here Alternatively, get a rpm (Redhat) package from the OpenSUSE repositories. This link may help you. If you have a rpm package, you need to have alien installed to convert it to a Debian package: alien -d piklab-0.15.10-6.4.i586.rpm

5. Now install Piklab: "sudo dpkg -i piklab-0-15.xxx-xxx.xxx.deb", where you need to replace the xxx by whatever version you downloaded 6. Start Piklab by typing "piklab" in a shell. If you got to this point, Piklab is ready and needs to be configured for the programmer or debugger that you use. For the ICD-2 debugger, two steps are necessary. The proprietary bootloaders from Microchip needs to be installed, and a rule to access the ICD-2 via USB needs to be created. To install the bootloaders: Download MPLAB 8 from the Microchip web site and install it, for example, under WINE. Choose a suitable location for the hex8 files, for example with
sudo mkdir /usr/share/apps/piklab/hex8

Use the WINE desktop to copy all files from C:\Program Files\Microchip\MPLAB IDE\ICD2 to the new directory /usr/share/apps/piklab/hex8. Next, open Piklab, choose "settings" and "configure programmers". Select the ICD2 programmer, set to USB port, and select the "specific" tab. There, enter /usr/share/apps/piklab/hex8 in the Firmware Directoy entry field. To enable non-privileged USB access: Create a new file in /etc/udev/rules.d as follows:
sudo nano /etc/udev/rules.d/99-microchip_icd2.rules

and copy and paste the folowing two lines into the file:
SUBSYSTEM=="usb" ATTR{idVendor}=="04d8" ATTR{idProduct}=="8000" GROUP="plugdev" SYMLINK+="mcidc2" SUBSYSTEM=="usb" ATTR{idVendor}=="04d8" ATTR{idProduct}=="8001" GROUP="plugdev" SYMLINK+="mcidc2"

Finally, add your login name to the group "plugdev" in /etc/group. Start Piklab and try to connect to the ICD-2.