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.

Beginner:Need 8051 RS232 c program.....

Status
Not open for further replies.

gane26

Member level 1
Joined
Jan 10, 2010
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,531
i'm using 8051 controller interface with RS232...
1) print name on hyperterminal
2) when pressing "enter key"... print as "Type your name": (when i entered my name ) then press enter
3) when the user types the name , the characters to be displayed on screen(then press enter)
4)atlast "Thank you" must displayed on the screen

i need c program for this method..can anyone help me
 

on hitting enter key..want to print "Type your name: i want to write my name here "
 

Give this a try, please note that I've never used an 8051 so this is purely guesswork..

Code:
#include <Intel\8052.h>
#include <standard.h>
#include<stdio.h>

void main ()
{
char a[50];

TMOD = 0x20;
TH1 = 0xfd;
PCON &= 0x7f;
SCON = 0x50;
TCON =0x40;

scanf("%s",a);
printf("Hello, %s!\n",a);
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top