┬ÁControl freak

After attending LCA2007 (last year) and catching Tim Ansell’s show and tell on some PIC microcontroller based projects, I got inspired. He mentioned that Microchip offer free samples of their PIC chips, so I managed to get my order in for a small variety (a 12F629, 16F88, 16F688 and a 18F2550). All of these have a different target application (small and simple (8 pins), to mixed salad (18 pins, with 16 I/O including analogs and USART) and up to USB capability. Anyway I have had the chips for a while and I was researching programmers (to burn your program on to the chip). I didn’t want to spend much money, and was going to build my own, but eventually I got lucky and got a PICkit2 clone from Sure Electronics on eBay. I also board a breadboard and to get me going on a project some 8×8 LED display modules.

Anyway I have been having quite a bit of fun. I managed to build up a simple display driver circuit using an idea I thought of, but it seems others have as well, using shift registers to latch the row and column data for the display. This also minimises the pins required from the microcontroller. I also got digital and analog inputs working, with a potentiometer able to adjust the rate my display changes. I am using the 16F88 PIC along with 74HC595 shift registers.

Eventually I wouldn’t mind build a message display using the 8x8s and a USB connected PIC. The “real” projects I would like to work on would be some simple sensors around energy and water – but don’t hold your breath. The thing I found amazing is that I have picked up, and even enjoyed , programming at assembly level again. PICs are basically RISC processors, so there is not many instructions to learn (less than 40 for for PIC16). Working at that level you have to think a lot about timing and conserving space, how best to get input and provide output (with limited resources). While my current programs are just endless loops, grabbing inputs and stuffing output pins (and mind you this is probably what you want a hard real time system to do), the next thing I want to learn is to set up timers, interrupt service routines (watch for timeouts and/or input changes) and so on.

Where microcontrollers excel over discrete logic is that provided you bring inputs and outputs together at the right level, you have a lot of opportunity to tweak the processing of inputs late in the design process. This has a lot of advantages to somewhat impassioned and impatient creative types like me.

Any way I have attached a photo of my breadboard, and a dump of my (very messy) code.

My breadboard