Author Topic: PIC programming - how should I start (on Linux)?  (Read 10144 times)

0 Members and 1 Guest are viewing this topic.

Offline miceuzTopic starter

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
PIC programming - how should I start (on Linux)?
« on: January 19, 2014, 12:52:25 am »
I've been programming AVR and ARM controllers for some time already, but the first page of Digikey sorted by price ascending makes PIC very tempting. As far as I know there are different programmers for different families of PICs and some compiler limitations. Can anyone shed some light what should I get to use bottom of the range microcontrollers?

Should I get Pickit3? Are there any tools that work on Linux or at least under Wine? I'd preferably would like to program in C.

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #1 on: January 19, 2014, 02:19:15 am »
Sounds like "programming" means two different things in your post.

Programming 1 (as in burning code into a mcu): you need a programmer for that. pickits are cheap but less capable. ICDs more capable but more expensive too.

Programming 2 (as in writing code to make mcu work for you): Sure you can do it in C.

Quote
(on Linux)?

I tend to think it wiser that when you are trying to start, it pays to make your life easier. That means using Windows as much as you can.

Quote
I've been programming AVR and ARM controllers for some time already,

Then this whole thing will be super-easy for you.
================================
https://dannyelectronics.wordpress.com/
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2085
Re: PIC programming - how should I start (on Linux)?
« Reply #2 on: January 19, 2014, 02:37:59 am »
I use "gputils" and a text editor. To transfer the program to the PIC I use "PICdev"; this has several options for different programming hardware , e.g. from a few transistors hung on the serial port, or the Velleman K8048 kit, or even the PICkit II will plug-in without any hassle. All under Linux.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: PIC programming - how should I start (on Linux)?
« Reply #3 on: January 19, 2014, 11:07:57 am »
I've been programming AVR and ARM controllers for some time already, but the first page of Digikey sorted by price ascending makes PIC very tempting. As far as I know there are different programmers for different families of PICs and some compiler limitations. Can anyone shed some light what should I get to use bottom of the range microcontrollers?
You will want the Hitech PIC compiler. That costs serious money so you'll have to use lots of PICs to save some money. And then you'll need to worry about in which memory bank to put a variable. I'd forget about Wine too. A lot of software doesn't work well. Better use Virtualbox to make a virtual machine.

All in all you are probably better off looking at cheap MSP430 devices.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: PIC programming - how should I start (on Linux)?
« Reply #4 on: January 19, 2014, 12:02:42 pm »
Should I get Pickit3? Are there any tools that work on Linux or at least under Wine? I'd preferably would like to program in C.
Microchip's MPLAB X IDE and XC8 compiler are available for (x86) Linux.

Offline Maxlor

  • Frequent Contributor
  • **
  • Posts: 565
  • Country: ch
Re: PIC programming - how should I start (on Linux)?
« Reply #5 on: January 19, 2014, 12:48:33 pm »
PICkit3 as programmer, MPLABX as IDE, XC8 as compiler. The PICkit3 isn't that expensive, the software is free, it's supported by Microchip and it all works just fine on Linux. Try it first before evaluating 3rd party tools.
 

Offline miceuzTopic starter

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: PIC programming - how should I start (on Linux)?
« Reply #6 on: January 19, 2014, 03:47:19 pm »
PICkit3 as programmer, MPLABX as IDE, XC8 as compiler. The PICkit3 isn't that expensive, the software is free, it's supported by Microchip and it all works just fine on Linux. Try it first before evaluating 3rd party tools.

dough! Thanks! I've downloaded it and it works ok, at least it runs and compiles the code.

Now is Pickit 3 THE programmer for all the MCU families?

Offline miceuzTopic starter

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: PIC programming - how should I start (on Linux)?
« Reply #7 on: January 19, 2014, 03:58:53 pm »
Now I've read this thread and I'm totally confused...  :scared:

https://www.eevblog.com/forum/microcontrollers/pickit-3-still-seems-dodgy

Is it really that bad?

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #8 on: January 19, 2014, 04:04:27 pm »
xc8=picc/picc18 + (that dreaded) ocg.

