??? 03/12/07 10:34 Read: times |
#134750 - [Help] AT89C51 with GSM MC35i terminal problem |
I'm using AT89C51 to control MC35i to send sms, my problem is the program keeps on looping to receive an 'OK' from the MC35i, which means I can't receive a reply from the modem after I've sent AT commands to it. I know that to interface between these 2 devices, I have to use a MAX232 to convert level between TTL and RS232, but I'm not sure about the connection between MC35i (which has a RS232 port) and MAX232, is it only the Tx, Rx and ground of RS232 are needed to be connected? How about other 6 pins such as RTS, CTS, DTR and DSR? Do they need to be connected?
Below is my program, is there any problem in my program? The program keeps on looping at the section in bracket, is it because of the MC35i does not receive any AT commands from the microcontroller? ORG 0000H ;Power up SJMP MAIN ORG 50H MAIN: MOV P2,#01H ACALL DELAY MOV PCON,#80H MOV SCON,#52H ;8-bit, 1 stop bit, REN enabled MOV TMOD,#20H ;Timer 1 in mode 2 MOV TH1,#-3 ;9600 baud rate SETB TR1 ;Start timer 1 MOV DPTR,#ST ;Get address of Station MOV R6,DPH ;Save higher data pointer MOV R7,DPL ;Save lower data pointer MOV P2,#81H ACALL DELAY NextMessage: MOV DPTR,#AT ;Get address of AT MOV P2,#11H ACALL DELAY ACALL SingleCommand ;Send AT+CMGF MOV DPTR,#CMGF ;Get address of AT+CMGF MOV P2,#22H ACALL DELAY ACALL SingleCommand ;Send AT+CMGF MOV DPTR,#CSCA ;Get address of AT+CSCA MOV P2,#33H ACALL DELAY ACALL SingleCommand ;Send AT+CSCA MOV DPTR,#CMGS ;Get address of AT+CMGS MOV P2,#44H ACALL DELAY ACALL ATcommand ;Send AT+CMGS WaitReady: ACALL SerialIn ;Get the status of the phone CJNE A,#'>',WaitReady ;Repeat if symbol '>' not received MOV DPH,R6 ;Retrieve higher address of station MOV DPL,R7 ;Retrieve lower address of station ACALL ATcommand ;Send station MOV R6,DPH ;Save current higher address of station MOV R7,DPL ;Save current lower address of station CLR A ;Clear accumulator MOVC A,@A+DPTR ;Get data to be saved into accumulator JNZ NextMessage ;Jump to NextMessage if '0' is reached MOV P2,#88H ACALL DELAY FINISH: JMP FINISH ;If yes, end of program SerialOut: CLR TI MOV SBUF,A ;Load the data WaitTI: JNB TI,WaitTI ;Stay until last bit sent CLR TI ;Get ready for next character MOV P2,#55H ACALL DELAY RET SendIt: ACALL SerialOut ;Jump to send ATcommand: CLR A ;Clear accumulator MOVC A,@A+DPTR ;Get data to be saved into accumulator INC DPTR ;Point to next data MOV P2,#99H ACALL DELAY JNZ SendIt ;Jump to send if it is not zero RET SingleCommand: ACALL ATcommand ;Jump to ATcommand Wait0DH: ACALL SerialIn ;Jump to receive CJNE A,#0DH,Wait0DH ;Jump if not equals to carriage return MOV P2,#77H ACALL DELAY RET (SerialIn: MOV P2,#00H ACALL DELAY MOV P2,#0FFH ACALL DELAY JNB RI,SerialIn ;Wait for another character) MOV A,SBUF ;Save it in accumulator CLR RI ;Get ready for next character MOV P2,#66H ACALL DELAY RET DELAY: ACALL DELAY1 ACALL DELAY1 DELAY1: MOV R2,#0FFH ; 1 machine cycle,1.085us LONG1: MOV R3,#0FFH ; 1 machine cycle,1.085us LONG2: DJNZ R3,LONG2 ; 2 machine cycle . DJNZ R2,LONG1 ; Total delay = 256X256X2X1.085u = 142ms RET AT: DB 'AT',0DH,0 CMGF: DB 'AT+CMGF=1',0DH,0 CSCA: DB 'AT+CSCA="+60120000015"',0DH,0 CMGS: DB 'AT+CMGS="+60122521131"',0DH,0 ST: DB '01',1AH,0,'02',1AH,0,'03',1AH,0,0 END Thanks in advance. ![]() Is this connection correct? |
Topic | Author | Date |
[Help] AT89C51 with GSM MC35i terminal problem | 01/01/70 00:00 | |
testing and troubleshooting | 01/01/70 00:00 | |
Simulated using 8051IDE | 01/01/70 00:00 | |
RTFM! | 01/01/70 00:00 | |
MC35i or MC35i Terminal? | 01/01/70 00:00 | |
Not entirely true | 01/01/70 00:00 | |
It is Siemens MC35i terminal | 01/01/70 00:00 | |
Wrong connections | 01/01/70 00:00 | |
What is IGT? | 01/01/70 00:00 | |
IGT | 01/01/70 00:00 | |
power supply? | 01/01/70 00:00 | |
Stop!! | 01/01/70 00:00 | |
Providing IGT | 01/01/70 00:00 | |
Right | 01/01/70 00:00 | |
I'm done with it. | 01/01/70 00:00 | |
Manual reading time | 01/01/70 00:00 | |
Must add the 2 more signal | 01/01/70 00:00 | |
No, that's not right | 01/01/70 00:00 | |
MC35i was siemens GSM modem module | 01/01/70 00:00 | |
Pardon?? | 01/01/70 00:00 | |
baudrate 9600? | 01/01/70 00:00 | |
Not necessarily | 01/01/70 00:00 | |
m35i with uC.. | 01/01/70 00:00 | |
I think ur using wrong baud rate | 01/01/70 00:00 | |
Wrong | 01/01/70 00:00 | |
Andy Neil is really someone | 01/01/70 00:00 | |
Nearly![]() | 01/01/70 00:00 |