Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8051 + AT commands using Nokia phone

Status
Not open for further replies.
It is strange that the LCD is causing a drop in voltage. If the 8051 pins are left open or are connected to a CMOS input, it should show close to 5V. Can you check with oscilloscope to see what is happening.
 

1.8V is measured after it is connected to LCD.
What is the voltage before connect AT89S51 to LCD module?
 

I think what is happening here is that the LCD port is being written at a high speed and the multimeter is showing the average voltage of the port pin which is actually 0-5V pulses.
 

budhy said:
1.8V is measured after it is connected to LCD.
What is the voltage before connect AT89S51 to LCD module?

It is also around 1.8V, very weird.

Added after 1 minutes:

techie said:
I think what is happening here is that the LCD port is being written at a high speed and the multimeter is showing the average voltage of the port pin which is actually 0-5V pulses.

But the problem is that the LCD treats the input to it is low, since 1.8V is too low to drive the LCD, there isn't any display on the LCD.
 

But you are driving the port high and low very fast in the software. It appears to be 1.8V. Change the software temporarily so that it just keeps a high level on the port and then measure the voltage. Alternately, use a blank controller and see what is the voltage.
 

What is the voltage before connect AT89S51 to LCD module?
It is also around 1.8V, very weird.
That's the answer, there is some problem with your 8051 chip or some thing wrong with your PCB circuitry.
Please measure the voltage at pin #20 & #40 of 8051 directly! (that is power supply pins)

techie wrote:
It is strange that the LCD is causing a drop in voltage.
 

Please measure the voltage at pin #20 & #40 of 8051! (that is power supply pins)

I obtain 5V when I measure the voltage at these 2 pins, should be ok... This is another 8951 that I've bought, quite new, shouldn't be a problem as well.
 

What happens when you put a blank 89S51. I mean how much is the voltage on port pins. Is it 5V
 

This I have to test it out tomorrow, but I think it will be 5V.
 

If you have an oscilloscope, do check for signal on a programmed controllers as well.
 

I'm now continuing on my sms sending via handphone and AT89S51, when I run the program, the program runs and then stops when it tries to receive the status from phone, below is my program:

ORG 0000H ;Power up
SJMP MAIN

ORG 50H
MAIN:
MOV P2, #01H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
MOV SCON,#50H ;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
SETB P3.0
SETB P3.1
MOV P2, #81H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
NextMessage:
MOV DPTR,#AT ;Get address of AT
MOV P2, #11H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
ACALL SingleCommand ;Send AT+CMGF
MOV DPTR,#CMGF ;Get address of AT+CMGF
MOV P2, #22H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
ACALL SingleCommand ;Send AT+CMGF
MOV DPTR,#CSCA ;Get address of AT+CSCA
MOV P2, #33H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
ACALL SingleCommand ;Send AT+CSCA
MOV DPTR,#CMGS ;Get address of AT+CMGS
MOV P2, #44H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
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 DELAY1
ACALL DELAY1
ACALL DELAY1
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
MOV P2, #55H
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
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 DELAY1
ACALL DELAY1
ACALL DELAY1
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 DELAY1
ACALL DELAY1
ACALL DELAY1
RET

SerialIn:
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 DELAY1
ACALL DELAY1
ACALL DELAY1
RET

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 .Total delay = 256X256X2X1.085u = 142ms
DJNZ R2,LONG1
RET

AT: DB 'AT',0DH,0AH,0
CMGF: DB 'AT+CMGF=1',0DH,0AH,0
CSCA: DB 'AT+CSCA="+60120000015"',0DH,0AH,0
CMGS: DB 'AT+CMGS="+60122521131"',0DH,0AH,0
ST: DB '01',0,'02',0,'03',0,0

END

The LEDs connected to port 2 are lighted up following the sequence: 01H, 81H, 11H,99H,55H,99H,55H,99H,55H,99H,55H,99H then stopped. It is supposed to light up 66H, 77H and so on but it just stopped there, which means it didn't receive any response from the Nokia 8250 in this case right? Is it the phone's problem? In this case the reception and transmission port are both 4.5 - 5 V, which I think is sufficient enough to perform transmission and reception.

