What you are asking wouldn't take long at all with a 16F84. A few quick hardware notes:
1. What input/output ports did you want to use? The 16F84 has 13 I/O lines, divided into one 8bit port (Port B) and one 5bit port (port A). Two of the pins on port A are special, so I recommend that you use port B to make it simple; any of the 8 pins on port B can be used as either an input or output with no problem.
2. To configure the chip (and properly time the loops in the programmer), you need to specify what type of oscillator it will be using. You can use:
A cheap resistor/capacitor circuit
A ceramic resonator
A quartz crystal.
Going down this list, cost increases, but so does accuracy. Accuracy probably doesn't matter much here, (we are working with tens of seconds here, not microseconds).
Before code can be written, you need to know which oscillator (type and speed) and what pins you will be using on the PIC for which purpose.
Do you have a way to program the chip? If not, check out http://www.mindspring.com/~covington/noppp/index.html for a very low-cost programmer and the software to go with it.
-Trav
BTW, If you are connecting the accessory line to an input on the PIC, you should make sure to clamp the car's 12 volts to TTL levels (5 volts) on that pin, because the chip has an absolute maximum of about 6.5 volts on the input pins. This is easy to do with a zener diode.



LinkBack URL
About LinkBacks

Reply With Quote
Bookmarks