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.

Problem in RS 232 Interfacing with AT89C51

Status
Not open for further replies.

sajidraheem

Newbie level 4
Joined
Aug 4, 2006
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
rs 232 at89c51

I am using AT89C51 for serial communication, through which i want to have the gsm based industial control.

I am trying RS 232 interfacing through MAX 232.
The circuit diagram is attached.. The test program code burnt in microcontroller is:
..............................................................................................................

MOV SCON,#50h ; 8 bit, 1stop, REN enabled
MOV TMOD,#20h ; Timer1, Mode 2 (auto-reload)
MOV TH1,#-3 ; 9600 buad rate
SETB TR1 ; start timer 1
AGAIN: MOV SBUF,#'A' ; Letter A to be transferred
HERE: JNB TI,HERE ; wait for the last bit
CLR TI ; clear TI for next character
SJMP AGAIN ; keep sending A

..............................................................................................................

This code should transmit A to serial port continously.. but I am not getting any output on Hyper Terminal when i connect the circuit to my pc. I dont know what is the problem. Can anyone help me in this regard?
 

hyperterminal gives garbage value

have u checked the baud rate setting on hyper terminal??:|
 

at89c51 rs232

Maybe you have to set serial port init:
SETB ES
before SETB TR1


Ryan
 

at89c51 connected to rs232

Try this code:

Code:
Ser_Setup:
MOV   	PCON, #80h
MOV   	SCON, #52h
MOV   	TMOD, #20h
MOV  	TH1, #0FAh
    	SETB  	TR1

AGAIN:
MOV 	SBUF,#'A'	; Letter A to be transferred 
HERE:
JNB 	TI,HERE		; wait for the last bit 
CLR 	TI		; clear TI for next character 
SJMP 	AGAIN		; keep sending A

	END
and make sure that your Tx is connected to PC's Rx and your Rx is connected to PC's Tx ..
Also, Hyperterminal's flow control setting should be set to NONE ..

Regards,
IanP
 

at89c51 connected to rs232 pdf

Hi
i think you need to check out your cable as per your circuit diagram the cable should be straight (2 to 2 and 3 to 3) connection not cross over.
 

how to interface rs 232 with at89c51

I have checked the Tx and Rx pins, everything is fine. Buad rate setting is same 9600 as for the controller. and the cable is not crossed.
Flow Control is set to none.
Have tried the given code too, but its not working either.
I have tested the code in pinnacl's UART window, it transmits A continously.
By shorting the transmitting and receiving pins of DB-9, i have checked the response on hyperterminal. it works fine. But the circuit gives garbage value sometimes. Not transmitting A ..

Can anyone help in this regard?

Thanks
 

hiiiiiiiiiiii....
i think the problem lies into the way u concieve and apprehend things in life..........

dear brother just pray for betterment of whole human race especiaiy your this humble brother..........
1 thing more, rather its an advise...
do consult mr raja umair... he is really good at this........i sweare :|u....
varna beta teri tou lagi is project main...............
ta ta
 

**broken link removed**

Contains example setup for hyperterminal, basic troubleshooting guide, basic schematic diagram, code examples (asm).
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top