1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Problem in interfacing 8051 with gsm module

Discussion in 'Embedded' started by embedidea, Jul 3, 2006.

  1. embedidea

    embedidea Guest

    Hello All,
    We are a group a students doing our study project. we are trying t
    interface gsm module with 8051 microcontroller. we are using Atme
    AT89c51. The problem is that we are also not able to get the data sent t
    the serial port on the Hyperterminal.we are using the MAX232 driver. Th
    pin connections are as follows:
    Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    The value of capacitors used for MAX232 is 1uF.
    The sample serial port program we have tried is:
    --------------------------------------------------------------------------
    ORG 0000H;
    LJMP MAIN;
    ORG 0030H;
    MAIN:
    MOV TMOD,#20H;
    MOV TH1,#0FDH;
    MOV TL1,TH1;
    MOV SCON,#50H;
    CLR TI;
    SETB TR1;
    HERE: MOV SBUF,#'B';
    LOOP: JNB TI,LOOP;
    CLR TI;
    SJMP HERE;
    END;
    --------------------------------------------------------------------------
    Once burnt this code on chip and started there is no data being displaye
    on the Hyperterminal.

    Expecting a help at the earliest.

    Thanks in advance.
     
    embedidea, Jul 3, 2006
    #1
    1. Advertising

  2. embedidea

    Tom Lucas Guest

    "embedidea" <> wrote in message
    news:...
    > Hello All,
    > We are a group a students doing our study project. we are trying to
    > interface gsm module with 8051 microcontroller. we are using Atmel
    > AT89c51. The problem is that we are also not able to get the data sent
    > to
    > the serial port on the Hyperterminal.we are using the MAX232 driver.
    > The
    > pin connections are as follows:
    > Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    > Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    > Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    > Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    > The value of capacitors used for MAX232 is 1uF.
    > The sample serial port program we have tried is:
    > --------------------------------------------------------------------------
    > ORG 0000H;
    > LJMP MAIN;
    > ORG 0030H;
    > MAIN:
    > MOV TMOD,#20H;
    > MOV TH1,#0FDH;
    > MOV TL1,TH1;
    > MOV SCON,#50H;
    > CLR TI;
    > SETB TR1;
    > HERE: MOV SBUF,#'B';
    > LOOP: JNB TI,LOOP;
    > CLR TI;
    > SJMP HERE;
    > END;
    > --------------------------------------------------------------------------
    > Once burnt this code on chip and started there is no data being
    > displayed
    > on the Hyperterminal.
    >
    > Expecting a help at the earliest.
    >
    > Thanks in advance.


    First up, I'd start documenting your code - it is even more important
    when using assembly. I haven't worked with 8051 so, whilst I can work
    out the flow with educated guesses, I don't know how you are setting up
    the UART. Labels such as "HERE" don't help much either - try things like
    TXLOOP or BUF_FILL or whatever that label is doing. Plus you get more
    marks for comments - it shows you understand the code and are not just
    asking newsgroups for solutions - oh wait ;-)

    Check your hardware and make sure no lines are shorting or open and that
    you have got the pin numbering correct - it's very easy to get a mirror
    of what you want because you were looking at the back of the connector
    when you were soldering.

    Get an oscilloscope and look at the data lines and verify that there is
    activity and that it is at the baud rate you expect with the right
    amount of data and the right start and stop bits. Then check that those
    are the settings hyperterminal is using and that flow-control is set
    correctly. Another favourite is listening on the wrong serial port.

    Eliminate the obvious problems before dissecting the code.
     
    Tom Lucas, Jul 3, 2006
    #2
    1. Advertising

  3. embedidea

    mmm Guest

    embedidea wrote:
    > Hello All,
    > We are a group a students doing our study project. we are trying to
    > interface gsm module with 8051 microcontroller. we are using Atmel
    > AT89c51. The problem is that we are also not able to get the data sent to
    > the serial port on the Hyperterminal.we are using the MAX232 driver. The
    > pin connections are as follows:
    > Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    > Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    > Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    > Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    > The value of capacitors used for MAX232 is 1uF.


    do the max232 connected right an working ?
    on Pin 2 you should read something like 9 Volt, on pin 6 you shold read
    -9 Volt

    remove the micro and short-circuit pin 10 and 11 of the micro-socket
    do you see on hyperteminal the echo of what you write ?

    do you have configured the hyperteminal tho the right paramterers?
    baud rate,parity,stop-bits and no-handshaking ?

    the cristal is oscillating and the micro resetted ?
    add on the loop the instruction to toggle a port bit so you check the
    micro is running

    last thing try: to burn one of the monitor code available on the net.


    > The sample serial port program we have tried is:
    > --------------------------------------------------------------------------
    > ORG 0000H;
    > LJMP MAIN;
    > ORG 0030H;
    > MAIN:
    > MOV TMOD,#20H;
    > MOV TH1,#0FDH;
    > MOV TL1,TH1;
    > MOV SCON,#50H;
    > CLR TI;
    > SETB TR1;
    > HERE: MOV SBUF,#'B';
    > LOOP: JNB TI,LOOP;


    > CLR TI;
    > SJMP HERE;
    > END;
    > --------------------------------------------------------------------------
    > Once burnt this code on chip and started there is no data being displayed
    > on the Hyperterminal.
    >
    > Expecting a help at the earliest.
    >
    > Thanks in advance.
    >
    >
    >
    >
     
    mmm, Jul 3, 2006
    #3
  4. embedidea

    embedidea Guest

    >
    >"embedidea" <> wrote in message
    >news:...
    >> Hello All,
    >> We are a group a students doing our study project. we are trying to
    >> interface gsm module with 8051 microcontroller. we are using Atmel
    >> AT89c51. The problem is that we are also not able to get the data sen


    >> to
    >> the serial port on the Hyperterminal.we are using the MAX232 driver.
    >> The
    >> pin connections are as follows:
    >> Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    >> Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    >> Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    >> Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    >> The value of capacitors used for MAX232 is 1uF.
    >> The sample serial port program we have tried is:

    >

    --------------------------------------------------------------------------
    >> ORG 0000H;
    >> LJMP MAIN;
    >> ORG 0030H;
    >> MAIN:
    >> MOV TMOD,#20H;
    >> MOV TH1,#0FDH;
    >> MOV TL1,TH1;
    >> MOV SCON,#50H;
    >> CLR TI;
    >> SETB TR1;
    >> HERE: MOV SBUF,#'B';
    >> LOOP: JNB TI,LOOP;
    >> CLR TI;
    >> SJMP HERE;
    >> END;

    >

    --------------------------------------------------------------------------
    >> Once burnt this code on chip and started there is no data being
    >> displayed
    >> on the Hyperterminal.
    >>
    >> Expecting a help at the earliest.
    >>
    >> Thanks in advance.

    >
    >First up, I'd start documenting your code - it is even more important
    >when using assembly. I haven't worked with 8051 so, whilst I can work
    >out the flow with educated guesses, I don't know how you are setting up
    >the UART. Labels such as "HERE" don't help much either - try things lik


    >TXLOOP or BUF_FILL or whatever that label is doing. Plus you get more
    >marks for comments - it shows you understand the code and are not just
    >asking newsgroups for solutions - oh wait ;-)
    >
    >Check your hardware and make sure no lines are shorting or open and tha


    >you have got the pin numbering correct - it's very easy to get a mirror
    >of what you want because you were looking at the back of the connector
    >when you were soldering.
    >
    >Get an oscilloscope and look at the data lines and verify that there is
    >activity and that it is at the baud rate you expect with the right
    >amount of data and the right start and stop bits. Then check that those
    >are the settings hyperterminal is using and that flow-control is set
    >correctly. Another favourite is listening on the wrong serial port.
    >
    >Eliminate the obvious problems before dissecting the code.
    >
    >
    >


    --------------------------------------------------------------------------
    Hello
    Thanks for the reply. we have checked all the connections and also th
    properties of the hyperterminal also. all are correct. but still not abl
    to get the data. Will there be any problem if we leave the other pins o
    the DB 9 connector with no connections.
    Expecting a reply.
    Thanks in advance.
     
    embedidea, Jul 3, 2006
    #4
  5. On Mon, 03 Jul 2006 10:07:18 -0500, in comp.arch.embedded "embedidea"
    <> wrote:

    >>
    >>"embedidea" <> wrote in message
    >>news:...
    >>> Hello All,
    >>> We are a group a students doing our study project. we are trying to
    >>> interface gsm module with 8051 microcontroller. we are using Atmel
    >>> AT89c51. The problem is that we are also not able to get the data sent

    >
    >>> to
    >>> the serial port on the Hyperterminal.we are using the MAX232 driver.
    >>> The
    >>> pin connections are as follows:
    >>> Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    >>> Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    >>> Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    >>> Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    >>> The value of capacitors used for MAX232 is 1uF.
    >>> The sample serial port program we have tried is:


    >--------------------------------------------------------------------------
    >Hello
    >Thanks for the reply. we have checked all the connections and also the
    >properties of the hyperterminal also. all are correct. but still not able
    >to get the data. Will there be any problem if we leave the other pins of
    >the DB 9 connector with no connections.
    >Expecting a reply.
    >Thanks in advance.
    >

    do you have the ground pins connected on the DB9?


    martin
     
    martin griffith, Jul 3, 2006
    #5
  6. embedidea

    Tom Lucas Guest

    "martin griffith" <> wrote in message
    news:...
    > On Mon, 03 Jul 2006 10:07:18 -0500, in comp.arch.embedded "embedidea"
    > <> wrote:
    >
    >>>
    >>>"embedidea" <> wrote in message
    >>>news:...
    >>>> Hello All,
    >>>> We are a group a students doing our study project. we are trying to
    >>>> interface gsm module with 8051 microcontroller. we are using Atmel
    >>>> AT89c51. The problem is that we are also not able to get the data
    >>>> sent

    >>
    >>>> to
    >>>> the serial port on the Hyperterminal.we are using the MAX232
    >>>> driver.
    >>>> The
    >>>> pin connections are as follows:
    >>>> Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    >>>> Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    >>>> Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    >>>> Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    >>>> The value of capacitors used for MAX232 is 1uF.
    >>>> The sample serial port program we have tried is:

    >
    >>--------------------------------------------------------------------------
    >>Hello
    >>Thanks for the reply. we have checked all the connections and also the
    >>properties of the hyperterminal also. all are correct. but still not
    >>able
    >>to get the data. Will there be any problem if we leave the other pins
    >>of
    >>the DB 9 connector with no connections.
    >>Expecting a reply.
    >>Thanks in advance.
    >>

    > do you have the ground pins connected on the DB9?
    >


    What he said.

    Plus are you able to check the signals with a scope?
     
    Tom Lucas, Jul 3, 2006
    #6
  7. embedidea

    embedidea Guest

    >>Hello
    >>Thanks for the reply. we have checked all the connections and also the
    >>properties of the hyperterminal also. all are correct. but still no

    able
    >>to get the data. Will there be any problem if we leave the other pin

    of
    >>the DB 9 connector with no connections.
    >>Expecting a reply.
    >>Thanks in advance.
    >>

    >do you have the ground pins connected on the DB9?
    >
    >
    >martin
    >

    --------------------------------------------------------------------------
    Hello Martin,
    We have connected the pin 5 of DB9 connector to ground. Also th
    properties set for hyperterminal are 9600 baudrate,no parity,1 stopbit,
    data bits and no flowcontrol.We have connected the pin 13 (R1in) an
    14(T1out) of MAX232 to pins 3 and 2 of DB 9 connector respectively.wil
    there be any problem if we leave the other pins of DB 9 connector?
    Expecting a help at the earliest.
    Thanks in advance.
     
    embedidea, Jul 4, 2006
    #7
  8. "embedidea" <> wrote in message
    news:...
    > Hello Martin,
    > We have connected the pin 5 of DB9 connector to ground. Also the
    > properties set for hyperterminal are 9600 baudrate,no parity,1 stopbit,8
    > data bits and no flowcontrol.We have connected the pin 13 (R1in) and
    > 14(T1out) of MAX232 to pins 3 and 2 of DB 9 connector respectively.will
    > there be any problem if we leave the other pins of DB 9 connector?
    > Expecting a help at the earliest.
    > Thanks in advance.


    If all fails, your only option is to look on the TX line from your board and
    check the bits and timing of your signal.
    Another thing noone else mentioned is that your way of testing comms is
    prone to fail: you are sending one continuous stream of the same character
    to the computer. There is no way for a receiving uart (your PC) to find a
    start bit in this stream if there is not at least one short period of
    "silence" on the line. And further: hyperteminal sucks. If you try to open a
    com port that already receives data, hyperterminal reports "unable to open
    port" many times. Use a decent comm program. A good and free one is TeraTerm
    which can be found on the internet.

    Meindert
     
    Meindert Sprang, Jul 4, 2006
    #8
  9. 1) Check that pin 20 of the processor is connected to GND
    2) Check that pin 40 of the processor is connected to VCC
    3) Check that pin 31 of the processor is connected to VCC
    4) Check that a suitable reset circuit is connected to pin 9 of the
    processor. After applying power you should have a logic "1" for some ms and
    a logic "0" for all the rest of time
    5) Check that the processor's oscillator is running by looking with a scope
    to pins 18 and 19.

    MOV TL1,TH1; is surely unnecessary because T1 works as 8-Bit-reload-counter
    where only TH1 has a meaning. Otherwise your code looks ok, i checked it
    against my own UART initialization routines. If you don't get the UART
    running try something more easy, just flipping some port pins around so that
    you can see whether you get the processor to operation at all.

    I guess its something in the hardware

    Regards
    Ulrich

    "embedidea" <> schrieb im Newsbeitrag
    news:...
    > Hello All,
    > We are a group a students doing our study project. we are trying to
    > interface gsm module with 8051 microcontroller. we are using Atmel
    > AT89c51. The problem is that we are also not able to get the data sent to
    > the serial port on the Hyperterminal.we are using the MAX232 driver. The
    > pin connections are as follows:
    > Pin 10(RXD) of Microcontroller to Pin 12(R1out) of MAX232.
    > Pin 11(TXD) of Microcontroller to Pin 11(T1in) of MAX232.
    > Pin 13(R1in) of MAX232 to Pin3 of DB9 connector.
    > Pin 14(T1out) of MAX232 to Pin 2 of DB9 connector.
    > The value of capacitors used for MAX232 is 1uF.
    > The sample serial port program we have tried is:
    > --------------------------------------------------------------------------
    > ORG 0000H;
    > LJMP MAIN;
    > ORG 0030H;
    > MAIN:
    > MOV TMOD,#20H;
    > MOV TH1,#0FDH;
    > MOV TL1,TH1;
    > MOV SCON,#50H;
    > CLR TI;
    > SETB TR1;
    > HERE: MOV SBUF,#'B';
    > LOOP: JNB TI,LOOP;
    > CLR TI;
    > SJMP HERE;
    > END;
    > --------------------------------------------------------------------------


    > Once burnt this code on chip and started there is no data being displayed
    > on the Hyperterminal.
    >
    > Expecting a help at the earliest.
    >
    > Thanks in advance.
    >
    >
    >
    >
     
    Ulrich Bangert, Jul 4, 2006
    #9
  10. On Tue, 04 Jul 2006 00:21:55 -0500, in comp.arch.embedded "embedidea"
    <> wrote:

    >>>Hello
    >>>Thanks for the reply. we have checked all the connections and also the
    >>>properties of the hyperterminal also. all are correct. but still not

    >able
    >>>to get the data. Will there be any problem if we leave the other pins

    >of
    >>>the DB 9 connector with no connections.
    >>>Expecting a reply.
    >>>Thanks in advance.
    >>>

    >>do you have the ground pins connected on the DB9?
    >>
    >>
    >>martin
    >>

    >--------------------------------------------------------------------------
    >Hello Martin,
    >We have connected the pin 5 of DB9 connector to ground. Also the
    >properties set for hyperterminal are 9600 baudrate,no parity,1 stopbit,8
    >data bits and no flowcontrol.We have connected the pin 13 (R1in) and
    >14(T1out) of MAX232 to pins 3 and 2 of DB 9 connector respectively.will
    >there be any problem if we leave the other pins of DB 9 connector?
    >Expecting a help at the earliest.
    >Thanks in advance.

    I dont have the max232 data sheet to hand

    Try this:

    Remove the processor, short the Tx pin and the Rx pin on the processor
    socket with a wire. reapply the power.

    This will loop through any serial comms through all your hardware. If
    this works you have a SW problem, if you get nothing or garbage you
    have a hardware problem.

    personally, I'd use C to test it. I use the rasonance complier, the
    simulator is ok for testing this sort of thing, and its free,and you
    can look at all the registers etc( but I dont want to start a C vs
    Asm war.)




    martin
     
    martin griffith, Jul 4, 2006
    #10
  11. embedidea

    embedidea Guest

    hello martin,

    we are able to send the data to the hyperterminal now. but the same dat
    when given to GSM modem doesnt work. we are using wavecom's module. w
    sent the basic at commands as data through UART. the program is a
    follows.
    --------------------------------------------------------------------------
    ORG 0000H;
    LJMP MAIN;
    ORG 0030H;
    MAIN:
    MOV TMOD,#20H;//setting timer 1
    MOV TH1,#0FDH;//initalizing timer1
    MOV SCON,#50H;//8 databits 1 startbit,1stop bit no parity
    CLR TI;
    CLR RI;
    SETB TR1;//starting timer1
    MOV A,#'A';//actully transmitting the command..
    MOV SBUF,A;// the command is atdt<phonenumber> for dialing
    ACALL TRANSMIT;
    MOV A,#'T';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'D';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'T';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'9';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'4';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'4';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'0';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'9';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'5';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'7';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'2';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'9';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#'5';
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#03BH;
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#0DH;
    MOV SBUF,A;
    ACALL TRANSMIT;
    MOV A,#0AH;
    MOV SBUF,A;
    ACALL TRANSMIT;
    HERE: SJMP HERE;
    TRANSMIT:
    HERE1: JNB TI,HERE1;
    CLR TI;
    RET;

    END;
    --------------------------------------------------------------------------
    we are able to get the data sent on the hyperterminal. but the same whe
    given to GSM modem doesnt work.
    please suggest any chages to the code to be made. we are confused if thi
    is the right way to send at commands from 8051.

    Thanks in advance.
     
    embedidea, Jul 10, 2006
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aleksandar Kovacevic

    GSM module with external camera

    Aleksandar Kovacevic, May 10, 2005, in forum: Embedded
    Replies:
    4
    Views:
    982
    Alex Gibson
    May 13, 2005
  2. Ansatt

    Cheap GSM module

    Ansatt, Jul 5, 2006, in forum: Embedded
    Replies:
    1
    Views:
    350
    Pelos @ Home
    Jul 5, 2006
  3. Baldor

    GSM Module.

    Baldor, Aug 16, 2006, in forum: Embedded
    Replies:
    1
    Views:
    401
    Vladimir Vassilevsky
    Aug 16, 2006
  4. abhay

    GSM modem interfacing

    abhay, Aug 30, 2006, in forum: Embedded
    Replies:
    4
    Views:
    385
    Adrian
    Sep 1, 2006
  5. Chris H
    Replies:
    0
    Views:
    495
    Chris H
    Nov 10, 2010
Loading...

Share This Page