Breadboard Bits - Pic16F84, V1
Introduction
This was my first ever attempt at using the PIC16F84. This dates back a long while now.At the time, I had never touched a microcontroller before. I had nothing set up to use one.
These articles have been polished a little, but are essentially the same as they were back then. I'm truly sorry for the quality of the pictures - when I started doing this, I was using an ancient webcam to take them. This has been improved drastically in recent years, but there's not much I can do for historical pictures.
Original Evaluation Board
These shots show my old evaluation setup. At this point, I did not have a PIC programmer of any sort, just a handful of PIC16F84 chips. Proving that I'm totally insane, I just put the PIC on a breadboard and built the programmer alongside it.You will notice that I never mentioned a +12V power supply, even though the PIC needs 12-14V programming voltage. The two segments next to the 555 are a buffer amplifier and charge-pump. The charge pump can deliver +20V, although I decided at the last minute not to use a regulator (too much current draw, I don't have a 78L12 on hand, only a 7812), so I only used +15V of it. With the voltage drop across the transistors taken into account, it lands at around +13V or so, which works quite nicely.
The last segment on the top is the actual programmer, which is pretty standard PROG84. I originally messed up a bit, and the MCLR line was being pulled low whenever it was not being programmed, disallowing the PIC running with that line connected.
The bottom segment is, of course, the 74125 (not the 74HCT125 that's called for, but close enough), some debounce and reset circuitry, and the PIC16F84 itself. There is also, at the moment, a bicolor LED (barely visible on the photo, shows up as a reflective crescent) with limiting resistor connected across PA0 and PA1.
(The actual design of the PROG84 is presented in a future article)
My first program, once MCLR was disconnected from the programmer, successfully flashed a bicolor LED to both colors. Not all that impressive a demo, sure, but it worked.
Motor Control
It appears that there were a few bugs with my old parallel-port interface box, and I managed to get proper in-circuit programming working. Turns out that one of the data lines was floating, and that was causing the MCLR line to be pulled to ground when it wasn't supposed to. I fixed it, and then it worked perfectly.I don't have a picture available of the next thing to go into my setup, which was a dip switch used to input the speed of LED blinking, but then, that wasn't very interesting.
The next thing I really did do was to design a double H-bridge with general-purpose NPN transistors and a 74LS04 hex inverter and attach a 2-coil stepper motor. It worked quite well, and a similar design appears in Circuit Corner. I stepped the motor by hand a few turns, and then hooked it up to the PIC.
Here's where I will note that, really, I should have used power transistors. I simply didn't have any on hand, certainly not eight of them. On the other hand, a 12 Ohm stepper on a +5 supply won't pull more than about 400mA, which was within the specs of these cheapo Radio Shack transistors.
Anyway, the motor ran quite well, and I was impressed. I ran out of diodes, so I didn't put the coil sink diodes in like I originally intended, but they're just a safety margin, and aren't really needed with bipolar transistors.
Serial Port
This was basically the last time I used this evalutation board. I added a homegrown charge-pumped RS232 interface, seen in the bottom right corner of the board. The second breadboard (barely visible on the right of this shot) has the connections to the computer's serial port. I succeeded in transmitting characters to the computer, and I *think* I mostly had the reception working. There were some strange problems left over, probably from the RC clock that this board used. I should try to post some schematics of my RS-232 interface, since it does test out working.I received my circuit orders, which included many things I was waiting on, namely the 4MHz clock chips that I needed. That should eliminate the clock skew on the oscillator.


