I will explain how it can work. I used AT89C51 Microcontroller, this chip produce by ATMEL. With simple Assembly script, this project could be created. For coding and compiling use Systronix RAD51.
ASM Source Code
ORG 0H
MULAI: MOV A, P3
CJNE A,#0BFH,MULAI ;WAIT UNTIL BUTTON PRESS P3.6
JALAN:
MOV P1,#0CEH ;show r
ACALL DELAY
MOV P1,#86H ;show E
ACALL DELAY
MOV P1,#92H ;show S
ACALL DELAY
MOV P1,#8CH ;show P
ACALL DELAY
MOV P1,#0C0H ;show O
ACALL DELAY
MOV P1,#0C8H ;show n
ACALL DELAY
MOV P1,#92H ;show S
ACALL DELAY
MOV P1,#0F9H ;show I
ACALL DELAY
;
MOV A,P3 ;check if button P3.7
CJNE A,#7FH,JALAN ;if not go label jalan
MOV P1,#0FFH ;turn of all segment
SJMP MULAI ; goto? label mulai
;
;-------------------------------
; sub rutin delay
;-------------------------------
DELAY:
MOV R0,#5H
DELAY1:
MOV R1,#0FFH
DELAY2:
MOV R2,#0H
DJNZ R1,$
DJNZ R1,DELAY2
DJNZ R0,DELAY1
RET
;
END
asm source
hex file
Copyright and Credits:
Writer, ? puguhwah, graphics and photos, May2011.
http://www.hqew.net/circuit-diagram/How-to-show-character-on-sevent-segment-display_13067.html
No comments:
Post a Comment