Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

two 7-segment

Status
Not open for further replies.

Jan De

New Member
Hi guys

I did a circuit to interface 7-segment with 8255 PPI ( which is inside the MTS trainer ) .. and I made this assembly program codes to display the number from 0 to F , and it work fine ..

But now I have to use ( two ) 7-segment displays to show numbers from 00 to 99 ( 00- 01- 02 .... 99 )
so How can I modify my codes to satisfy this purpose ?!

View attachment 68841


Code:
_______________

PORTA EQU 0FFF9H
PORTB EQU 0FFFBH
CNT   EQU 0FFFFH

CODE      SEGMENT
               ASSUME   CS:CODE, DS:CODE

      ORG 0


START:       MOV DX, CNT      ; this part for sending the control word
                  MOV AL, 80H
                  OUT DX, AL


    
J1:    MOV BL,16
        MOV SI, OFFSET FONT
       
       MOV DX, PORTB     ; turn ON the FND
       MOV AL, 11H
       OUT DX, AL


J2:   MOV AL, [SI]
       MOV DX, PORTA
       OUT DX, AL
      

      MOV CX, 0FFFFH
      LOOP $

     INC SI
     DEC BL
     JNZ  J2
  
     

            ;    PGFEDCBA
FONT    DB   11000000B    ;HEXA0
           DB   11111001B    ;HEXA1
           DB   10100100B    ;HEXA2
           DB   10110000B    ;HEXA3
           DB   10011001B    ;HEXA4
           DB   10010010B    ;HEXA5
           DB   10000010B    ;HEXA6
           DB   11011000B    ;HEXA7
           DB   10000000B    ;HEXA8
           DB   10010000B    ;HEXA9
           DB   10001000B    ;HEXA A
           DB   10000011B    ;HEXA B
           DB   11000110B    ;HEXA C
           DB   10100001B    ;HEXA D
           DB   10000110B    ;HEXA E
           DB   10001110B    ;HEXA F
 

CODE  ENDS
END START 
_______________________



please help

jan de,
 
Last edited:
Your link isn't good. You have to do a copy link location if it was from another VB based forum software.

But, probably, you have to multiplex the displays. The displays can be common anode or common cathode.

The segments to all of the displays are basically turned on all of the time.

repeat: Turn off all digits for a short time, change the segments(for digit 1); turn on digit 1, Wait(display time); turn off all digits; Wait(inter-digit blank); change the segments (for digit 2), wait(display time) turn on digit 2; Until

If you don't do inter-digit blanking, the segments will tend to blur a bit.
 
Last edited:
Your link still getting a problem,
i recommend you to have a look on the components , and check whether they are common cathode or common anode configuartion.
 
I'm sorry I just have attached the picture..

they are common anode ,, I just wanna know how to make them display numbers from 00 to 99

yesterday I made this code and I don't know if it will work for that purpose or not

Code:
PORTA EQU 0FFF9H
PORTB EQU 0FFFBH
CNT   EQU 0FFFFH

CODE      SEGMENT
          ASSUME   CS:CODE, DS:CODE

      ORG 00


START:            MOV DX, CNT      
                  MOV AL, 80H
                  OUT DX, AL


    
J1:     MOV CL, 100
        MOV SI, OFFSET FONT
        MOV CH, 0
        
       


  J2:    MOV AL, CH
          
         MOV BL, 10
         DIV BL    ; AL= AL/10 AH= AL%10
         PUSH AX
         MOV AH, 0       
         MOV SI, AX
         MOV AL, 01H
         MOV DX, PORTB
         OUT DX, AL
         MOV AL, [SI]
         MOV DX, PORTA
         OUT DX, AL     ; FIRST DIGIT
         CALL DELAY
         
         MOV AL, 02H
         MOV DX, PORTB
         OUT DX, AL
         
         POP AX
         MOV AL, 0
         MOV SI, AX
         MOV AL, [SI]
         MOV DX, PORTA
         OUT DX, AL     ; SECOND DIGIT
         CALL DELAY
       
    
         INC CH

         DEC CL
         JNZ  J2
  

DELAY :    MOV CX, 0FFFFH
           LOOP $
     

            ;    PGFEDCBA
FONT       DB   11000000B    ;HEXA0
           DB   11111001B    ;HEXA1
           DB   10100100B    ;HEXA2
           DB   10110000B    ;HEXA3
           DB   10011001B    ;HEXA4
           DB   10010010B    ;HEXA5
           DB   10000010B    ;HEXA6
           DB   11011000B    ;HEXA7
           DB   10000000B    ;HEXA8
           DB   10010000B    ;HEXA9
           DB   10001000B    ;HEXA A
           DB   10000011B    ;HEXA B
           DB   11000110B    ;HEXA C
           DB   10100001B    ;HEXA D
           DB   10000110B    ;HEXA E
           DB   10001110B    ;HEXA F
 

CODE  ENDS
END START
 
Links are OK now. My instructions are still true. Just make sure that you can turn on each display by manipulating PB1 and PB2.

Then you will need a way to do timing on the order of milliseconds toggling PB1 or PB2 and go from there.

Try writing a simple program that can blink a single segment or rotate a few segments on one digit.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top