ICOM-2S Manual
5-4
Manual MICOM-2S.Eb
Transmission
RS485 transmission is simple to implement. The AUTO feature automatically enables the transmitter
when data is ready to send so no software enabling procedure is needed.
The following software example is for non-AUTO operation. 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. It is not carried out on the
line in RS485 and is not used for handshaking. Similarly, the CTS line is not used in RS485 and
should always be enabled by installing a jumper as described earlier.
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*/
{ /*Wait until transmitter is empty*/
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*/
Содержание ICOM-2S
Страница 2: ......
Страница 10: ...ICOM 2S Manual 1 4 Manual MICOM 2S Eb Figure 1 1 ICOM 2S Block Diagram Only one serial channel shown...
Страница 22: ...ICOM 2S Manual 4 4 Manual MICOM 2S Eb...
Страница 31: ...ICOM 2S Manual A 4 Manual MICOM 2S Eb...