This module is so simple, Iβm surprised it has not been thought of before.
You can fit a PIC16F84A or PIC16F628 and it becomes a βbuffered PIC chip.β
Look at the circuit diagram first to see what the module is doing. Itβs buffering 5 of the input lines with a 1k resistor and buffering 8 output with a driver (actually a sinking) transistor.
If you fit a PIC16F628 chip, you can use the RC oscillator inside the chip (4MHz or 37kHz β see 14.2.6 of PIC16F628.pdf ) or the external RC 4MHz oscillator components (4k7 and 22p) on the PC board. The oscillator components on the PC board do not have to be removed when using the internal oscillator. The small current delivered by the 4k7 resistor in the RC oscillator will not damage the chip. It just represents wasted current.
The 5 input lines are protected with 1k buffer resistors and taken to an βin-lineβ connector-strip.
The 8 lines of port B are buffered with 1 amp driver transistors and taken to another connector-strip.
A Reset Pin is also on the PC board.Β When it is taken LOW, the chip resets. It is held HIGH via a 10k resistor.
This module does not allow the full in/out capability of each line but it is miles ahead of anything available on the market for a similar price.
In fact the closest modules are twice the price, have less input/output capability, run at one-tenth the speed and have less area for a program.
The advantage of our design is it does not have any βoverhead.β It does not have any propriety software or hardware that you have to buy.Β You can take the chip out of the module and place it directly into a project you have designed, and it will run immediately.
The microcontroller runs at 1 million instructions per second and this is very important when you are working on timing intervals, for displays and sounds, etc.
Programming the chip is carried out βby handβ at machine-code level using instructions that are able to be read by the microcontroller, and also by humans. Each instruction consists of letters and numbers that humans can recognise and is called a βmnemonic.βΒ (You can also use any other programming language if you wish, but we will only be dealing with βhand-assembly.β)
Machine code may be slow and laborious, but when you take advantage of our
Library of Routines, and examine the experiments we have presented, you will be able to go to our βCopy and Pasteβ fileΒ and put the code into your program to create all types of effects.
There are a number of sites on the web to help you write assembly programs but they tend to complicate the job rather than simplify it.Β I have tried them and found them to be absolutely impossible to use.
The author has opted for machine code assembly, not because I am a masochist, but because it is the only way to learn the instructions and achieve a program of the complexity of the ideas we have presented in some of your projects. Two games on this site are examples.
To give you some idea of the capability of a 1,000 instruction program in machine code, the first 4-level chess game was written for the early version of the Z-80 in 1k of memory! The PIC chip has instructions with more than twice the power .Β .Β . imagine what you can achieve!Β But donβt forget, the chess game was not written in simple βlinear programming mode.β The routines were very clever algorithms. Our programming approach is much simpler and is called βlinear programming.β Basically it means the micro will be advancing down the program and exiting a sub-routine with a solution.
Another reason for choosing machine code is fault finding. By viewing the program you can see exactly what the micro is accessing and it is much easier to βhunt down the fault.β
MPLAB has a debugging program and a single-step feature that shows the contents of each register (file) after an instruction.
It has some capability at finding a fault. But donβt hold your breath. It doesnβt solve problems for you.
For more detail: PIC LICK-1 using PIC16F84 Microcontroller