Discovering Pics

Having decided to build a robot, I found myself torn between scratch-building a small Z80 board, with RAM, ROM and a PIO, or attempting to recycle a Sinclair ZX80 as a controller. Both had already been done by others. And then I discovered PICs - they were new on the hobbyist market, RAM, ROM and I/O were all built into the one chip, and you could buy a 16F84 for about £4.00. Better still, there were designs on the Internet for circuit boards and programmers, and free software. It all seemed too good to be true - I bought a PIC, made a programmer and downloaded the software.

My first programmer (top picture) was David Tait's TOPIC combined programmer and project board. Circuit, PCB layout and software were all downloaded from the Internet and it worked well. It was powered by a bench power supply; it had a 10-way header for connection to a PC parallel port and I made a short adaptor to connect to the standard printer cable. Once the program was downloaded, the PIC could be run on the TOPIC board, which had another header giving access to the chip's input/output ports. For this one I made a breakout board with labelled screw terminals, which made the whole thing very easy to use and experiment with.

I later built an extended version, shown in the lower picture. This retained the functionality of the original TOPIC, connected directly to the printer cable and used the same breakout board. It had a ZIF socket for the PIC and, most importantly, also had a facility for in-circuit programming of PICs on my own PCBs, such as the controller on my first robot buggy, via a cable - see inset.

All in all, this proved a very versatile and practical system.

The PIC had to be programmed in assembly language. I was used to low-level programming, but it still took a while, and some practice, to get my head round the microcontroller architecture and its limited instruction set. I still remember the buzz of watching my first programmed PIC flashing an LED.

So now I was all set to build a mobile robot. The aim of the first phase, not too ambitious by modern standards, was to build a buggy with a simple bump and avoid behaviour (bump into something, back off, turn and drive away). It would use a three wheel configuration, with two driven wheels, a castor and differential steering.