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

Horizon serial input/output four port
Table of Contents

Advertisement

3.3.5
SAMPLE PROGRAM
North Star HSIO-4
This section provides a very basic example of
how to program a USART in the HSIO-4 for
synchronous operation. Programming for
specific applications requires a detailed
familiarity with USART operation. It is beyond
the scope of this manual to provide specific
instructions on programing for such
applications. However, for the convenience of
the programmer, the manufacturer data sheet
for the USART is reproduced in Appendix B.
Three routines are given:
INIT sets up the USART in synchronous mode,
waiting to receive sync characters.
SYNI loads a received message into RAM
starting at the address given in HL.
SYNO transmits a message from RAM starting
at the address given in HL.
length (number of bytes) is given in BC.
The message is preceded by 255 DLE-SYN sync
character pairs and a DLE-STX; this
indicates the start of the message.
The message is terminated by a DLE-ETX;
this indicates the end of the message.
As the data transferred is binary and may
contain any character, an escape character
must be used to indicate the presence of
control characters such as End-of-text,
Start-of-text, and Sync. The escape character
used here is DLE (10H). If a DLE character
occurs in the data, this is replaced by two
DLEs in sequence.
46
The message
User/Technical Manual

Advertisement

Table of Contents
loading

Table of Contents