Quantcast
Viewing all articles
Browse latest Browse all 13

Learning to Program the PIC

Image may be NSFW.
Clik here to view.
The finished circuit board
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.


Viewing all articles
Browse latest Browse all 13

Trending Articles