Microcontroller › 8051 › Serial Communication
- This topic has 7 replies, 5 voices, and was last updated 14 years, 5 months ago by
romel emperado.
-
AuthorPosts
-
May 17, 2011 at 11:45 am #942
Kunal
ParticipantI m using at89s52 microcontroller, i want to send SMS using GSM. I have stored my SMS in memory starting from 30h to 50h. My SMS is like this : “CO2,NO,C6H6,MICRON,SO2”
I m using 11.0592Mhz crystal oscilator.
I dont know which values to move in TMOD, TCON, TH1, SCON etc. for serial communication. I m sending SMS using AT COMMANDS, stored in internal memory of microcontroller.
Please tell me about which SFRs to be used for this operation and which values to be moved in these SFRs??
May 26, 2011 at 10:36 am #6300Anonymous
Guestcheck out this link for various settings of serial port….
June 21, 2011 at 7:17 am #6365SaLMAN Ahmed Khan
Participantok
use these values
mov tmod,#20
mov th1,#-3
mov scon,#50
while scon will be used to program start and stop bits and data bits of data framing
June 22, 2011 at 11:03 am #6367romel emperado
Participanthi rajsekhar nag,
the value if sbuf is any data received from serial input or the RX pin..
read about serial communication of 8051..
June 26, 2011 at 9:28 am #6372rajsekhar nag
Participant2 answers without reading my question properly. The link above shows a project in which the “receive()” function is called to receive a character in SBUF. Unless you make the following modification nothing will come in SBUF!
The function should be like below:-
//Function to receive serial data
void recieve(unsigned char value)
{
while(RI==0);
SBUF=value;
P1=SBUF;
RI=0;
}June 26, 2011 at 9:30 am #6364rajsekhar nag
Participanthttp://www.engineersgarage.com/microcontroller/8051projects/interface-serialport-RS232-AT89C51-circuit
In the above link, can anybody explain the following function:-
void recieve() //Function to receive serial data
{
unsigned char value;
while(RI==0);
SBUF=value;
P1=SBUF;
RI=0;
}What will be the value of SBUF?

Actually I want to say how come the project described in the above link suppose to run properly without getting a value in SBUF?
June 26, 2011 at 6:21 pm #6390SaLMAN Ahmed Khan
Participantsimple is to put values that i mention above….
regarding to SBUF WHEN U R SENDING TO PC
mov a, #22
mov SBUF,A
and when it recieve
mov a,sbuf
July 8, 2011 at 9:13 pm #6441romel emperado
Participantdid you edit your question above?? hmm
TMOD, — this is timer mode controll register
TCON, — timer control register
TH1, — MSB byt of timer
SCON — serial register…
search them all there are may article about this…
-
AuthorPosts
- You must be logged in to reply to this topic.