Serin2 & Serout2

Status
Not open for further replies.

eugenesiew

New Member
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
===================================================
 
The first thing is that there may be local echo on the T630. The echo back from the T630 may be confusing your code.

You can turn off local echo (ATE0 - that is ATE<zero> not ATE<O as in orange>) then what you need to do is use hyperteminal to monitor what is being sent by the code and replied by the T630. The circuit attatched shows what you need.

With that, signals going in either direction will pull down through the diodes. That is converted to RS232 levels, and monitored by the PC, which runs hyperterminal. That should let you see what is going wrong.
 

Attachments

  • phone.gif
    5 KB · Views: 175
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…