YESLet's say I've transmitted 'AT+CMGS=(phone number)', do I have to wait to receive a '>' before transferring the message to phone?
YESThen complete the message by 'control-z'?
Internal Program memory space on 8051 start from 0000h and ended at 1FFFh, this Program Memory is reside on ROM! And you have to start you program from 0000h!I start my program from 30H, then it ends up more than F0H, what shall I do? RAM is only from 30H up to 7FH right? Shall I program it into ROM?
For you program right now, you don't need use external RAM or external ROM.As I might edit the program which I have written but ROM cannot be overwrote, or shall I place the program into external RAM?
8051 is totally compatible with 8951. No problem at all.Another thing is that I've changed 8051 to 8951 because it is EPROM. Do they perform the same?
the ASCII code for the key 'enter' is 0x0DAnother question is that what is the ASCII code for the key 'enter'?
Why must it be 0x0D? Can I write just 0DH? What is the 'x' for? Then 1AH or 0x1A for ctrl-z?the ASCII code for the key 'enter' is 0x0D
0x indicate to the compiler that the next number is in Hex.dancingqueeneng said:Why must it be 0x0D? Can I write just 0DH? What is the 'x' for? Then 1AH or 0x1A for ctrl-z?the ASCII code for the key 'enter' is 0x0D
MOV IE, #00 ;Disable interrupts
CLR SMOD ;Select divide by 384
CLR TR0 ;Off timer 0
CLR TR1 ;Off timer 1
MOV TMOD, #20H ;Timer 1 in mode 2
MOV TH1, #-3 ;9600 baud rate
SETB TR1 ;Start timer 1
MOV SCON, #50H ;8-bit, 1 stop bit, REN enabled
I don't think so, normally I don't use double quotation (")1- In the command AT+CMGS=" Number" you should write the AsCII code of the " which is decimal 34 hence the command should be as follow:
'A','T','+','C','M','G','S','=', 34,NUMBER, 34, 13,10
Right, Nokia 8250 is one of the cell phone that can't accept AT Command2-Are you sure the the NOKIA phone you use can accept communication through AT commandd???
Normally I wait the answer from cell phone, this way is more precise than time delay3- You insert inter commands delay to make sure the modem inside the Nokia get your command.
YesAre they correct?
Separately! One by oneBut I have a question here, do I have to receive the letter 'O', then clear the flag, then receive the letter 'K' before I proceed? The two letters 'O' and 'K' are received separately or at the same time?
Right, Nokia 8250 is one of the cell phone that can't accept AT Command2-Are you sure the the NOKIA phone you use can accept communication through AT commandd???
Can you please help me to check if there is any error in my program? I'm in urgent and I don't know how to troubleshoot the problem, sorry to trouble you but I really appreciate your helping hand, thanks a lot.
P/s: Can I assign my program address like what I assigned in the program? Or do I need to modify the address?
SENSOR BIT P1.0
IRin BIT P1.1
IRout BIT P1.2
ORG 0000H ;Power up
MAIN:
MOV DPTR,#ST
MOV R6,DPH
MOV R7,DPL
MOV TMOD,#20H ;Timer 1 in mode 2
MOV TH1,#-3 ;9600 baud rate
SETB TR1 ;Start timer 1
MOV SCON,#50H ;8-bit, 1 stop bit, REN enabled
;
; ***** you don't need to execute the following 4 lines every time
;
MOV DPTR,#CMGF
ACALL SingleCommand
MOV DPTR,#CSCA
ACALL SingleCommand
;
; ******** I don't known what do you want in the following 8 lines
;
NextMessage:
CLR IRin ;Configure IRin as output
LOOP:
JNB SENSOR,LOOP ;Loop until door is open (active high)
SETB IRin
CLR IRin ;Pulse Infrared
LOOP1:
JB IRout,LOOP1 ;Loop until signal is reflected (active low)
;
; ***** Send SMS
;
MOV DPTR,#CMGS
ACALL ATcommand
WaitReady:
ACALL SerialIn ;Get the status of the phone
CJNE A,#'>',WaitReady ;Repeat if symbol '>' not received
;
MOV DPH,R6
MOV DPL,R7
ACALL ATcommand
MOV R6,DPH
MOV R7,DPL
;
CLR A
MOVC A,@A+DPTR
JNZ NextMessage
FINISH:
JMP FINISH ;If yes, end of program
SerialOut:
MOV SBUF,A ;Load the data
WaitTI:
JNB TI,WaitTI ;Stay until last bit sent
CLR TI ;Get ready for next character
RET
SendIt:
ACALL SerialOut
ATcommand:
CLR A
MOVC A,@A+DPTR
INC DPTR
JNZ SendIt
RET
SingleCommand:
ACALL ATcommand
Wait0DH:
ACALL SerialIn
CJNE A,#0DH,Wait0DH
RET
SerialIn:
JNB RI,SerialIn ;Wait for another character
MOV A,SBUF ;Save it in accumulator
CLR RI ;Get ready for next character
RET
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
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?