Here are some sites that will get you started on PIC programming:
*
http://www.mstracey.btinternet.co.uk/pictutorial/progtut2.htm*
http://www.mhennessy.f9.co.uk/pic/index.htm*
http://tutor.al-williams.com/pic-intro.htmlBasically, you want to configure one port as "input" and the rest as "output" using the "TRIS" registers, connect your relay (probably through a transistor or other such amplifier) to one of the output ports, then monitor the input, either with a polling loop or with an interrupt. When the port goes high, set the output that the relay is connected to, to whatever state (high or low) will energize the relay (depends on the configuration for driving the relay that you chose).
Use one of the PORT registers to modify the relay output (i.e. PORTA if it's on port A, PORTB if the relay is on port B. Also, be sure to connect MCLR to VDD through a resister (around 47K), and either hookup a crystal (with applicable capacitors--see PIC16F84A datasheet) or resonator or use the RC option (see PIC16F84A datasheet).
Also, be sure to set the Configuration Bits to match whatever oscillator style you are using (see PIC16F84A datasheet). I usually use the PowerUp Timer, you don't need the WatchDog timer or CodeProtect, so disable those. All that is left are the Osc Selection Bits, and that depends on you Oscillator choice.
If you have questions along the way, go ahead and ask, but please create a new thread, so everyone on the forum can see the question and so it becomes a separate issue that will be easier for some future person to find and get help from.