My Garage under attack from LEDs.
PHASE II CIRCUIT.
After deciding on the 16F877 for the brains of the garage clock, it was time to begin work on a circuit board for it. The 16F877 and its cousins support in-circuit serial programming, which is quick and convenient for working the bugs out of programs.
The 16F877 has plenty enough I/O pins to directly handle the 23 LED segments that form the display, but that is wasteful and ties up PIC pins I might want for something else later on. Adding (3) 7447 BCD to 7-Segment Converter ICs cuts the number of PIC pins needed down to 14 and simplifies PIC programming a bit in the process.
Through a brief lag in sanity, the initial circuit was constructed using a piece of Perf Board and point to point wiring. This may later be replaced with an etched board.
Correct measure now says the money saved by not using a CAD program to lay out the board and ordering it in form a PCB Manufacturer is later spent as time and frustration at errors and repairs. I've since had good results ordering boards from ExpressPCB. They offer free CAD software to lay out your circuit board with!
All ICs will be socketed, in case of need to replace them. The circuit will be supplied from the 12V supply for the LEDs, and the PIC requires 5V at a few mA, so the circuit will get a 7805 Linear Voltage Regulator.
Initial Circuit Board Progress:
Terminal strips will make it convenient to connect the board to the LEDs, and Radio Shack carries some decent ones.
The GPS unit fires NMEA sentences at 4800 BPS at RS-232 levels. The 16F877 has a built-in serial port, and there are available numerous examples of code to move serial data. A MAX232 chip would be overkill for level conversion between RS232 and 5V levels, since the PIC will only need to receive and not transmit. A transistor, a diode and a pair of resistors will suffice.
Serial communication with the PIC is timed by the chip's clock oscillator and a internal programmable divider, so to provide reliable 4800 BPS serial the clock frequency needs to be appropriate. I picked up a tube of 20 MHz clock oscillators at a Hamfest a couple years ago, so one will be used for this project.
A portable display was in order, since programming and testing will be done here at my computer, and the garage display is about 50 feet away. To fill this need, I assembled an ugly but functional display board using 1/2" high 7-segment displays. This is to be used only until things are perfected.
After completing the display board, it was time to resume progress on the main board. The GPS unit supplies a precise 1 pulse per second output that is programmable from 20 to 980 mS wide. Setting it to 500 mS provides a convenient signal source to run the colon in the time display. A 2N2222 type transistor buffers the signal to help protect the GPS unit from overload or tragedy.
A box form an alarm system ($0.50 at a Hamfest some time ago) provided an appropriate enclosure for the project.
I added a 1-line, 16-character LCD display to the project, which provided convenient debugging output for my program. The onboard 7805 ran hotter than I liked it to be, so I moved it to a heat sink on the outside of the box. The board space formerly occupied by the heat sink provided space for a pair of additional filter capacitors.
Board ready to mount in the alarm box.
PAGE 6 PROGRAM
OLDVAN MAIN PAGE