Hi there,
I'm about to build this project
Telephone operated remote control using PIC16F84A microcontroller that I took from
_http://www.electronic-circuits-diagrams.com/microcontrollers/microcontrollers1.shtml . But the problem is the code. The instructions to follow to activate and inactivate the switch it seems so difficult. I tried it many times follow the instructions but none of them are work. so I assumed there is a problems at the code. The hardware that I use at the telephone line ring detection is differ from original design. These are my design:

My idea is just simple. I just want to activate and inactivate switch base on the rings. when PORT RA0 received pulse from timer output, pin no 3, let say 5 times, all the output RB0-RB7 are activate, logic 1. To inactivate just call 6 times, and all the output RB0-RB7 turn to 0. But all the rings base on what we set on Dip switch. For example if we want 5 rings to activate we need to set 0101 on Dip switch [Refer my circuit] and the rings time up to 15 times 1111. To inactivate switch just sent 1 time ring greater that what we set. This is meant to on the switch 5 rings to off the switch 6 time [5+1]. So here I requested the code because I don't know how to create the code. Hope you guys understand my idea. Any modification on the circuit are welcome..

*My circuit actually not complete. Refer to the original Circuit at
http://www.electronic-circuits-diagrams.com/microcontrollers/1.gif