NorthStar HSIO-4 User's & Technical Manual page 72

Horizon serial input/output four port
Table of Contents

Advertisement

11 REM PROGRAM NAME=
12 !TAB(10),"North Star HSIO-4 Test" \!
13
14
15 B=16
16 D=B+2
17 C=D+1
18
19 FOR P=B TO B+12 STEP 4
20
OUT P,1
21 NEXT P
22
23 FOR A=1 TO 5
24
READ N
25
FOR P=C TO C+12 STEP 4
26
OUT P,N
27
NEXT P
28 NEXT A
29
30 FOR P=D TO D+12 STEP 4
31
X=INP(P)
32 NEXT P
33 !\!"(note: connect pin 2 to pin 3 on the port to be tested!}"\!\I
34 ! CHR$(13),"Test port
35 IF T$>="A" THEN IF T$<="D" THEN 36 \GOTO 34
36 !"Press <ESC>
37 P=4*(ASC(T$)-64)-2+B
38
39
40
Z=0
41
FOR T=0 TO 255
42
PRINT
43
X=INP(P+1) \IF INT(X*.5)*2 = X
44
OUT P,T
45
FOR 1=1 TO 50 \X=INT(
46
IF INT(X*.5)*2<>X THEN EXIT 50
47
NEXT
48
!CHR$(7),"Input status not ready.
49
GOTO 53
50
R=INP(P)
51
IF T=R THEN 54
52
!\! CHR$(7),"Port ",T$,": transmitted",T," received as",R,
53
Z=Z+1
54
I=INP(2) \I=I-128*(I>127) \IF 1=27 THEN EXIT 56 \REM Abort test?
55
NEXT T
56 !\! \!"There were",Z," errors encountered." \GOTO 33
57 DATA 3,3
58 DATA 64
59 DATA 206
60
61 DATA 39
62
63 END
North Star HSIO-4
HSIOTEST
REM Set up port addresses for first HSIO-4 port—
\REM Base address of HSIO-4 =10 hex.
\REM USART data port address.
\REM USART command port address.
REM set HSIO-4 baud rates—
\REM 1=9600 baud, 4=1200 baud.
\REM P= baud rate select address.
REM initialize the USARTs—
\REM Send 5 bytes of...
\REM initialization code to...
\REM each command port.
REM Clear each HSIO-4 port—
\REM clear by reading each data port.
[A,B,C,D]: ", \T$=INCHAR$(0) \!\!
to abort current test..."
\REM Convert ASCII 'A ','B ','C ','D '...
INPCP+l) *.5)
\REM
\REM Cmd- RTS and DTR low,
8-April-81
REM Edit B for non-standard address'
\!\! \!"Testing port: ",T$
REM into actual data port address...
REM
(B+2, B+6, B+10, B+14).
\REM Initialize error counter.
\REM Test all possible bytes.
\REM Show some life!
THEN 43 \REM Wait until port ready.
\REM Send it a character.
\REM Exit if character received.
Not receiving data!"
\REM Get transmitted character.
\REM If transmitted= received, then AOK!
\REM Ensure acceptance of...
\REM Internal Reset.
\REM Mode- 2 stop, no parity,
8 data, 16*clock.
REM enable Receive and Transmit.
67
User/Technical Manual

Advertisement

Table of Contents
loading

Table of Contents