Hi,
i'm trying something very hard for me, i want to connect two 8051 and each one with one LCD (16X2) in serial using Interrupts.
So after learning interrupts with books, i tried to do something like this,
i created two projects in keil and one file in Proteus with the design mentioned above.
so for Transmission:
and the second file for Reception:
so when i try this, nothing's happen but i can see some data going very fastly in the virual terminal.
do i have to add the same lines for sending data and command in the reception file? or anything else to do here?
Thank you for your help
PY01A0080
i'm trying something very hard for me, i want to connect two 8051 and each one with one LCD (16X2) in serial using Interrupts.
So after learning interrupts with books, i tried to do something like this,
i created two projects in keil and one file in Proteus with the design mentioned above.
so for Transmission:
Rich (BB code):
org 0000h
ljmp main
main:
mov tmod,#29h
mov th1,#0fdh
setb tr1;
mov scon,#50h
mov p2,a
mov sbuf,a
jnb ti,$
clr ti
ret
mov a,#38h;
lcall led_command
lcall delay
mov a,#0eh;
lcall led_command
lcall delay
mov a,#01h; clear screen
lcall led_command
lcall delay
mov a,#06h; auto-increment
lcall led_command
lcall delay
mov a,#80h; cursor position at 1
lcall led_command
lcall delay
mov a,#'P'
lcall led_data; send P
lcall delay
mov a,#'A'; send A
lcall led_data
lcall delay
Loop: sjmp Loop
led_data:
setb p0.0; RS
clr p0.1; RW
setb p0.2; E
mov p2,a
clr p0.2
ret
led_command:
clr p0.0; RS
clr p0.1; RW
setb p0.2; E
mov p2,a
lcall delay
clr p0.2; E
ret
delay:
mov r4,#04h
mov r5,#080h
mov r6,#0ffh
djnz r6,$
djnz r5,$-2
djnz r4,$-4
ret
end
Rich (BB code):
org 0023h
ljmp main
org 0023h
mov a,sbuf
mov p2,a
clr ri
reti
main:
lcall led_command
lcall led_data
mov tmod,#20h
mov th1,#0fdh
mov scon,#50h
setb tr1
mov ie,#90h
sjmp $
end
do i have to add the same lines for sending data and command in the reception file? or anything else to do here?
Thank you for your help
PY01A0080
Attachments
-
11.3 KB Views: 12