Channels ▼

Al Williams

Dr. Dobb's Bloggers

Microcontrollers and Linux

April 28, 2010

I really like Linux -- no surprise since I was a long time Unix user before there was a Linux. Unfortunately, it doesn't always seem like microcontroller vendors share my views. A lot of the "official" software from vendors only works with Windows.

Sure, sure, you can get open source to do everything. Have you tried that? Yeah if you are using 5 year old parts, you might have some luck. Here's an example that just cropped up yesterday. I use a lot of Microchip PIC -- yes, I know you either love them or hate them (in my case, both). But I have good reasons for using them on this project. Microchip always comes out with newer and cheaper chips that fit in the same socket, so while I started out with 16F873 chips I have migrated (with several intermediate steps) to the 16F887.

The Microchip PICStart Pro programmer supports these, but the unofficial open source Linux software doesn't.

Of course, it's easy enough to fix. Just find your picdevrc file and add this to it:

        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 

        10 00 3f ff 3f ff 00 7f
        00 7f 3f ff 3f ff 00 ff
        00 ff 00 00 00 00 00 00
        0D 10 20 00 04 20 07 02
        00 00 01 00 00 00 00 00
        00 01 22 0f

        3f ff 07 00 00 00 00 00
        00 00 00 00 00 00 00 00
        3f ff 07 00 00 00 00 00
        00 00 00 00 00 00 00 00

        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 

        20 00 3f ff 3f ff 00 7f
        00 7f 3f ff 3f ff 00 ff
        00 ff 00 00 00 00 00 00
        0D 10 20 00 04 20 07 02
        00 00 01 00 00 00 00 00
        00 01 22 0f

        3f ff 07 00 00 00 00 00
        00 00 00 00 00 00 00 00
        3f ff 07 00 00 00 00 00
        00 00 00 00 00 00 00 00

Simple, right? (That was sarcastic). What about the excellent piklab software? Well it does support the chip, but not with the programmer. Not to worry, you can (somehow) set up the program to use external programmer (like the modified picp software), but I haven't bothered yet.

I often try to use Wine or VirtualBox to run "official" software, but that seems like cheating. And each has its own quirks. VirtualBox runs everything (as long as it doesn't need a parallel port). But it doesn't play nice with dual monitors. I usually just blow up the screen to one full screen Windows session and pretend I have two computers, each with one monitor.

And then there's Wine. MPLAB (Microchip's IDE) works fairly well under Wine, provided you use wintricks to install comctl32 (and maybe comctl32.ocx) and then override comctl32 using winecfg so that Wine picks up the native DLL. At least that's been my experience.

If a vendor wanted to perk up my interest, they'd support Linux tools out of the Box. Xilinx, for example, works pretty well under Linux although they use a "Windows compatibility library" and you still get the idea you are a second class user (try getting PACE to run out of the box from the IDE, for example). I don't have any demographics to back it up, but I'd be willing to bet the number of embedded developers who use Linux is high. And the number who would use it is probably even higher.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.