Then I tried to use Siemens MC35i terminal, with this, the program doesn't even run, and the voltage on P3.1 which is transmission port is -0.63V, why does this happen? For this GSM module, I need to just connect the Txd, Rxd and Gnd only right? Any other pins to be connected?

Thanks in advance.
 

I have modified your code like this:
Code:
  ORG 0000H     ;Power up
  SJMP MAIN

  ORG 50H
MAIN:
  MOV   P2,#01H
  ACALL DELAY
  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
  SETB  P3.0
  SETB  P3.1
  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:
  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:
  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',0,'02',0,'03',0,0

        END

The main problem is : AT command is ended with 0Dh, not 0Dh,0Ah

Copy and assembly my above code as it, don't make any modification.
And make your that your Serial Input wiring is no problems

Waiting your response
 
Too bad my 8951 chip is not functioning now, even a simplest program also it doesn't run, it is so weird that I haven't touched it after I've finished trying yesterday, yet it doesn't work at all when I tried today...

I'll look for another chip soon, but I am curious, why is this 8051 chip so unstable? This doesn't happen on PIC chip.
 

Can any one please give me a schematic about interfacing Nokia mobiles with a cell phone?
 

dancingqueeneng wrote:
Then I tried to use Siemens MC35i terminal, with this, the program doesn't even run, and the voltage on P3.1 which is transmission port is -0.63V, why does this happen? For this GSM module, I need to just connect the Txd, Rxd and Gnd only right? Any other pins to be connected?
after that :
Too bad my 8951 chip is not functioning now, even a simplest program also it doesn't run, it is so weird that I haven't touched it after I've finished trying yesterday, yet it doesn't work at all when I tried today...
How do you connect Siemens MC35i terminal to MCS51? Directly?
Do you realize that Siemens MC35i terminal connector is RS232 signal which operate on -12 to +12 Volt? Siemens MC35i terminal will burn out you uC chip if you connect them directly!

RollingEEE wrote:
Can any one please give me a schematic about interfacing Nokia mobiles with a cell phone?
what do you mean with interfacing Nokia mobiles with a cell phone?
 
what do you mean with interfacing Nokia mobiles with a cell phone?

I want the microcontroller to command a Nokia phone, to send SMS, or call a particular number, or fetch a new SMS from the mobile
 

To call a number
ATD123456789;

To send SMS
AT+CMGS="123456789"

To Fetch all SMS
AT+CMGL=4
 

Do you realize that Siemens MC35i terminal connector is RS232 signal which operate on -12 to +12 Volt? Siemens MC35i terminal will burn out you uC chip if you connect them directly!

Then how shall I connect this Siemens MC35i to 8951?
 

dancingqueeneng wrote:
Then how shall I connect this Siemens MC35i to 8951?
is this the Siemens MC35i that you mean?

96_1171387444.jpg


if so use this interface circuit diagram

25_1171380295.gif


RollingEEE wrote:
Can any one please give me a schematic about interfacing Nokia mobiles with a cell phone?
I want the microcontroller to command a Nokia phone, to send SMS, or call a particular number, or fetch a new SMS from the mobile
Basically the µC-Cellphone interface circuit is a serial interface circuit only, connect µC RX to cellphone TX dan connect cellphone RX to µC TX, but you have to consider the voltage level different between them!
Please inform me what kind of Nokia phone and µC you'll used, I help you to configure the circuit.

Please check this discussion
 

Thanks budhy for your schematic diagram, but I have some questions:

1. Since I'm using MC35i, do I need to change the baud rate to 19200 instead of 9600?

2. Pin 7, 10, 12 and 13 of MAX232 have to be grounded or just leave it? And some diagrams show that the capacitance value is 10uF instead of 1mF, is there any difference?

3. I don't have any RS232 serial cable, can I use ordinary wires to connect the RS232 to MAX232?

4. The MC35i operates from 8V to 30V, so do I need to perform any voltage adjustment between MC35i, AT89S51 and MAX232?

Thanks in advance.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top