Back to photostream

Make Stuff Week 2 - DEOK2 Hello World closeup

I got around to trying the circuit board I built yesterday and it works! Shown here is a PIC 12F675 microcontroller (mcu) running the mcu equivalent of Hello World, making an LED blink.

 

A microcontroller is a very small computer, here shown in the black package which is a little bit bigger than a quarter-inch on a side. They vary widely in physical size and capabilities and are typically used as the brains of control circuitry such as fuel injection systems, smart battery chargers, stuff like that, on up to fairly powerful devices like MP3 players. There's a hobbyist community centered around them and people come up with some pretty interesting stuff.

 

The idea behind a Hello World program is that it's the minimum necessary to show that you are able to develop a working program in whatever environment it is you're using. For most computer languages, you're able to assume some kind of device that can output text, whether an old-style terminal console or a web browser or whatever (and the traditional text, attributed to Brian Kernighan in the early 70s, is "hello, world.") With a microcontroller, though, the simplest setup doesn't have any text output. Instead, a light-emitting diode (LED) is connected to one of the chip's pins and a program written to make it blink. Blinking is the simplest way to show that the program is running - steady-on might happen by accident depending on how the circuit is wired. The blink shows both that the program is executing properly and that it's running at the speed you expect.

 

The way MCU development works is that you write the program for the little chip on a PC and send it (nowadays) through a USB cable to a device called a programmer. The programmer configures the MCU's memory to contain your program and off you go; newer programmers like the PICkit 3 pictured here are also able to let you run the program one instruction at a time and observe its behavior on the development PC. The circuit shown here doesn't support that, but I don't use that functionality much anyway - my projects tend to be more complex than Hello World but not hairy enough to need that kind of debugging power.

 

I built this little setup so that I could make MCU-based projects for my new year 2012 resolution of making some object every week. One problem I've had with my electronics hobby to date is that I never finish anything; it's enough for me to show that I can get something working, then I don't take the last step of putting it in some sort of durable form that can then be presented to someone and used. Mostly, that's not really a problem, since there isn't any obligation for a hobby to produce useful things. But I would like to actually put some stuff in peoples' hands.

973 views
0 faves
0 comments
Uploaded on January 16, 2012
Taken on January 16, 2012