Cụ thể là mình làm hiện thị số 10 trên hai LED 7-SEG .nối.trên cùng 1 port P0
; ------------- READS51 generated header --------------
; module : E:\machvidieukhien_btap\HOVIETTHANH\HOVIETTHANH.as m
; created : 21:50:30, Wednesday, May 22, 2013
; -----------------------------------------------------
#include <sfr51.inc>
ORG 0000H ;KHAIBAO DIA CHI
MAIN:
CLR P1.1
CLR P1.2
NHAN:
SETB P1.1
CLR P1.2
MOV P0,#11111001B
LCALL DELAY
CLR P1.1
SETB P1.2
MOV P0,#01000000B
LCALL DELAY
LJMP NHAN
DELAY:
MOV R7,#10
NHAN0:
MOV R6,#255
DJNZ R6,$
DJNZ R7,NHAN0
RET
END
; ------------- READS51 generated header --------------
; module : E:\machvidieukhien_btap\HOVIETTHANH\HOVIETTHANH.as m
; created : 21:50:30, Wednesday, May 22, 2013
; -----------------------------------------------------
#include <sfr51.inc>
ORG 0000H ;KHAIBAO DIA CHI
MAIN:
CLR P1.1
CLR P1.2
NHAN:
SETB P1.1
CLR P1.2
MOV P0,#11111001B
LCALL DELAY
CLR P1.1
SETB P1.2
MOV P0,#01000000B
LCALL DELAY
LJMP NHAN
DELAY:
MOV R7,#10
NHAN0:
MOV R6,#255
DJNZ R6,$
DJNZ R7,NHAN0
RET
END
Comment