Transmission
RS485 transmission is simple to implement. The AUTO feature in RS485 mode automatically enables
the transmitter when data are ready to send, so no software enabling is required. The following
software example is for non-AUTO operation in RS422 mode. First the RTS line should be set high by
writing a 1 to Bit 1 of the Modem Control Register at Base A4. The RTS line is used to toggle
the transceiver from receive mode to transmit mode and vice versa..
After the above is done, the card is ready to send data. 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. After all data has been transmitted, the
RTS bit should be reset by writing a 0 to Bit 1 of the Modem Control Register.
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*/
Caution
The OUT2 bit of the UART must be set ‘TRUE’ for proper interrupt driven communication. Legacy
software uses this bit to gate interrupts and the card may not communicate if bit 3 of register 4 (Modem
Control Register) is not set.
Manual PCI-COM-1S
16