I am working on a project and wrote the following program but there was no response, so i wish that someone could help me in that?
DEFINE LOADER_USED1 'only required if bootloader is used to program PIC
DEFINE HSER_RCSTA 18h 'set recieve register to reciever enabled
DEFINE HSER_TXSTA 98h 'set transmit register to transmitter enabled
DEFINE HSER_BAUD 9600 'set baud rate
DEFINE HSER_SPBRG 99h 'set SPBRG directly
DEFINE HSER_CLROERR 1
INCLUDE "modedefs.bas"
init:
TRISA=%111000 ' set port A status
TRISB=%10000010 ' set port B status
PORTA=%000000 'inital state of port A
PORTB=%00000000 'initial state of port B
freq VAR WORD
dur VAR WORD
Lock VAR PORTB.4
main:
GoSub Dial
GoSub ME
freq=4000
dur=2000
GoSub latch
End
Dial:
IF PORTB.1 = Low Then
HSerout["AT"] 'Initialize the Modem
Pause 500
HSerout["ATD0505969798;"] 'Store number
Pause 500
HSerout["ATDME0505969798;"] 'Dial the stored number
Pause 500
End IF
Return
ME:
High TXD
HSerout["ATX=[2]"] ' busy line
Pause 2000
Low TXD
Pause 2000
HSerin 500,ME,[wait("OK")]
IF PORTC.7 Then
GoSub msg
Else
High TXD
Pause 2000
HSerout["ATH"]
Low TXD
Pause 2000
EndIF
Return
msg:
RXD=0
High PORTB.0
Pause 2000
Sound PORTB.0,[dur,freq] 'play msg on intercom
Pause 6000
Low PORTB.0
Pause 2000
Return
latch:
DTMFOut PORTB.1,[2]
IF PORTB.1 Then
High Lock
Pause 2000
Else
Low Lock
Pause 2000
EndIF
Return
Note: I used GM29 Sony Ericsson modem and PIC16f876 micochip.
Best Regards,
Eng.Baby heart
Bookmarks