兩個(gè)8031系統(tǒng)進(jìn)行雙機(jī)通信的電路連接圖及通訊單片匯編語言
兩個(gè)8031系統(tǒng)進(jìn)行雙機(jī)通信,工作于方式1,將甲機(jī)芯片內(nèi)RAM30H~4FH單元存放的數(shù)據(jù)送到乙機(jī)相應(yīng)單元。要求畫出電路連接圖,選擇波特率,編寫完整的通信程序。
答案:
圖片1
甲機(jī):
main:movscon,#01000000b
movtmod,#00100000b
movth1,#0d0h
movtl1,#0d0h
clrea
movpcon,#80h
setbtr1
movr7,#16
movr0,#30h
loop:movsbuf,@r0
jnbti,$
clrti
incr0
djnzr7,loop
sjmp$
乙機(jī):
org000h
ljmpmain
org`023h
ljmprxd_int
org100h
main:movscon,#01010000b
movtmod,#00100000b
movth1,#0d0h
movtl1,#0d0h
setbes
setbea
movpcon,#80h
setbtr1
movr7,#16
movr0,#40h
sjmp$
rxd_int: mov@r0,sbuf
clrri
incr0
djnzr7,goret
movr7,#16
movr0,#40h
goret:reti