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.

AT89S52 using uart send wrong data

Status
Not open for further replies.

andy40185

Member level 5
Joined
Sep 30, 2011
Messages
80
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,810
Hi all,

I have encountered a problem that I cannot send the correct data to the hyperterminal. I'm using KeilC51 complier and C++. Also, I set
the SMOD to 1 and using 11.0592 crystal(baud rate set to 4800). Sometimes send correct data, sometimes wrong.(like below figure)
I do not know what happen it is. Would anyone can help me?
un.jpg
*30 is a temperature

Also, the code as following;
Code:
void transmit_data(unsigned char p)
{
	TI=0;
	SBUF=p;
	while(TI==0);
}

void PC(unsigned char *information)
{
	while(*information)
	 {
		transmit_data(*information++);
	 }
}
 

just try and check on hyper terminal you are doing in debug mode try and see in real hyper terminal.
 

Have you changed the bud rate etc settings(used in the program) of your PC's port ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top