No announcement yet.

A successful noob's advice on programming PIC microcontrollers

  • Filter
  • Time
  • Show
Clear All
new posts

  • A successful noob's advice on programming PIC microcontrollers

    This post is intended for people who are at the stage I was at 12 months ago. I assume you know how to solder from building a kit or two, have done some light computer programming at some point in the last 20 years, whether in Basic or Pascal or C, and maybe know some basic physics like Ohm's Law (V=IR).

    When I decided to get into building my own electronic circuits, I wanted to do what I thought were complex things like drive LCD displays or do some home automation. These things proved to be much simpler than I thought they would be.

    I started out with the PICkit starter kit from Microchip ( It came with the Pickit 2 programmer (PG164120 , $35). I chose it because of its price, and because it is a USB device -- my laptop doesn't have a serial port.

    The Pickit2 programmer can program a wide range of PIC chips using in-circuit serial programming (ICSP). This means that you don't have to take the microcontroller out of your project in order to program it, the programmer interfaces through six header pins that are very cheap and quite compact, so they won't make your project bulky.

    I found the starter kit to be quite helpful at proving to myself that this hobby was within my reach. It came with a demo board populated with a small microcontroller, a few LED's, a potentiometer, a switch. It came with a few sample programs that you could flash onto the microcontroller using the provided software. The programmer isn't limited to working with the demo board, however; you can easily build your own ICSP capable boards from the provided schematics using only two or three trivial components.

    The sample programs that came witht he PICkit2 starter kit were in assembly language, and I didn't really have the energy to learn to program in ASM. I got my hands on the PicBasic Pro compiler (, and found myself right at home programming in basic. Programming a pic in basic was no more difficult than programming the computers I'd mucked around with when I was a kid. For those of you who want to program in C, there is a C compiler available for the PIC as well.

    As a non-engineer, learning this stuff was *extremely* satisfying. I progressed quickly from making an LED blink on and off, to building an LCD alarm clock, to a POV lightstick, to building a fully automated care system for our pet chameleon (that controls his lights, his water supply, and dispensed a metered number of crickets daily).

    If anyone wants any advice on where to get started, I'd be happy to help.