- This topic has 7 replies, 5 voices, and was last updated 13 years, 3 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › Serial Communication
I 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??
check out this link for various settings of serial port….
ok
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
hi rajsekhar nag,
the value if sbuf is any data received from serial input or the RX pin..
read about serial communication of 8051..
2 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;
}
http://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?
simple 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
did 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…