Neither the PR# nor IN# commands in Applesoft and Integer Basic initialize the High Speed Serial Interface. This situation can cause problems for you if you need to modify the parameters of the interface for your application.
What happens is that the ROM on the High Speed Serial Interface card, upon receiving the first character, sets all parameters to their default settings; so, after you've POKEd the parameter you want, the first character you send will cause the ROM to overwrite all the parameter locations you just set up.
The remedy is to send a character through the card and then change the parameter locations by means of the following POKEs. Please refer to the High Speed Serial Interface Card manual for additional information about what each POKE does.
Replace all occurrences of "s" below with the number of the slot that the High
Speed Serial Interface Card is plugged into.
10 POKE 1144+s,64 BRATE, page 21
20 POKE 1272+s,2 STBITS, page 21
30 POKE 1400+s,7 STATUS, page 22
40 POKE 1528+s,0 Character counter
50 POKE 1784+s,80 PWDTH, page 23
60 POKE 1912+s,9 NBITS, page 23
70 POKE 2040+s,129 FLAGS, page 24
To benefit from these POKEs, you will need to use the additional list of POKEs below; these POKESs replace the PR# and IN# commands. Use CALL 1002 if you will be doing DOS commands while the interface is enabled. Since DOS does slow down I/O, you can opt to delay using the CALL 1002 until after the data transfer has been made if you need maximum I/O speed..
These POKEs must all be on one command line separated by colons to work in command mode:
POKE 54,5: POKE 55,192+s: POKE 65,7: POKE 57,192+s: CALL 1002
They can have separate line numbers in a program:
80 POKE 54,5 PR#s
90 POKE 55,192+s
100 POKE 65,7 IN#s
110 POKE 57,192+s
120 CALL 1002
The normal way to reset the I/O to the Apple video and keyboard is:
900 D$ = CHR$(4): REM CTRL-D
910 PRINT D$; "PR#0"
920 PRINT D$; "IN#0"
However, this will only work after a PRINT and will be ignored after a GET or PRINT terminated with a comma or semicolon. To avoid having to do an extra
PRINT you can use:
900 CALL -375 : REM THIS IS IN#0
910 CALL -365 : REM THIS IS PR#0
920 CALL 1002 : REM THIS RECONNECTS DOS
Video Echo
----------
Do not allow echoing to video while printing. Your program or variables will suffer if video output is not disabled while printing lines more than 40 characters long. Refer to the High Speed Serial Interface Card manual, which came with your card, for additional information on disabling video echo.
Article Change History:
18 Nov 1996 - Reviewed for technical accuracy, revised formatting.