
TRANSMISSION
RS-485 transmission is simple to implement. The AUTO feature of the board automatically enables the
transmitter when data are ready to send so no software enabling is required.
To transmit a string of data, the transmitter must first check Bit 5 of the Line Status Register at Base Address
+5. That bit is the transmitter-holding-register-empty flag. If it is high, the transmitter has sent the data. The
process of checking the bit until it goes high followed by a write is repeated until no data remains.
The following C code fragment demonstrates this process:
outportb(BA4, inportb(BA4)|0x02);
/*Set RTS bit without altering states of other bits*/
while(data[i]);
/*While there is data to send*/
{
while(!(inportb(BASEADDR
+5)&0x20)); /*Wait until transmitter is empty*/
outportb(BASEADDR,data[i]);
i++;
}
outportb(BA4, inportb(BA4)&0xFD);
/*Reset RTS bit without altering states of other bits*/
Manual 104-COM-8S
21