eugenesiew
Member level 2
I have written a code for a sms controller. The code works perfectly well in hyper terminal, but when connected with SE T630, it doesn't seem to work at all. I found out that the main reason was the SERIN2 part, if i had that part remove, the code can be run on SE T630. But that only makes my communication one way, from controller to T630, but no communication from T630 to controller. Is that any mistake in my code or is there any other way to see if data can be transmit from SE T630 to the controller. thanks!
===================================================
define OSC 20
Include "modedefs.bas"
trisb.0=0
TRISB.3=1
X var byte
start:
IF PORTB.3=1 THEN
SEROUT2 portb.1, 16780, ["AT+CMGF=1", 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["AT+CPMS=", 34, "ME", 34, 44, 34, "ME", 34, 44, 34, "ME", 34, 10, 13]
pause 3000
SERIN2 portb.2,16780,[ WAIT ("3479 "),X]
SEROUT2 portb.1, 16780, ["AT+CMGR=1", 10, 13]
pause 3000
Select case X
case "A"
SEROUT2 portb.1, 16780, ["at+cmgs=",34, "0123456789",34, 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["LED A turn on", 26]
pause 3000
case "a"
SEROUT2 portb.1, 16780, ["at+cmgs=",34, "0123456789",34, 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["LED A turn off", 26]
pause 3000
case else
SEROUT2 portb.1, 16780, ["at+cmgs=",34, "0123456789",34, 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["Invalid Command", 26]
pause 3000
end select
ENDIF
goto start
===================================================
===================================================
define OSC 20
Include "modedefs.bas"
trisb.0=0
TRISB.3=1
X var byte
start:
IF PORTB.3=1 THEN
SEROUT2 portb.1, 16780, ["AT+CMGF=1", 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["AT+CPMS=", 34, "ME", 34, 44, 34, "ME", 34, 44, 34, "ME", 34, 10, 13]
pause 3000
SERIN2 portb.2,16780,[ WAIT ("3479 "),X]
SEROUT2 portb.1, 16780, ["AT+CMGR=1", 10, 13]
pause 3000
Select case X
case "A"
SEROUT2 portb.1, 16780, ["at+cmgs=",34, "0123456789",34, 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["LED A turn on", 26]
pause 3000
case "a"
SEROUT2 portb.1, 16780, ["at+cmgs=",34, "0123456789",34, 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["LED A turn off", 26]
pause 3000
case else
SEROUT2 portb.1, 16780, ["at+cmgs=",34, "0123456789",34, 10, 13]
pause 3000
SEROUT2 portb.1, 16780, ["Invalid Command", 26]
pause 3000
end select
ENDIF
goto start
===================================================