Hi,
i try to connect two 8051.
When Led at P1.0 glows in the transmitter 8051, then the Led at port 2 must glow too.
The problem is when i run the code, all port in the two 8051 are high.
I changed the code for transmitting letter from 8051 to lcd display.
so my code is here:
Transmission code in the first 8051:
Reception code in the second 8051:
any help is welcome
Thank you
PY01A0080
i try to connect two 8051.
When Led at P1.0 glows in the transmitter 8051, then the Led at port 2 must glow too.
The problem is when i run the code, all port in the two 8051 are high.
I changed the code for transmitting letter from 8051 to lcd display.
so my code is here:
Transmission code in the first 8051:
Rich (BB code):
org 0000h
mov tmod,#29h; Mode1=1 Timer0=1
mov th1,#0fdh; th1 value for 9600
mov scon,#50h; SM1=1 and RET=1
setb tr1; start of the timer1
loop:mov p0,#01h; make p1 as input port
mov a,p1
acall send
sjmp loop
send:
mov sbuf,a
Here:jnb ti,here
clr ti
ret
delay:mov r0,#10h
l1: mov th0,#76
mov tl0,#01h
setb tr0
jnb tf0,$
clr tf0
djnz r0,l1
ret
end
Rich (BB code):
org 0000h
mov tmod,#20h ;Timer 1 in Auto Reload mode
mov th1,#0fdh ; Set serial baud rate
mov scon,#50h ; Serial comm with 8bit variable baud rate and Reception enable
setb tr1
mov a,sbuf
mov p2,a
clr Ri
reti
end
Thank you
PY01A0080