Saturday, June 25, 2011

MPLAB 8 on Ubuntu 11.04

Ubuntu Development Dream Lives On

I wasn't about to give up on my dreams of having a non-Windows development box to do my hardware tinkering on. So I decided to give Wine a try. Turns out it works like a champ and my bootloader project is simulating just as I expect. In case anyway else is interested here are the steps to get it up and running.

Install Wine

The first step is to install Wine. That is quite simple as it can be done through the Ubuntu Software Center. Just do a search for "wine" and install the "Wine Microsoft Windows Compatibility Layer."

Download and Prepare Files

Next up is to download MPLAB 8 and the Standard-Eval version of C18. Once you have downloaded them they need to be set as executable so that Wine can run them properly. You'll need to extract the zip file contents for MPLAB first. After that, change directories to the folder containing mplabc18-v3_38-windows-eval-installer.exe and run:

sudo chmod 777 mplabc18-v3_38-windows-eval-installer.exe

Next, change directories again into MPLAB_IDE_8_73 and run:

sudo chmod 777 *.*

Install C18

  1. Right-click on the C18 exe and select Open with Wine Windows Program Loader

  2. Accept the defaults through the install

Install MPLAB 8

Right-click setup.exe and Open with Wine Windows Program Loader. I chose the Custom setup and accepted everything that was checked by default. I accepted all other defaults during the install. If you selected the Hi-Tech compiler as part of the custom install it will launch a separate installer. I accepted all of the defaults during Hi-Tech C Compiler install except I checked the box to add the compiler path to the environment variable.

Test it Out

  1. Go to Applications->Wine->Programs->Microchip->MPLAB IDE v8.73->MPLAB IDE

  2. Open the project from the Project menu

  3. Viola! Works like a champ.
I haven't tried to program with the Pickit3 yet but I'm not too worried because I still have MPLABX installed so if I can't do it in MPLAB 8 I can just pop over to MPLABX and use it to actually program my device. It's not my ideal setup but it will work for now and allows me to remain Windows free. If you have questions or comments please feel free to pass them along.

Bit by the Beta

Back on the Sensor Project

So, I haven't talked about the sensor project for a while which was the whole reason I started this blog. Well, I'm ready to get back into it. First, I've decided not to continue with the screencasts although I would consider doing them again if a demand arises. For now they just consume a lot of time that I could be spending on designing, implementing, and documenting the platform. I want to share as much as I can about the design and implementation process so that others can learn and help me to learn. If you see something that you don't agree with or have a better idea, by all means, let me know. The more collaboration the better.

The Beta Strikes Again

I've been preparing several blog posts about the implementation of the bootloader for the platform which I'll be posting shortly in the future but felt like I should post this first. I was happily cruising along on my new Linux dev box and feeling pretty good about things. Cranking out some C code and got to that first debug moment. I created a simple test in code to see if my flash memory routines were working correctly and it turns out they weren't......or were they? I spent hours and hours trying to debug my code and try different things. Have you ever had one of those moments when you swear you are right and the machine is wrong but then talk some sense into yourself because "the computer only does what I tell it to do"? I reached that point. Finally, I was convinced that I was doing everything right and the thought hit me; "MPLABX is still beta software. Maybe I've found a problem." I pulled my code over to my trusty Windows machine and created a project in MPLAB 8 and built. I compared the hex file to the MPLABX version and they were identical. At least the compilers agreed. The problem appears to be in the Simulator. My test works as expected in MPLAB 8 but has erratic Simulator behavior in MPLABX.

Now What?

I was really excited to do all of my development work on Ubuntu with MPLABX. MPLABX is quite an improvement and has a TON of features I've always wanted in MPLAB. The fact that the compiled hex files are the same between the platforms tells me that if I program a PIC from my dev machine it will work fine but how will I know things work? I like to do as much simulation as possible before I start programming chips because once you get into the hardware the bugs are a lot harder to track down. The fact is, I need the Simulator to work reliably so that makes MPLABX on Ubuntu a no-go for me right now. Perhaps I'll look into MPLAB 8 under Wine. I'm not ready to let my Ubuntu dev box dreams go down the drain.