templow equ 35h
temphigh equ 36h
;-------------------------------
org 00h
jmp main
org 30h
jmp extint0
main:
mov sp,#70h
mov TMOD,#20h
mov TH1,#0fdh
mov TL1,#0fdh
mov tcon,#40h
mov scon,#40h
adloop:
jmp adloop
;-------------------------
transfer:
mov b,#2
mul ab
clr c
subb a,#<273
mov templow,a
mov a,b
subb a,#>273
mov temphigh,a
call bin2bcd
mov temphigh,r4
mov templow,r3
CLR TI
mov a,r4
mov sbuf,a
CLR TI
mov a,r3
mov sbuf,a
ret
;----------------------------
bin2bcd:
mov r5,#16
clr a
mov r3,a
mov r4,a
tloop:
mov a,templow
rlc a
mov templow,a
mov a,temphigh
rlc a
mov temphigh,a
mov a,r3
addc a,r3
da a
mov a,r3
addc a,r4
da a
mov r4,a
djnz r5,tloop
ret
;--------------------------
extint0:
push a
push psw
setb rs1
clr rs0
movx a,@r0
call transfer
movx @r0,a
pop psw
pop a
reti
end
震盪器部份我是用前輩說的11.0592MHZ的石英震盪,接收程式設定傳輸速率9800
我有試過一個監控COM的程式,來監看是否有訊號,但一直無法成功
PS:我有是過去問別人或老師,老師說,這些東西很基本,書翻一翻就有
了,但是,我真的花了不少時間去研讀,但還是找不出錯誤所在,所以才會
想請前輩們幫我看看,萬分感謝.......