Sending Outgoing Data - Brainboxes RS422 Manual

Hide thumbs Also See for RS422:
Table of Contents

Advertisement

Serial Utilities and Programming
2000 IF ((INP(S + 5) AND 1) = 1) THEN PRINT
Bits 1, 2 and 3 of the LSR should also be checked as they indicate
possible errors in the received data.
Bit 1,
OE, Overrun Error, This means that a second data byte
has been received before a previously received byte has
been read from the RBR register, thus the first byte has
been lost. Should have used an interrupt driven program!
Bit 2,
PE, Parity Error
Bit 3,
FE, Framing Error, These bits mean that either a noisy line
has caused the incoming data byte to be corrupted or that
the external serial device transmitting the data is using a
different communications protocol, wrong baud rate, stop
bits, parity or data word length.
The sample program does not check for any of these errors.

Sending Outgoing Data.

Outgoing data is sent to serial devices by writing each data
byte to the write only Transmitter Holding Register, THR, register
0. Before each byte is sent the THRE bit, bit 5 of LSR, must be set
indicating that the transmitter holding register is empty and thus can
accept the next data byte for transmission.
6050 IF ((INP(S + 5) AND 32) <> 32) THEN 6050:
If any handshake lines must be true before transmission is
allowed then the state of the input lines must first be checked by
reading register 6, MSR, the Modem Status Register.
6036 IF ((INP(S + 6) AND HSIN) <> HSIN) THEN 6035:
In the sample program the THRE, transmitter holding
register empty check is performed AFTER each data byte has been
sent, it could be checked before sending the next byte.
Since the sample program is not interrupt driven the
Chapter 5 Page 66
AT & OPTO DUAL RS422/485
CHR$(INP(S));

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rs485

Table of Contents