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.

serial communication b/w two 8051 MC

Status
Not open for further replies.

harrishcl

Newbie level 4
Joined
Apr 9, 2005
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
serial communication in 8051 b/w 2 8051 MC in PROTEUS 6.1 sp//

plz tell me how can i

pins configuration ?

; recieve


org 0h
ljmp main

org 23h
ljmp newspisr

org 30h

main:
mov tmod,#20h
mov th1,#0fdh
setb tr1
mov scon,#52h
mov ie,#90h

;sjmp $

newspisr:

mov a,sbuf
mov p1,a
clr Ri
reti

end




; tans

org 0h
ljmp main

org 23h
ljmp newspisr

org 30h

main:
mov tmod,#20h
mov th1,#0fdh
setb tr1
mov scon,#52h
mov ie,#90h

; sjmp $

newspisr:



mov a,p1
mov sbuf,a
clr ti
reti

end
 

First, in both codes you will need at least this line:
Loop:
SJMP Loop

or:
SJMP $

so the main program executes this loop endlessly and is only interrupted by arriving of a serial character..
What I don't understand is how are you going to call TRANS interrupt?
You will nee to use INT0, or any other pin (for example P1.0 ..) to execute TRANS intrerrupt, and to do so you can use code like this:

SETB P1.0
Main:
JB P1.0, $

SETB TI ; this will activate serial nterrupt ..
SJMP Loop

As far as inter-connections between these 2 8051s, connect TxD of the 1st with Rxd of the 2nd and Rxd of the 1st with TxD of the second. Don't forget of connecting GND (0V) ..

Good l;uck and regards ..
IanP
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top