Reading The Cts, Dsr & Dcd Input Handshake Lines; Detecting Incoming Data - Brainboxes RS422 Manual

Hide thumbs Also See for RS422:
Table of Contents

Advertisement

AT & OPTO DUAL RS422/485
5305 HSON = (INP(S + 4) AND 255 - RTS): REM Mask
5310 OUT (S + 4), HSON: PRINT "RTS OUT FALSE"
5320 GOSUB 8000: REM update bottom line
5330 RETURN
5340 :
5350 :
Reading The CTS, DSR & DCD Input Handshake
Lines.
The state of the CTS, DSR and DCD input handshake lines
is detected by reading the Modem Status Register, register 6.
CTS current state is in bit 4, change in CTS state sets bit 0.
DSR current state is in bit 5, change in DSR state sets bit 1.
RI
current state is in bit 6, change in RI state sets bit 2.
DCD current state is in bit 7, change in DCD state sets bit 3.
Note that on the Dual RS422/485 cards DCD and DSR are
permanently tied TRUE and RI is permanently tied FALSE.
5063 REM DCD is normally IGNORED in serial comms
5064 REM DSR is normally used to check that a
5066 :
5067 CTS = 16: DSR = 32: DCD = 128
8040 CTS$= "1": CTSI = (INP(S + 6) AND 16): IF
8042 DSR$= "1": DSRI = (INP(S + 6) AND 32): IF
8044 DCD$= "1": DCDI = (INP(S + 6) AND 128): IF

Detecting Incoming Data.

Incoming data is received by reading the Receiver Buffer Register,
RBR, register 0, a read only register.
Whenever a byte is received, the serial port chip sets the DR
bit, Data Ready, bit 0 of LSR, indicating the RBR register is full.
Serial Utilities and Programming
device is present i.e. is on line.
CTSI= 0 THEN CTS$ = "0"
DSRI= 0 THEN DSR$ = "0"
DCDI= 0 THEN DCD$ = "0"
OFF RTS
programs
Chapter 5 Page 65

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rs485

Table of Contents