Manual Number: 00650-146-1
Page 16
PCI-COM485/8 Manual
Transmission
RS-485 transmission is simple to implement. The AUTO feature of the PCI-COM485/8 card auto-
matically enables the transmitter when data is ready to send so no software enabling is required.
The following software example is for non-AUTO operation.
To transmit a string of data, the transmitter must first check Bit 5 of the Line Status Register at Base
A5. 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(BA5)&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*/