1. You can now buy finished microcontroller project from us, Check out the Store for the complete list of projects.
  2. Need a custom project, Send us some details about your project. So that we can quote the price for it.

8051 Multiplexed 7segment display with BCD input 1.0

Interfacing 7segment display with multiplexed manner. The 7 segment display is driven with BCD input

  1. sajiv jess
    Interfacing 7segment display with multiplexed manner. The 7 segment display is driven with BCD input.
    Download contains the source code with proteus simulation file.

    Sponsored Links

    Circuit Diagram
    [​IMG]

    Assembly Code
    Code (Text):
    1. ORG 00H
    2.     JMP START
    3.     ORG 30H
    4. START:    MOV P2,#00100001B    ;The left shows 2
    5.     CALL DELAY    ;Delay
    6. ;--------------------------------------
    7.     MOV P2,#00000010B    ;No. 2 shows 0
    8.     CALL DELAY    ;Delay
    9. ;--------------------------------------
    10.     MOV P2,#00000100B    ;No. 3 show 0
    11.     CALL DELAY    ;Delay
    12. ;-------------------------------------
    13.     MOV P2,#10001000B    ;4 display 8
    14.     CALL DELAY    ;Delay
    15.     JMP START
    16. ;------------------------------------
    17. DELAY:    MOV R0,#10
    18. DELAY0:    MOV R7,#100
    19. DELAY1:    MOV R6,#250
    20.     DJNZ R6,$
    21.     DJNZ R7,DELAY1
    22.     DJNZ R0,DELAY0
    23.     RET
    24.     END
    C Code
    Code (Text):
    1. #include <reg51.h>
    2. #include <stdio.h>
    3.  
    4. #define DELAYTIME  65000 //Defined delay time constant
    5. unsigned int temp1;
    6.  
    7. void delay(unsigned int temp)//Delay process
    8. {
    9.   while(--temp);
    10. }
    11.  
    12. void main()
    13. {
    14.  
    15.         P2=0; //led is off
    16.         while(1)
    17.         {
    18.             P2=0X01;//Show 0,P2 port output of the BCD code and scan code P2.0
    19.             temp1=DELAYTIME;
    20.             delay(temp1);
    21.  
    22.             P2=0X12;//Show 1,P2 port output of the BCD code and scan code P2.1
    23.             temp1=DELAYTIME;
    24.             delay(temp1);
    25.  
    26.             P2=0X24;//Show 2,P2 port output of the BCD code and scan code P2.2
    27.             temp1=DELAYTIME;
    28.             delay(temp1);
    29.  
    30.             P2=0X38;//Show 3,P2 port output of the BCD code and scan code P2.3
    31.             temp1=DELAYTIME;
    32.             delay(temp1);
    33.  
    34.             P2=0X41;//Show 4,P2 port output of the BCD code and scan code P2.0
    35.             temp1=DELAYTIME;
    36.             delay(temp1);
    37.  
    38.             P2=0X52;//Show 5,P2 port output of the BCD code and scan code P2.1
    39.             temp1=DELAYTIME;
    40.             delay(temp1);
    41.  
    42.             P2=0X64;//Show 6,P2 port output of the BCD code and scan code P2.2
    43.             temp1=DELAYTIME;
    44.             delay(temp1);
    45.  
    46.             P2=0X78;//Show 7,P2 port output of the BCD code and scan code P2.3
    47.             temp1=DELAYTIME;
    48.             delay(temp1);
    49.  
    50.             P2=0X81;//Show 8,P2 port output of the BCD code and scan code P2.0
    51.             temp1=DELAYTIME;
    52.             delay(temp1);
    53.  
    54.             P2=0X92;//Show 9,P2 port output of the BCD code and scan code P2.1
    55.             temp1=DELAYTIME;
    56.             delay(temp1);
    57.             temp1=DELAYTIME;
    58.             delay(temp1);      
    59.         }
    60. }