Quote
Now I've read this thread and I'm totally confused...

That means the internet has fulfilled its promise, :)
================================
https://dannyelectronics.wordpress.com/
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: PIC programming - how should I start (on Linux)?
« Reply #9 on: January 19, 2014, 04:32:42 pm »
I use MPLABX and my PICKIT3 on a daily basis.

It just works. I have no complaints. No crashes, no random errors, no failures to connect, it's just a dependable tool which I can use to get the job done.

For what it's worth, I wouldn't start on Linux, I'd start on Windows 7.

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #10 on: January 19, 2014, 04:43:30 pm »
I always wondered about the need so many have to develop on Linux. I am not aware of any firm that officially supports it. The tool vendors don't support it - which totally makes sense given the lack of material demands. Yet, there are always people who insist on Linux - who are those people  and what makes it so indispensible that they have to develop on Linux?

If you make a living writing code, it seems to me that you want your tools, including the os to be reliable. Linux would be on bottom of that list for me.
================================
https://dannyelectronics.wordpress.com/
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: PIC programming - how should I start (on Linux)?
« Reply #11 on: January 19, 2014, 05:03:42 pm »
I always wondered about the need so many have to develop on Linux. I am not aware of any firm that officially supports it. The tool vendors don't support it - which totally makes sense given the lack of material demands. Yet, there are always people who insist on Linux - who are those people  and what makes it so indispensible that they have to develop on Linux?

If you make a living writing code, it seems to me that you want your tools, including the os to be reliable. Linux would be on bottom of that list for me.

Let's not start a great big OS debate, here, but.. As someone who's used Linux for many years in many applications, Linux is a reliable OS. It is used and officially supported by many companies, for many software applications, hardware tools, embedded devices, pieces of military hardware, and the very infrastructure in place to allow you to post on this forum relies on it heavily.

I have always wondered about the need so many have to use a huge pile of legacy code with so little flexibility..
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: PIC programming - how should I start (on Linux)?
« Reply #12 on: January 19, 2014, 05:09:42 pm »
@dannyf: You are missing out on a lot of good stuff. I use Linux for software development almost exclusively. Even software intended to run on Windows. Linux makes life a whole lot easier.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #13 on: January 19, 2014, 05:11:13 pm »
The issue isn't linuxs own reliability but the combined reliability of Linux and tools running on top of it.

as to companies that support officially development on Linux - they allow and support mcu software development on Linux, I would love to know a few as I have run into no one.
================================
https://dannyelectronics.wordpress.com/
 

Offline miceuzTopic starter

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: PIC programming - how should I start (on Linux)?
« Reply #14 on: January 19, 2014, 05:13:11 pm »
I always wondered about the need so many have to develop on Linux. I am not aware of any firm that officially supports it. The tool vendors don't support it - which totally makes sense given the lack of material demands. Yet, there are always people who insist on Linux - who are those people  and what makes it so indispensible that they have to develop on Linux?

Well, I'm a one band man and I use Linux. It's an OS of my choice after I've used windows and mac for quite a long time. That's where the need comes from. I don't want to have a separate machine (real or virtual) to only run some tools.

If you make a living writing code, it seems to me that you want your tools, including the os to be reliable. Linux would be on bottom of that list for me.

Linux is not that unreliable as you might think. Lot's of companies (at least software companies) are using Linux as a standard developement platform. But I get your point - if you need a tool, you use the OS the tool needs. It's more the question of convenience in my case. Opensource toolchains run smootly for AVR and ARM plaftorms on Linux.
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1672
  • Country: pl
  • Troll Cave Electronics!
Re: PIC programming - how should I start (on Linux)?
« Reply #15 on: January 19, 2014, 06:08:29 pm »
How should you start? You should not.

Pics are cheap for a reason,  and the reason is that vast majority of them  have truckloads of bugs.  On top of that recent Microchip compilers are artificially crippled (output assembly is artificially bloated on purpose by insertion of Jin umps and nops)  in free versions in order for them bo be able to brag about increased code efficiency of paid versions.

