Learning to Program the PIC
Now it’s time to move back into the software domain. Microchip supply a development environment called MPLAB. You can download it for free off their website. Only problem is, it doesn’t work, it kept giving me these errors “Could not initialise dialog box” and would refuse to compile anything. I suspect that there is a DLL missing in the installer, but I have little time to debug other people’s software.
Fortunately, there is another little utility that comes with MPLAB called MPASM for Windows. This program is a little irritating since it dies after every compile but having to reload it every time is a minor inconvenience compared to MPLAB.
So, finally I managed to compile some of the example code. The next step was to learn the PIC’s programming language and write some stuff of my own.
I haven’t done any microcontroller programming for six years, and even then it was on a Motorola 6805, a totally different architecture; so I expected a bit of a learning curve here. But to my surprise, I managed to learn the new instruction set and write some code that worked within an hour. Writing firmware must be like riding a bicycle.
The time had come to do some more electronics. I put together my LED display and wired it up to the PIC. A little bit of soldering, a little bit of coding and in hardly any time, I had a fully functional 3 digit LED counter tumbling away through the numbers.


I’ve built the little NoPPP programmer. The only problem with the thing is it has no flashing lights of any kind! So I put in two LEDs, one to indicate power and the other to indicate programming voltage.

Now it so happens that I stol^H^H uh, came across this large illuminated pushbutton recently. It has a large 25mm button illuminated by an incandescent lamp. The switch is a highly reliable microswitch. It was just begging to be used in this project. So I’m designing the thing around it.
To the left is my first conceptual design (scanned off the back of an envelope!). It has the big button at the left, an LED readout for the speed (in BPM) and a knob to set the speed. Underneath the knob is a slide switch to turn the power on and off.
