Pic programing in Linux - Questions

Discussion in 'General Electronics Chat' started by LeanMeGood, May 13, 2013.

  1. LeanMeGood

    Thread Starter New Member

    May 13, 2013
    2
    0
    Hello all.

    I am wanting to teach myself some basic PIC programming. I have not done any before and was looking at purchasing a PICkit3. Reason being the MPLabs solution seems to run on Linux. After reading some threads though, it appears the pickit3 does not have Linux drivers.

    So I was wondering if anyone here programs PIC's in Linux and if so what hardware/software do you use?

    I am just looking to create a simple board with 2 inputs, and 2 outputs.

    I hope there are some Linux pic users out there and there is a common way to program pic's. If you can point me towards any information to get me started I would appreciate it very much. All my investigoogling is failing.
     
  2. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    Hi.

    Picaxe have software that run on Linux.

    Working with Picaxe is cheap, easy and simple.
     
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Probably the simplest way is to download MPlabX which will work fine and you can develop and program chips with PICKIT2 or PICKIT3
    I don't like MPLABX, so there is another way if you get the PICKIT2 instead of the PICKIT3
    MPlab 8 runs pretty well using Wine, but can't directly program PICs
    There's a command line program (made by Microchip) called pk2cmd which runs in Linux and does that job.
    If you have 32 bit Linux just install and then use a line like this in terminal:
    pk2cmd /PPIC12F508 /F/home/mint/Desktop/pound/sound.HEX /M
    If you have 64 bit Linux you need to compile the source code for pk2cmd, which is fairly straightforward, but you need to get libusb-dev first.
    You may also have to use these lines in the terminal (every boot)
    PATH=$PATH:/usr/share/pk2
    export PATH
    I think there is a way to make that automatic, but I don't mind.
     
  4. LeanMeGood

    Thread Starter New Member

    May 13, 2013
    2
    0
    Thanks for the advice guys!!
    I'm looking into the picaxe way of doing things. It sounds pretty user friendly and everything but it kind of feels like cheating considering they have preloaded their picaxe code to make everything easy for you. Ideally I want to learn something that I could possibly include in a product. Not sure where you stand on OEM development with the picaxe. I am sure its fine but I will have to read the documentation. Would hate to do something I'm not allowed to.

    My romanticised view of writing C code, compiling, then running a single CLI instruction to blow it onto a PIC from within Linux may not come to fruition any time soon unless I go for the pickit2. Heh I have to learn C for starters! but I've never been afraid of learning.

    I don't really want to limit myself by choosing the pickit2, when the pickit3 apparently does a wider range of chips. I guess I have to do a bit more reading before making a choice.
     
  5. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    I feel a bit the same way...

    I used MPLAB 8.63 under wine in Linux, and compiling took like forever.At least that was my feeling. Could be my hardware messing with me thou.
     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    I haven't compiled a PIC C program, but general use and simulating for assembler takes a similar time to windows with Mplab 8. Mplab X runs natively under Linux, and in future will be the only version updated for the newest PICs. The same is true for the PICKIT3. MPLAB X has somewhat mixed reviews, some people prefer it.
    You probably won't find the PICKIT2 supported devices too restricting, apparently there is a new device file that has a few more than this, but this is what I have available:
    www.microchip.com/forums/download.axd?file=2;396218
     
  7. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    There are no restrictions on using the PICAXE in commercial products. The extra cost is the only real constraint.
     
  8. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    It does not look simple. One day I will have to be there. Fearing the moment.
     
  9. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    A lot of things in Linux aren't simple, I'm still a noob after using it for a few years. Sometimes it takes a while to figure out how to do something, but luckily most problems can be solved easily enough with a little searching.
    Most of the popular programs don't require any effort at all to install, it's just the niche ones that can be tricky.
     
Loading...