THE MICRO
The PIC 16F84 is an 8 - bit CMOS RISC ( Reduced Instruction Set Computer ) microcomputer, in an 18 pin DIP package, with 1K of FLASH program memory, of which about 200 bytes are used here. The instruction vocabulary contains 34 instructions, ( with variants ) in assembly language. It is manufactured by MicroChip Corporation, whose website address is [WWW.MICROCHIP.COM.]
These chips are intended for small, single task applications, and are very popular with hobbyists and experimenters. This particular chip is ( according to MicroChip ) the most popular chip they manufacture... it has an onboard 8 bit timer/counter ( with an overflow bit ) which is employed here as the signal bearing counter. ( 9 bits total, maximum possible counter number = 512 ) There are two parallel ports, ( one 8 bit, one 5 bit ) which can be configured in software for any possible combination of input and/or output bits.
Interrupts can also be provided through these pins, and are configured, enabled and/or disabled through software. Also available ( but not used here ) is a watchdog timer and a "sleep" mode, as well as non-volatile EEPROM memory. Several of the I/O pins are NOT employed in this design, and are available ( with software mods ) for the user to employ, as desired.
A complete ( and very detailed ) description of the chip is available in Adobe Acrobat ".pdf" format [HERE] direct from the Microchip website... it is 124 pages long... it even includes the entire instruction set, with detailed descriptions of each instruction. A CDROM "copy" of the entire website is available free ( from MicroChip ) [HERE] which will eliminate the internet download time.
SOFTWARE VARIATIONS
The source code ( in assembly language ) is posted on this website, along with an Intel hex format object file. ( At one time, I also provided an assember listing file, but it was huge, and eating up a lot of my ISP "free" traffic volume, so I removed it ) The chip can be purchased ( with software installed ) directly from me, for $US 15, or the user can ( if desired ) purchase and program their own chip...
I used the PICSTART PLUS programmer, purchased for $US 200 from Digi - Key, which included all the printed manuals, a CDROM with all the development software, and a sample 16F84 chip. This programmer connects to an IBM host computer via a serial RS232 port, and includes a complete suite of Windows - based development software on CDROM. This includes a text editor, a macro assembler, a full featured simulator, ( with debug features ) and a PICSTART PLUS utility program, to actually load the programs into the PIC chips once the software is completed.
Frankly, the development package has so many features that it is a little intimidating for a novice user... I had previous experience programming Intel chips in assembly language, so at least I had some idea of what needed to be done, and in what sequence. I succeeded in programming the 16F84 chip with a simple "bit wiggle" program about 4 hours after I took delivery of the package.... the remaining software you see here took an additional 20 hours or so, including the simulation tests. ( most of it was spent "learning" )
If you want to modify the code and this sounds like too much work, you can contact me with your desired changes. If they are simple enough or useful enough, I will do them for you, for free, provided I am allowed to post them on this website and offer them to others. ( with due credit to you, of course ) Alternatively, any average city / community usually has a few hardcore "technoids" who are familiar with these devices, and are capable of programming them... look around... enlist their help.