home *** CD-ROM | disk | FTP | other *** search
- #IFDEF INCLUDE_VDAS
-
- #DEFINE VD_PORT Led
- ;
- ; Vidas driver subroutines.
- ; R.J.P. 21st July 1992
- .TEXT "VDAS_SUBS : 21st July 1992"
- ;
- ?IF ONE_MHZ != 0
- ;
- ; =======================1MHz=============================
- ;
- ; Digital output Driver for Extended board.
- ; Takes set/clear mask count of {00H..0FH } in A.
- ; Sends a stream of broad pulses followed by a set of short
- ; ones to clock up a certain number of relays.
- ; EX. A = 00H No relays set.
- ; A = 01H First Relay.
- ; A = 03H First & Second .. etc...
- ;
- ; This is a direct copy of the tested version taken from the
- ; event-logging prototype program.
- ; R.J.P. 12/12/91.
- ;
- ; 23-1/91 Modified Programmed Delays for 1MHz operation.
- ; 2nd June 1992 Second Version using another Vidas Board.
- ;
- #MACRO ONE_BIT port
- ;
- ; 24 uS prelude, on 108 uS
- ;
- NOP ; 12 uS
- SETB port ; 12 uS
- ;
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- NOP ; 12 uS
- CLR port ; 12 uS
- #MEND
- ;
- #MACRO ZERO_BIT port
- ;
- ; 24 uS prelude, on 7 uS !!!!
- ;
- NOP ; 12uS
- SETB port ; 12uS
- ;
- NOP ; 12uS
- CLR port ; 12uS
- #MEND
- ;
- V1_Driver:
- MOV R1,#8 ; Sending 8 bits (general routine)
- SET_L1:
- RLC A ; Most sig. bit to carry.
- JNC ZERO_1 ; Was zero set zero.
- ONE_1:
- ONE_BIT VD_PORT ; Set one ? I think ?
- SJMP SET_NEXT_1
- ZERO_1:
- ZERO_BIT VD_PORT
- SET_NEXT_1:
- DJNZ R1,SET_L1
- RET
- ;
- JB Vidas,$+5
- SETB VD_PORT ; Avoid bump of shutdown after 1/4 Sec.
- RET
-
- ?ELSE
- ;
- ; ======================4MHz==============================
- ;
- ; Digital output Driver for Extended board.
- ; Takes set/clear mask count of {00H..0FH } in A.
- ; Sends a stream of broad pulses followed by a set of short
- ; ones to clock up a certain number of relays.
- ; EX. A = 00H No relays set.
- ; A = 01H First Relay.
- ; A = 03H First & Second .. etc...
- ;
- ; This is a direct copy of the tested version taken from the
- ; event-logging prototype program.
- ; R.J.P. 12/12/91.
- ;
- #MACRO ONE_BIT port
- ;
- ; 21 uS prelude, on 105 uS
- ;
- MOV R0,#2 ; 3 uS
- ; L1:
- DJNZ R0,$ ; 2 x 2 x 3 = 12 uS
- ;
- MOV R0,#17 ; 3 uS
- SETB port ; 3 uS
- ; L2:
- DJNZ R0,$ ; 17 x 2 x 3 = 102 uS
- CLR port ; 3 uS
- #MEND
- ;
- #MACRO ZERO_BIT port
- ;
- ; 21 uS prelude, on 7 uS
- ;
- NOP ; 3 uS
- MOV R0,#2 ; 3 uS
- ; L1:
- DJNZ R0,$ ; 2 x 2 x 3 = 12 uS
- ;
- SETB port ; 3 uS
- ;
- NOP ; 3 uS
- NOP ; 3 uS
- NOP ; 3 uS
- NOP ; 3 uS
- NOP ; 3 uS
- CLR port ; 3 uS
- #MEND
- ;
- V1_Driver:
- MOV R1,#8 ; Sending 8 bits (general routine)
- SET_L1:
- RLC A ; Most sig. bit to carry.
- JNC ZERO_1 ; Was zero set zero.
- ONE_1:
- ONE_BIT VD_PORT ; Set one ? I think ?
- SJMP SET_NEXT_1
- ZERO_1:
- ZERO_BIT VD_PORT
- SET_NEXT_1:
- DJNZ R1,SET_L1
- RET
-
- JB Vidas,$+5
- SETB VD_PORT ; Avoid bump of shutdown after 1/4 Sec.
- RET
-
- ;
- ; -------------------- 4MHz --------------------
- ;
- ?ENDIF
- ;
- #ENDIF
-
-
-
-