Teknomerkez
Topics

Simple 7-segment display circuit with PIC16F628A and ASM

Author: Mehmet Yılmaz
Translator: Ulvi Asil Yılmaz
Date: 25.03.2017
English

The circuit is shown how to make the 7-segment display with pic ASM. The circuit is feeding with 5 volt.

The circuit's diagram:


Material list:

U1: PIC16F628A
Y1: 4 Mhz kristal
AFF1: Anod 7-segment display
C1: 100nF
C2-C3: 22pF
R1: 10k
R2-R8: 470R

The circuit's working picture:




The circuit's video:


The circuit's ASM codes:
; ********* ********************************** *********
; Simple 7 segment display circuit with PIC16F628A and ASM
; Use the MPASM compiler
; Tarih: 26.03.2017 17:01:06
; http://teknomerkez.com/index.php?git=1659
; ******************************************************
        TITLE "Simple 7 segment display circuit with PIC16F628A and ASM"
        LIST p=16F628A
        #INCLUDE <p16f628a.inc>
        __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _MCLRE_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _CP_OFF

        CBLOCK  0x20    ;The variables are defining
        TR1SN1
        TR1SN2
        TR1SN3
        ENDC

        ORG     0x00
        GOTO    BASLA

BASLA           ;Starting point
        CLRF    PORTA
        CLRF    PORTB
        BANKSEL TRISA
        MOVLW   b'11111111'
        MOVWF   TRISA
        MOVLW   b'00000000'
        MOVWF   TRISB
        BANKSEL CMCON
        MOVLW   0x07
        MOVWF   CMCON
        GOTO    GOREVLER

GOREVLER        ;Initially transactions are here
        MOVLW   b'11000000'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'11111001'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10100100'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10110000'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10011001'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10010010'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10000010'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'11111000'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10000000'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10010000'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10001000'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10000011'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'11000110'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10100001'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10000110'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10001110'
        MOVWF   PORTB
        CALL    BEKLE1SN
        MOVLW   b'10111111'
        MOVWF   PORTB
        CALL    BEKLE1SN
        GOTO    GOREVLER

BEKLE1SN        ;Wait 1 second
        MOVLW   d'10'
        MOVWF   TR1SN1
BEKLE1SN1
        MOVLW   d'200'
        MOVWF   TR1SN2
BEKLE1SN2
        MOVLW   d'166'
        MOVWF   TR1SN3
BEKLE1SN3
        DECFSZ  TR1SN3, F
        GOTO    BEKLE1SN3
        DECFSZ  TR1SN2, F
        GOTO    BEKLE1SN2
        DECFSZ  TR1SN1, F
        GOTO    BEKLE1SN1
        RETURN

        END     ; End the program
Working HEX file:
:020000040000FA
:1000000001288501860183160313FF308500003027
:1000100086008312031307309F000E28C03086002D
:100020004220F93086004220A43086004220B030C1
:10003000860042209930860042209230860042207D
:10004000823086004220F8308600422080308600D0
:100050004220903086004220883086004220833043
:1000600086004220C63086004220A1308600422011
:100070008630860042208E3086004220BF308600C7
:1000800042200E280A30A000C830A100A630A200ED
:0E009000A20B4828A10B4628A00B442808000C
:02009E0000342C
:0200A00000342A
:02400E00293F48
:00000001FF

Comments

No comments yet, post a comment for to be the first.

Leave a comment

Name
E-mail
Your comment
Security Code
 
All areas must be filled. Your comment will be published after being checked. The e-mail will not be published.