Only thing good about Pics is that development tools are indeed great value for money and they are very affordable for pretty much everyone.

If you are familiar with ARM,  stick to them.
I love the smell of FR4 in the morning!
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: PIC programming - how should I start (on Linux)?
« Reply #16 on: January 19, 2014, 06:22:37 pm »
The issue isn't linuxs own reliability but the combined reliability of Linux and tools running on top of it.

as to companies that support officially development on Linux - they allow and support mcu software development on Linux, I would love to know a few as I have run into no one.
NXP supports they LPCExpresso tools for Linux. Same for TI's Code Composer Studio. If you look you'll come up with a longer list.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: PIC programming - how should I start (on Linux)?
« Reply #17 on: January 19, 2014, 06:27:37 pm »
The issue isn't linuxs own reliability but the combined reliability of Linux and tools running on top of it.

as to companies that support officially development on Linux - they allow and support mcu software development on Linux, I would love to know a few as I have run into no one.

http://www.ti.com/tool/ccstudio
https://www.microchip.com/pagehandler/en-us/family/mplabx/

Didn't look too hard, then..
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: PIC programming - how should I start (on Linux)?
« Reply #18 on: January 19, 2014, 07:20:18 pm »
How should you start? You should not.

Don't start learning about one of the most widely used, versatile and inexpensive microcontroller families out there?

Great advice there.  :palm:

Quote
Pics are cheap for a reason,  and the reason is that vast majority of them  have truckloads of bugs.

They're not that cheap. Compare and contrast like-for-like in terms of pin count and peripheral set, and you'll find that families like STM32 are actually cheaper as well as being much higher performance - but without the ease of use and some of the hardware capabilities that PICs tend to have. You'll struggle to find 5V operation or true EEPROM, for example.

As for the bugs, there certainly are plenty of them, but they're clearly documented in readily available errata. Decide whether the bugs in any given device actually matter to your application, and work around them if necessary.

Quote
On top of that recent Microchip compilers are artificially crippled

True - but not an issue unless you're struggling for performance.

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #19 on: January 19, 2014, 08:12:47 pm »
It looks like it will take a few tries to get people to understand the question: of those companies that develop applications on mcis, which supports the use if linux-based tools?

hint: mcu OEMs shall not apply.
================================
https://dannyelectronics.wordpress.com/
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: PIC programming - how should I start (on Linux)?
« Reply #20 on: January 19, 2014, 08:18:12 pm »
It looks like it will take a few tries to get people to understand the question: of those companies that develop applications on mcis, which supports the use if linux-based tools?

hint: mcu OEMs shall not apply.

Still not understanding the question.

Why would a third party company support your use of a tool?
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: PIC programming - how should I start (on Linux)?
« Reply #21 on: January 19, 2014, 09:30:15 pm »
The irony being that Windows is a pretty bad development environment. Everyone ends up having to install a ton of Unix emulation tools just to make it bearable.

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: PIC programming - how should I start (on Linux)?
« Reply #22 on: January 19, 2014, 10:14:41 pm »
It looks like it will take a few tries to get people to understand the question: of those companies that develop applications on mcis, which supports the use if linux-based tools?

hint: mcu OEMs shall not apply.
Mentor Graphics for starters:
http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #23 on: January 19, 2014, 10:20:31 pm »
Quote
Still not understanding the question.

Why would a third party company support your use of a tool?

One more try:

Of those companies that make a living developing code for mcus (an application shop), which one uses linux as official development environment?

ie. this question is trying to get to the demand side of the equation: who uses linux development environment?
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: PIC programming - how should I start (on Linux)?
« Reply #24 on: January 19, 2014, 10:23:30 pm »
Quote
I'm a one band man and I use Linux.

That I think is the case: Linux development tools are used mostly by individuals / small shops on smaller scales.

That contributes to the observation that most IDE vendors don't sell Linux environments.

I for one have never seeing a company utilizing Linux environments to develop mcus (officially). You will have individuals doing it on a one-off or off-work basis, however - and that makes total sense.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf