Microcontrollers and Linux

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:

[16F883]
        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 
        PICSTART 

[16F883:def]
        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

[16F883:defx]
        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

[16F886]
        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 
        PICSTART 

[16F886:def]
        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

[16F886:defx]
        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.


April 28, 2010
URL:http://www.drdobbs.com/embedded-systems/microcontrollers-and-linux/228701028

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.