home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / assembler / tasm / expand_ex / VDAS_SUB < prev   
Encoding:
Text File  |  1992-09-02  |  2.7 KB  |  153 lines

  1. #IFDEF  INCLUDE_VDAS
  2.  
  3. #DEFINE         VD_PORT         Led
  4. ;
  5. ;    Vidas driver subroutines.
  6. ;    R.J.P. 21st July 1992
  7.     .TEXT    "VDAS_SUBS : 21st July 1992"
  8. ;
  9. ?IF    ONE_MHZ != 0
  10. ;
  11. ;    =======================1MHz=============================
  12. ;
  13. ;    Digital output Driver for Extended board.
  14. ;    Takes  set/clear mask count of {00H..0FH } in A.
  15. ;    Sends a stream of broad pulses followed by a set of short
  16. ;    ones to clock up a certain number of relays.
  17. ;    EX.    A = 00H  No relays set.
  18. ;    A = 01H  First Relay.
  19. ;    A = 03H  First & Second .. etc...
  20. ;
  21. ;    This is a direct copy of the tested version taken from the
  22. ;    event-logging prototype program.
  23. ;    R.J.P.  12/12/91.
  24. ;
  25. ;    23-1/91  Modified Programmed Delays for 1MHz operation.
  26. ;    2nd June 1992 Second Version using another Vidas Board.
  27. ;
  28. #MACRO  ONE_BIT  port
  29. ;
  30. ;    24 uS  prelude,  on 108 uS
  31. ;
  32.     NOP    ; 12 uS
  33.     SETB    port    ; 12 uS
  34. ;
  35.     NOP    ; 12 uS
  36.     NOP    ; 12 uS
  37.     NOP    ; 12 uS
  38.     NOP    ; 12 uS
  39.     NOP    ; 12 uS
  40.     NOP    ; 12 uS
  41.     NOP    ; 12 uS
  42.     NOP    ; 12 uS
  43.     NOP    ; 12 uS
  44.     CLR    port    ; 12 uS
  45. #MEND
  46. ;
  47. #MACRO  ZERO_BIT    port
  48. ;
  49. ;    24 uS  prelude,  on 7 uS !!!!
  50. ;
  51.     NOP    ; 12uS
  52.     SETB    port    ; 12uS
  53. ;
  54.     NOP    ; 12uS
  55.     CLR    port    ; 12uS
  56. #MEND
  57. ;
  58. V1_Driver:
  59.     MOV    R1,#8    ; Sending 8 bits (general routine)
  60. SET_L1:
  61.     RLC    A    ; Most sig. bit to carry.
  62.     JNC    ZERO_1  ; Was zero set zero.
  63. ONE_1:
  64.     ONE_BIT VD_PORT  ; Set one ? I think ?
  65.     SJMP    SET_NEXT_1
  66. ZERO_1:
  67.     ZERO_BIT  VD_PORT
  68. SET_NEXT_1:
  69.     DJNZ    R1,SET_L1
  70.     RET
  71. ;
  72.     JB    Vidas,$+5
  73.     SETB    VD_PORT    ; Avoid bump of shutdown after 1/4 Sec. 
  74.     RET
  75.     
  76. ?ELSE
  77. ;
  78. ;    ======================4MHz==============================
  79. ;
  80. ;    Digital output Driver for Extended board.
  81. ;    Takes  set/clear mask count of {00H..0FH } in A.
  82. ;    Sends a stream of broad pulses followed by a set of short
  83. ;    ones to clock up a certain number of relays.
  84. ;    EX.    A = 00H  No relays set.
  85. ;    A = 01H  First Relay.
  86. ;    A = 03H  First & Second .. etc...
  87. ;
  88. ;    This is a direct copy of the tested version taken from the
  89. ;    event-logging prototype program.
  90. ;    R.J.P.  12/12/91.
  91. ;
  92. #MACRO  ONE_BIT port
  93. ;
  94. ;    21 uS  prelude,  on 105 uS
  95. ;
  96.     MOV    R0,#2    ; 3 uS
  97. ; L1:
  98.     DJNZ    R0,$    ; 2 x 2 x 3 = 12 uS
  99. ;
  100.     MOV    R0,#17  ; 3 uS
  101.     SETB    port    ; 3 uS
  102. ; L2:
  103.     DJNZ    R0,$    ; 17 x 2 x 3 = 102 uS
  104.     CLR    port    ; 3 uS
  105. #MEND
  106. ;
  107. #MACRO  ZERO_BIT    port
  108. ;
  109. ;    21 uS  prelude,  on 7 uS
  110. ;
  111.     NOP    ; 3 uS
  112.     MOV    R0,#2    ; 3 uS
  113. ; L1:
  114.     DJNZ    R0,$    ; 2 x 2 x 3 = 12 uS
  115. ;
  116.     SETB    port    ; 3 uS
  117. ;
  118.     NOP    ; 3 uS
  119.     NOP    ; 3 uS
  120.     NOP    ; 3 uS
  121.     NOP    ; 3 uS
  122.     NOP    ; 3 uS
  123.     CLR    port    ; 3 uS
  124. #MEND
  125. ;
  126. V1_Driver:
  127.     MOV    R1,#8    ; Sending 8 bits (general routine)
  128. SET_L1:
  129.     RLC    A    ; Most sig. bit to carry.
  130.     JNC    ZERO_1  ; Was zero set zero.
  131. ONE_1:
  132.     ONE_BIT VD_PORT  ; Set one ? I think ?
  133.     SJMP    SET_NEXT_1
  134. ZERO_1:
  135.     ZERO_BIT  VD_PORT
  136. SET_NEXT_1:
  137.     DJNZ    R1,SET_L1
  138.     RET
  139.  
  140.     JB    Vidas,$+5
  141.     SETB    VD_PORT    ; Avoid bump of shutdown after 1/4 Sec. 
  142.     RET
  143.  
  144. ;
  145. ;    -------------------- 4MHz --------------------
  146. ;
  147. ?ENDIF
  148. ;
  149. #ENDIF
  150.  
  151.  
  152.  
  153.