bcdto7seg:
mov A,T_bandau
mov B,#10
div AB
mov T_donvi,B
mov B,#10
div AB
mov T_tram,A
mov T_chuc,B
ret
mov A,T_bandau
mov B,#10
div AB
mov T_donvi,B
mov B,#10
div AB
mov T_tram,A
mov T_chuc,B
ret
CHUONG_TRINH_CHINH: SETB DQ LCALL RESET_DS1820 MOV A,#0CCH ; SKIP ROM (CCH) truy cap thang den ds1820 LCALL WRITE_BYTE MOV A,#44H ; CONVERT T khoi dong qua trinh chuyen doi nhiet do LCALL WRITE_BYTE ;em chèn thêm chương trình con delay 750ms tại đây LCALL RESET_DS1820 MOV A,#0CCH ; SKIP ROM (CCH) truy cap thang den ds1820 LCALL WRITE_BYTE MOV A,#0BEH ; READ SCRATCHPAD doc du lieu bo nho nhap LCALL WRITE_BYTE LCALL READ_BYTE MOV LSB,A LCALL READ_BYTE MOV MSB,A LCALL RESET_DS1820 RET
Comment