PDA

View Full Version : PIC&DTMF help



mothaner
- 16th August 2011, 13:50
I want the work of the electronic circuit with a program . I Beginner and I want to explain the program if possible
Means. If I want to send the following numbers 8736 works the door.
And I want to know where I can change my numbers, for example. the first door 2345 works. 765432 Part II works, and so on .....
Thanks
http://www11.0zz0.com/2011/08/16/10/719216895.gif

ScaleRobotics
- 16th August 2011, 14:10
Hi, and welcome to the forum. I am not sure I understand exactly what you are trying to do, but hopefully I have the basics. Here is an example of a keypad http://www.picbasic.co.uk/forum/content.php?r=215-Matrix-Keypad-routine

For the dtmf part, PBP has the DTMFOUT command as described in the manual.

Dave
- 16th August 2011, 16:08
Yeah, PBP does have a generator but, he has an 8870 decoder drawn connected to the PIC to activate the door. I think he is asking how to do it in software?

ScaleRobotics
- 16th August 2011, 16:32
Decoding DTMF in software is harder. Here is one example in asm: http://www.instructables.com/id/DTMF-Touch-Tone-Decoder-Using-Microchip-PIC-Microp/#step1

And here is Microchip's app note AN257 http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en024294

5875

Probably easier to stick with your 8870, or something similar.

mothaner
- 17th August 2011, 17:10
Thank you all. I want to program for PIC to receiv the DTMF
My problem with the recipient

b1arrk5
- 17th August 2011, 18:06
I've used Darrel's Instant Interrupts to capture an interrupt on PortB.0, this is connected to the StD pin on the 8870. Then the code is
/Code
'This is an interrupt on PortB.0, when there is a valid DTMF tone decoded
DTMFINT:
DTMF = 0 'RESET THE VARIABLE
WHILE portb.0 = 1 ' depends on how long they press the dtmf buttons
IF portc.0 = 1 THEN DTMF.0 = 1 'Ones Column
IF portb.4 = 1 THEN DTMF.1 = 1 'Twos Column
IF portb.2 = 1 THEN DTMF.2 = 1 'Fours Column
IF portb.1 = 1 THEN DTMF.3 = 1 'Eights Column
WEND
@ INT_RETURN ; Returns with the new dtmf value stored in DTMF variable
CODE/

Then you can just read your variable. Hope this helps,

Jerry

mothaner
- 18th August 2011, 14:20
hello. I found this program. But I need to understand it. I do not know where I change my numbers received.
Example I want to run the Circuit after the following order numbers 3432657
Thank you
''''''''''''''''''''''''''''''''''''
' Receiver Basic Program
''''''''''''''''''''''''''''''''''''
device = 16f628A
config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, BODEN_OFF, LVP_OFF, CP_on, MCLRE_ON
all_digital true
Dim Temp as byte
Dim Time as byte
Dim loop as byte
Dim flag as bit
''''''''''''''''''''''''''
SYMBOL NO = 5
'************************
Dim dat[NO] as byte
'&&&&&&&&&&&&&&&
dat[0]=1
dat[1]=2
dat[2]=3
dat[3]=4
dat[4]=5
trisb = %00011111
trisa = %11111111
OPTION_REG = %11000000
low portb.4
low portb.6
low portb.5
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' First Timer, Delay after starting
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for Time = 1 to 120
delayms 2000 ' 4 min. low speed flash delay
toggle portb.5
next Time
for Time = 1 to 60
delayms 500 ' 1 min. high speed flash delay
toggle portb.5
if Time > 50 then high portb.4
next loop
low portb.4
low portb.5
''''''''''''''''''''%%%%%%%%%%%%%%%%%%%%%----------
on interrupt ISR
INTCON = %10011000
portb.0 = 0
loop = 0
main:
goto main
disable
ISR:
if INTCON.1 = 1 then intf1
goto Exit_ISR
intf1:
INTCON.1 = 0
Temp = porta
Temp = Temp & %00001111
if Temp = dat[loop-1] and loop > 0 then
goto Exit_ISR
else
loop = loop + 1
if Temp <> dat[loop-1] then
loop = 0
else
if loop = NO then high portb.6 : high portb.5 : delayms 10000 : low portb.6 : low portb.5 : loop=0
endif
endif
goto Exit_ISR
Exit_ISR:
resume
enable
goto main

ScaleRobotics
- 18th August 2011, 15:05
What compiler do you have? You would have to understand what this program does really well, then translate it to picbasic, if you have picbasic.

mothaner
- 18th August 2011, 16:07
Thank you very much. On your answer to me. I do not understand the program. This is a program for the circuit received the symbols of the DTMF, but I do not know any figures must be sent to the program works. And I do not have the program the PICBasic.I want to know how can I control Electrical circuit through the numbers that I want to work. I want the appointing numbers,

ScaleRobotics
- 18th August 2011, 16:45
There isn't enough commenting in the code for me to have a clue what it's doing, besides blinking some LED's. If you don't have PBP, I don't see how we are going to be able to help you, seeing as this is a PBP help forum and all. It is fairly common for people to come here not knowing much about PBP, and for them to ask us to program their project for them. But usually people helping here will just want to assist in a project, and not do the whole project for someone, for free. If you really want to do it, I suggest using a free product, like assembly, or purchasing a compiler you are interested in. And then get some code together (by reading it's manual, and learning all you can), then ask for help on the forum for that compiler, (whichever one you decide on). I also second the recommendation of using a tone decoder chip. They are pretty easy to work with.

mothaner
- 18th August 2011, 21:36
I just want to know where I can change my DTMF codll even know what was sent from the figures.

ScaleRobotics
- 18th August 2011, 22:26
My best guess is the array called dat. But its not really documented at all, so who knows. Its also not in picbasic, but I am unclear how you will compile it. Do you own any compiler?

Dave
- 18th August 2011, 22:38
For those following this thread, Attached are the schematics, code and some pic's of the repeater link controller I designed quite a few years back for the radio club I belong to. I see no need to keep these a under wraps any more as the repeater owner has sold the repeater's to another club. I was the custodian for about 8 years or so and we had at any one time about 8 of these links in operation between two different repeater systems. I just thought the gentelman could use this code as the basis or at least see how to connect an external tone decoder to a pic. Enjoy... I think the code is documented pretty well as far as I can see. Maybe it should be submitted or promoted as an article...