Motherboard Forums


Reply
Thread Tools Display Modes

Problem in interfacing 8051 with gsm module

 
 
embedidea
Guest
Posts: n/a
 
      07-03-2006, 11:48 AM
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.




 
Reply With Quote
 
 
 
 
Tom Lucas
Guest
Posts: n/a
 
      07-03-2006, 12:48 PM

"embedidea" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
 
 
 
mmm
Guest
Posts: n/a
 
      07-03-2006, 01:40 PM
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.
>
>
>
>

 
Reply With Quote
 
embedidea
Guest
Posts: n/a
 
      07-03-2006, 03:07 PM
>
>"embedidea" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> 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.


 
Reply With Quote
 
martin griffith
Guest
Posts: n/a
 
      07-03-2006, 03:17 PM
On Mon, 03 Jul 2006 10:07:18 -0500, in comp.arch.embedded "embedidea"
<(E-Mail Removed)> wrote:

>>
>>"embedidea" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>> 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
 
Reply With Quote
 
Tom Lucas
Guest
Posts: n/a
 
      07-03-2006, 03:56 PM

"martin griffith" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Mon, 03 Jul 2006 10:07:18 -0500, in comp.arch.embedded "embedidea"
> <(E-Mail Removed)> wrote:
>
>>>
>>>"embedidea" <(E-Mail Removed)> wrote in message
>>>news:(E-Mail Removed)...
>>>> 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?


 
Reply With Quote
 
embedidea
Guest
Posts: n/a
 
      07-04-2006, 05:21 AM
>>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.

 
Reply With Quote
 
Meindert Sprang
Guest
Posts: n/a
 
      07-04-2006, 05:36 AM
"embedidea" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> 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


 
Reply With Quote
 
Ulrich Bangert
Guest
Posts: n/a
 
      07-04-2006, 05:45 AM
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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.
>
>
>
>



 
Reply With Quote
 
martin griffith
Guest
Posts: n/a
 
      07-04-2006, 09:10 AM
On Tue, 04 Jul 2006 00:21:55 -0500, in comp.arch.embedded "embedidea"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: problem in receiving data from GSM module to 8051 microcontroller Chris H Embedded 0 11-10-2010 03:55 PM
GSM modem interfacing abhay Embedded 4 09-01-2006 01:12 PM
GSM Module. Baldor Embedded 1 08-16-2006 06:29 PM
Cheap GSM module Ansatt Embedded 1 07-05-2006 08:48 PM
GSM module with external camera Aleksandar Kovacevic Embedded 4 05-13-2005 02:52 AM


All times are GMT. The time now is 10:14 AM.


Welcome!
Welcome to Motherboard Point
 

Advertisment