[comp.sys.atari.st] ST RS232 config.??!?!

ncastellano@eagle.wesleyan.edu (09/03/89)

Hi...


   I am interested in writing terminal software for the ST.  I can't seem to
figure out how to configure the RS232 port, however.  If anyone has routines to
do this, I'd be extremely grateful.  GFA Basic preferred, but I also read
Pascal and C.

                   thanx in advance

                          nick


         NCASTELLANO@EAGLE.WESLEYAN.EDU
           NCASTELLANO@WESLEYAN.BITNET

logajan@ns.network.com (John Logajan) (09/04/89)

In article <925@eagle.wesleyan.edu>, ncastellano@eagle.wesleyan.edu writes:
>    I am interested in writing terminal software for the ST.  I can't seem to
> figure out how to configure the RS232 port, however.

Controlling the RS232 port from GFA Basic.  An actual example.

Void Xbios(15,7,0,&H88,1,1,-1) ! RS232 configuration/baud rate. (See below.)
Rem
Rem Configure RS232 - Xbios(15,baud,ctrl,ucr,rsr,tsr,scr).
Rem baud = 0/19200, 1/9600, 4/2400, 7/1200, 9/300, 13/110.
Rem ctrl = 0/None, 1/XOFF-XON, 2/RTS-CTS(doesn't work), 3/both.
Rem ucr = 8bits, 1stop, noparity.
Rem rsr = recv enabled.
Rem tsr = xmit enabled.
Rem scr = not used.
Rem

Note the use of -1, above, to RETAIN current variable settings.

0 19200
1 9600
2 4800
3 3600
4 2400
5 2000
6 1800
7 1200
8 600
9 300
10 200
11 150
12 134
13 110
14 75
15 50

ucr bits:
0 not used
1 0=odd 1=even parity
2 0=no parity 1=parity
3,4 (in 4,3 order -->) 00-sync,01-async/1stopbit,10-async/1.5,11-2stopbits
5,6 (6,5 order) 00-8bits,01-7bits,10-6bits,11-5bits.
7 0=direct clock, 1=divide by 16 (use div/16 to get correct baud rates!)

rsr bits:
0 1=receiver enable
1 1=syncronous strip?
2 1=start bit detected
3 1=break detected
4 1=frame error
5 1=parity error
6 1=overrun error
7 1=buffer full

tsr bits:
0 1=transmitter enable (else see state below!)
1,2 (2,1 order) 00=output high,01=high,10=low,11=loop back.
3 1=force break
4 end of transmission ?
5 auto turnaround ?
6 1=underrun error
7 1=buffer empty

scr:  Some sort of syncronous data i/o port.

-- 
- John M. Logajan @ Network Systems; 7600 Boone Ave; Brooklyn Park, MN 55428  -
- logajan@ns.network.com / ...rutgers!umn-cs!ns!logajan / john@logajan.mn.org -