pc based digital clock via parallel port using assembly language in tasm

Discussion in 'The Projects Forum' started by maonin, Oct 15, 2011.

  1. maonin

    Thread Starter New Member

    Oct 15, 2011
    4
    0
    hi, i have this project and we already have a code and the circuit but it is not working..
    it's supposed to display the hours and minutes
    the problems are:
    1. the hour display is not displaying anything
    2. the minute displays but it is advanced by one minute

    so here's the code:
    Code ( (Unknown Language)):
    1. TITLE CLOCK.ASM
    2. DOSSEG
    3. .MODEL SMALL
    4. .STACK 0100H
    5. .DATA    
    6.       PRINTERPORTBASEADDRESS equ 378h  
    7. .CODE
    8.  MAIN        PROC    
    9.       MOV AX, @DATA    
    10.       MOV DS, AX      
    11.  
    12.       CALL RTIME    ; READ TIME    
    13.       CALL DisplayTime     ;DISPLAY TIME              
    14.  
    15.       MOV AX, 4C00H    
    16.       INT 21H
    17. MAIN         ENDP  
    18.  
    19. RTIME         PROC    
    20.       MOV AH, 02H    
    21.       INT 1AH    
    22.       RET    
    23.      
    24.       ; CH - HOUR    
    25.       ; CL - MINUTES    
    26.       ; DH - SECONDS
    27. RTIME        ENDP  
    28.  
    29. DisplayTime PROC    
    30.       push     DX    
    31.       push     CX    
    32.  
    33.       mov      AL,CH    
    34.       mov      DX,PRINTERPORTBASEADDRESS    
    35.       out        DX,AL    
    36.       mov      AL,01h    
    37.       mov      DX,PRINTERPORTBASEADDRESS+2    
    38.       out        DX,AL    ; enable display    
    39.       call       Delay
    40. ;    
    41.       mov      AL,00h    
    42.       mov      DX,PRINTERPORTBASEADDRESS+2    
    43.       out        DX,AL    
    44.       pop       AX    ; pop CL (minutes)    
    45.       mov      DX,PRINTERPORTBASEADDRESS    
    46.       out        DX,AL    
    47.       mov      AL,02h    
    48.       mov      DX,PRINTERPORTBASEADDRESS+2    
    49.       out        DX,AL    ; enable display    
    50.       call       Delay
    51. ;    
    52.       mov      AL,00h    
    53.       mov      DX,PRINTERPORTBASEADDRESS+2    
    54.       out        DX,AL    
    55.       pop       AX    ; pop DH (seconds)    
    56.       mov    AL,AH    
    57.       mov      DX,PRINTERPORTBASEADDRESS    
    58.       out        DX,AL    
    59.       mov      AL,08h    
    60.       mov      DX,PRINTERPORTBASEADDRESS+2    
    61.       out        DX,AL    ; enable display    
    62.       call       Delay
    63. ;    
    64.       mov      DX,PRINTERPORTBASEADDRESS+2    
    65.       mov      AL,00h    
    66.       out        DX,AL    
    67.       ret  
    68.  
    69. DisplayTime ENDP  
    70.  
    71. Delay Proc        
    72.       MOV CX, 00100h    
    73. X:  PUSH CX        
    74.       MOV CX, 0FFFFh    
    75. Y:  LOOP Y        
    76.       POP CX        
    77.       LOOP X        
    78.       RET  
    79. Delay ENDP
    80. END
    and the circuit:
    http://postimage.org/image/2egfc6wsk/
     
  2. maonin

    Thread Starter New Member

    Oct 15, 2011
    4
    0
    please help.
     
  3. nerdegutta

    Moderator

    Dec 15, 2009
    2,514
    784
    This is an international forum. Give it time.

    Besides, I think there is something with your circuit...
     
  4. maonin

    Thread Starter New Member

    Oct 15, 2011
    4
    0

    please help...
    what is wrong with the circuit?

    is the code right?
     
  5. nerdegutta

    Moderator

    Dec 15, 2009
    2,514
    784
    I don't know much about ASM, so I cannot assist you there.

    About the circuit:
    I'm not sure, but wouldn't D1, D3, D5 show the same? The same with D2, D4 and D6.

    They are connected to the same 7447. I think you need at least one 7447-IC for each 7-segment. That means 6 IC-7447.
     
  6. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    If I am correct the 7-segments are multiplexed. So only one group is active at any moment. If they are switched fast enough which may be around 30 Hz or faster. The human eye will se it as they are constant turned on. The circuit looks OK. From what I can see it pass the sanity test at least.
    Then things do not work it is time to start debugging. Since you are using TASM. I guess you also have the Turbo Debugger. Run td.exe, the Turbo Debugger. And step through your code.
     
  7. maonin

    Thread Starter New Member

    Oct 15, 2011
    4
    0
    we got it!

    thankU.

    the circuit is just fine.

    something in the code that is not right.

    thankU. Godbless. :)
     
Loading...