dear..
i have sms aler project hardware and code.it's working stating time and 2 or 3 hours then not working .please help me. wavecom M1206B modem and max232 circuit.(for max 232 circuit 16v/10uf capacitor)
DEFINE OSC 4
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25
DEFINE HSER_CLROERR 1
PortDStatus var BYTE
TRISB=%00000000
PORTB=%00000000
trisD=%00001111
portD=%00000000
GSM_CHECK:
portb=%11110000
pause 15000
HSEROUT ["AT",13]
HSERIN 5000, GSM_CHECK, [WAIT("OK")]
PAUSE 100
portb=%01110000
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
PAUSE 100
HSEROUT ["system ok",26]
HSERIN 5000, BEGIN, [WAIT("OK")]
pause 200
PORTB=%00000000
'get initial status
PortDStatus.0 = PORTD.0
PortDStatus.1 = PORTD.1
PortDStatus.2 = PORTD.2
BEGIN:
HSEROUT ["AT",13]
HSERIN 5000, GSM_CHECK, [WAIT("OK")]
PAUSE 100
high PORTB.3
if PORTD.0 != PortDStatus.0 then
pause 10
PortDStatus.0 = PORTD.0
if PORTD.0 = 1 then
gosub SEND_SMS0
else
gosub SEND_SMS1
endif
endif
if PORTD.1 != PortDStatus.1 then
pause 10
PortDStatus.1 = PORTD.1
IF PORTD.1 = 1 then
gosub SEND_SMS2
else
gosub SEND_SMS3
endif
endif
if PORTD.2 != PortDStatus.2 then
pause 10
PortDStatus.2 = PORTD.2
IF PORTD.2 = 1 then
gosub SEND_SMS4
else
gosub SEND_SMS5
endif
endif
PAUSE 100
LOW PORTB.3
GOTO BEGIN
SEND_SMS0:
HIGH PORTB.4
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit ,1,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit ,1,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit ,1,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.4
return
SEND_SMS1:
HIGH PORTB.4
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit ,1, triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit ,1, triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit ,1, triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.4
return
SEND_SMS2:
HIGH PORTB.5
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit,2,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit,2,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit,2,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.5
return
SEND_SMS3:
HIGH PORTB.5
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit,2,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit,2,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit,2,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.5
return
SEND_SMS4:
HIGH PORTB.6
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit ,3, Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit ,3, Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit ,3, Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.6
return
SEND_SMS5:
HIGH PORTB.6
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit,3,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit,3,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit,3,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.6
return
end
i have sms aler project hardware and code.it's working stating time and 2 or 3 hours then not working .please help me. wavecom M1206B modem and max232 circuit.(for max 232 circuit 16v/10uf capacitor)
DEFINE OSC 4
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25
DEFINE HSER_CLROERR 1
PortDStatus var BYTE
TRISB=%00000000
PORTB=%00000000
trisD=%00001111
portD=%00000000
GSM_CHECK:
portb=%11110000
pause 15000
HSEROUT ["AT",13]
HSERIN 5000, GSM_CHECK, [WAIT("OK")]
PAUSE 100
portb=%01110000
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
PAUSE 100
HSEROUT ["system ok",26]
HSERIN 5000, BEGIN, [WAIT("OK")]
pause 200
PORTB=%00000000
'get initial status
PortDStatus.0 = PORTD.0
PortDStatus.1 = PORTD.1
PortDStatus.2 = PORTD.2
BEGIN:
HSEROUT ["AT",13]
HSERIN 5000, GSM_CHECK, [WAIT("OK")]
PAUSE 100
high PORTB.3
if PORTD.0 != PortDStatus.0 then
pause 10
PortDStatus.0 = PORTD.0
if PORTD.0 = 1 then
gosub SEND_SMS0
else
gosub SEND_SMS1
endif
endif
if PORTD.1 != PortDStatus.1 then
pause 10
PortDStatus.1 = PORTD.1
IF PORTD.1 = 1 then
gosub SEND_SMS2
else
gosub SEND_SMS3
endif
endif
if PORTD.2 != PortDStatus.2 then
pause 10
PortDStatus.2 = PORTD.2
IF PORTD.2 = 1 then
gosub SEND_SMS4
else
gosub SEND_SMS5
endif
endif
PAUSE 100
LOW PORTB.3
GOTO BEGIN
SEND_SMS0:
HIGH PORTB.4
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit ,1,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit ,1,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit ,1,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.4
return
SEND_SMS1:
HIGH PORTB.4
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit ,1, triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit ,1, triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit ,1, triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.4
return
SEND_SMS2:
HIGH PORTB.5
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit,2,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit,2,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit,2,Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.5
return
SEND_SMS3:
HIGH PORTB.5
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit,2,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit,2,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit,2,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.5
return
SEND_SMS4:
HIGH PORTB.6
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit ,3, Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit ,3, Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit ,3, Synchronise",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.6
return
SEND_SMS5:
HIGH PORTB.6
HSEROUT ["at+cmgs=",34,"0718623462",34,13]
HSEROUT ["unit,3,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0715354064",34,13]
HSEROUT ["unit,3,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
HSEROUT ["at+cmgs=",34,"0712537063",34,13]
HSEROUT ["unit,3,triped",26]
HSERIN 15000, BEGIN, [WAIT("OK")]
LOW PORTB.6
return
end