Access PCI-COM422/4 user manual Transmission

Page 24

PCI-COM422/4 Manual

Transmission

RS422 transmission is simple to implement. The AUTO feature of the PCI-COM422/4 card automatically 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 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(BASEADDR +4, inportb(BASEADDR +4)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(BASEADDR +4, inportb(BASEADDR +4)&0xFD); /*Reset RTS bit without altering states of other bits*/

Page 5-4

Manual MPCICOM422-4.E1b

Image 24
Contents Model PCI-COM422/4 Page Page Warranty Terms and ConditionsCoverage Equipment Not Manufactured by AccesTable of Contents List of Figures List of TablesRS422 Balanced Mode Operation Communication ModeIntroduction COM Port CompatibilitySpecifications Baud Rate RangesCommunications Interface Environmental1PCI-COM422/4 Block Diagram Only One Serial Channel Shown PCI-COM422/4 Manual Manual MPCICOM422-4.E1b Installation CD InstallationInch Diskette Installation DOS/WIN3.xDirectories Created on the Hard Disk WinRisc.exeSamples PCIFind.exeInstalling the Card Input/Output Connections PCI-COM422/4 Manual Manual MPCICOM422-4.E1b Data Cable Wiring Option SelectionTerminations Baud Rate RangesInterrupts Serial2 Subkey2PCI-COM422/4 Option Selection Map Address Selection Programming Sample ProgramsWindows Programming InitializationBaud Rate Divisor Max Diff. Cable Length Reception Transmission Connector Pin Assignments PCI-COM422/4 Manual Manual MPCICOM422-4.E1b Customer Comments