Hi! In this blog entry I'll show you how to setup a development environment to develop and compile code for Microchip's PIC microcontrollers. We'll need three main packages:
  1. gputils - a collection of tools for the Microchip (TM) PIC microcontrollers. It includes gpasm, gplink and gplib.
  2. sdcc - small device C compiler
  3. piklab - an integrated development environment (IDE) for applications based on Microchip PIC and dsPIC microcontrollers similar to the MPLAB environment. It integrates with several compiler and assembler toolchains. It supports the most common programmers (serial, parallel, ICD2, Pickit2, Picstart+), the ICD2 debugger, and several bootloaders (Tiny, Pickit2 and Picdem).
The installation that I will describe here was only tested in a 64 bit architecture but I will provide the links for a 32 bit architecture as well. If you try it then please let me know if it works or not in order to update this "How To". This tutorial has been tested and worked in Ubuntu 11.10 and 12.04. Probably works in 12.10 too.

So, let's start by installing the most easy stuff.


Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)

Donate

11 comments:

  1. I'm glad it helped ;) Thanks for the feedback!

    ReplyDelete
  2. Thanks. I have a 32 bit VMware guest and the commands were slightly different toward the end. This will probably copy/paste fine on a 32-bit system...

    sudo apt-get install gputils
    udo apt-get install kdelibs5-data
    get http://launchpadlibrarian.net/68040450/kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb
    sudo dpkg -i kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb
    sudo apt-get install libqt3-mt
    wget http://launchpadlibrarian.net/68495846/libavahi-qt3-1_0.6.30-0ubuntu2_i386.deb
    sudo dpkg -i libavahi-qt3-1_0.6.30-0ubuntu2_i386.deb
    wget http://launchpadlibrarian.net/35166252/liblua50_5.0.3-4_i386.deb
    sudo dpkg -i liblua50_5.0.3-4_i386.deb
    wget http://launchpadlibrarian.net/35166254/liblualib50_5.0.3-4_i386.deb
    sudo dpkg -i liblualib50_5.0.3-4_i386.deb
    wget http://launchpadlibrarian.net/68040451/kdelibs4c2a_3.5.10.dfsg.1-5ubuntu2_i386.deb
    sudo dpkg -i kdelibs4c2a_3.5.10.dfsg.1-5ubuntu2_i386.deb

    # 32-bit follows. There were some unmet dependencies which the -f install seems to fix.

    sudo apt-get -f install
    get http://download.opensuse.org/repositories/Education/openSUSE_11.3/i586/piklab-0.15.10-6.1.i586.rpm
    sudo alien piklab-0.15.10-6.1.i586.rpm
    sudo dpkg -i piklab_0.15.10-7.1_i386.deb

    # Does nothing for me.
    sudo apt-get autoremove

    ReplyDelete
  3. Sorry - I should mention that doesn't include the C compiler. Real men use Assembler. ;-)

    ReplyDelete
  4. Or real Women of course. :-/ My bad.

    ReplyDelete
  5. Hi Ben! Thanks for testing in the 32-bit version and sharing the modifications ;) I'll update the tutorial to include the needed modifications you pointed as soon as I can :)

    ReplyDelete
  6. Sure they do, when they have the time to develop things properly :P When they have to get things done quickly they might use C as well but that's where it stops. Going beyond that is getting into arduino and stuff ended in -uino and that's just something that real men don't do :P

    ReplyDelete
  7. Piklab version in opensuse is updated: piklab_0.15.10-7.1_amd64.deb became piklab_0.15.10-7.4_amd64.deb ...

    ReplyDelete
  8. Thanks for letting me (and the readers) know about this :) I've updated the links for the new versions for both amd64 and i586 architectures.

    ReplyDelete
  9. The link to these versions of piklab didn't work for me. I had to use:

    http://ftp.us.debian.org/debian/pool/main/p/piklab/piklab_0.15.7-1_amd64.deb

    to install on Mint.

    ReplyDelete
    Replies
    1. Damn, I guess they have changed the repositories again. It happens everytime after a few months. Thanks for your comment, I'll update the links as soon as I can! :)

      Delete

top