Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 11:47:54 11:47


Login with username, password and session length


Pages: [1]
Print
Author Topic: Can Someone help me create PIC code  (Read 2905 times)
0 Members and 1 Guest are viewing this topic.
slapdash41
Newbie
*
Offline Offline

Posts: 23

Thank You
-Given: 17
-Receive: 3


« on: April 20, 2007, 09:31:40 21:31 »

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.. Smiley

*My circuit actually not complete. Refer to the original Circuit at

http://www.electronic-circuits-diagrams.com/microcontrollers/1.gif
« Last Edit: April 21, 2007, 07:42:53 07:42 by slapdash41 » Logged
GreenGiant
Junior Member
**
Offline Offline

Posts: 38

Thank You
-Given: 2
-Receive: 1


« Reply #1 on: April 21, 2007, 04:32:47 04:32 »

Very interesting way of using the 555 timer.

What exactly happens when you try the circuit ?

Check that the output of the 555 timer is indeed changing over ring's.

The source code is available, so its simple to see, and verify that the code is probably not at fault (unless you changed it or you didnt compile/program it right)
Most likely the pulses arent being counted by the PIC, you noted you used a different ring detection circuit, make sure that circuit still outputs the pulses to the PIC.
Logged
slapdash41
Newbie
*
Offline Offline

Posts: 23

Thank You
-Given: 17
-Receive: 3


« Reply #2 on: April 21, 2007, 07:38:21 07:38 »

After the output of the timer, it worked perfect. Every telephone rings [standard phone rings which is 2 rings actually before the interval] the timer output is at state 1. This is meant the timer produce single pulse when it detect 2 pulse from the optocoupler. I hope you understand what I'm trying to explain. I change to other detection way because the original circuit seems not work for me. The original circuit make 2 optocouplers burn due to excessive voltage from the telephone line. It's the same way actually. I took from Elektor DTMF Remote Telephone Switch. The Circuit are shown below,

http://img356.imageshack.us/img356/4695/dtmfremotetelephoneswitjr0.png

Yeah, I know the source code is  available but when I compiled it, It produce a bunch of errors. The original code needs caller to call  twice to activate the board. First call to activate half board and the 2nd call to determine which switch that caller want to activate. It need the perfect timing. I followed the instruction and like I said none of them are work. So I just want to make it simple. Just use single call to activate the switch beside call it twice. Let say I set 7 rings at the Dip switch so I just need to sent 7 rings to activate the switch, and to activate the switch I need to sent 8 rings.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC