background image

Page 5-3

Manual 00650-521-1

The C command to set the UART for an 8-bit word, no parity, and one stop bit is:

outportb(BA3, 0x03)

The final initialization step is to flush the receiver buffers.  You do this with two reads from the
receiver buffer at Base A0.  When done, the UART is ready to use.

Reception

Reception can be handled in two ways: polling and interrupt-driven.  When polling, reception is
accomplished by constantly reading the Line Status Register at Base A5.  Bit 0 of this
register is set high whenever data are ready to be read from the chip.  A simple polling loop must
continuously check this bit and read in data as it becomes available.  The following code fragment
implements a polling loop and uses a value of 13, (ASCII Carriage Return) as an
end-of-transmission marker:

do
{
while (!(inportb(BA5) & 1)); /*Wait until data ready*/
data[i++]= inportb(BASEADDR);
}while (data[i]!=13);  /*Reads the line until null character rec’d*/ 

Interrupt-driven communications should be used whenever possible and is required for high data
rates.  Writing an interrupt-driven receiver is not much more complex than writing a polled
receiver but care should be taken when installing or removing your interrupt handler to avoid
writing the wrong interrupt, disabling the wrong interrupt, or turning interrupts off for too long a
period.

The handler would first read the Interrupt Identification Register at Base A2.  If the
interrupt is for Received Data Available, the handler then reads the data.  If no interrupt is pending,
control exits the routine.  A sample handler, written in C, is as follows:

readback = inportb(BA2);
if (readback & 4)         /*Readback will be set to 4 if data are available*/
     data[i++]=inportb(BASEADDR);
outportb(0x20,0x20);          /*Write EOI to 8259 Interrupt Controller*/
return;

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..

Содержание PCI-RS422 Series

Страница 1: ...PCI RS422 Series Product Manual MANUAL NUMBER 00650 521 1B...

Страница 2: ...ual in our online Support Library Thank you The information in this document is provided for reference only ICS Advent does not assume any liability arising from the application or use of the informat...

Страница 3: ...ts which are not in an as new and re saleable condition are not eligible for credit return and will be returned to the customer Limited Warranty Effective April 1 1998 all products carry a 2 year limi...

Страница 4: ...made by various manufacturers in performing warranty repairs and building replacement products If ICS Advent repairs or replaces a product its warranty term is not extended ICSAdvent will normally ret...

Страница 5: ...Cautions and Warnings are accented with triangular symbols The exclamation symbol is used in all cautions and warnings to help alert you to the important instructions The lightning flash symbol is us...

Страница 6: ...ed Mode Operation and Load Termination 1 1 COM Port Compatibility 1 1 Chapter 2 Installation 2 1 Chapter 3 Option Selection 3 1 Chapter 4 Address Selection 4 1 Chapter 5 Programming 5 1 Chapter 6 Conn...

Страница 7: ...Page viii This page intentionally left blank...

Страница 8: ...The user has the option to terminate the transmitter and or the receiver lines RS485 communications requires that a transmitter supply a bias voltage to ensure a known zero state when no device is tra...

Страница 9: ...e driver is enabled when data are ready to be transmitted The driver remains enabled for the transmission time of one additional character after data transfer is complete and then is disabled The rece...

Страница 10: ...s ACE used is type 16550 Driver Receivers used are type 75ALS176 Environmental Operating Temperature Range 0 to 60 C Humidity 5 to 95 non condensing Storage Temperature Range 50 to 120 C Size 4 80 lon...

Страница 11: ...mpts to install the software for this card WIN95 98 NT 1 Place the CD into your CD ROM drive 2 The CD should automatically run the install program after 30 seconds If the install program does not run...

Страница 12: ...E that contains C samples Win32 language Subdirectories containing samples for Win95 98 and NT WinRisc exe A Windows dumb terminal type communication program designed for RS422 485 operation Used prim...

Страница 13: ...ograms in DOS PCIFind exe A utility for DOS and Windows to determine what base addresses and IRQs are allocated to installed PCI cards This program runs two versions depending on the operating system...

Страница 14: ...lot of an IBM or compatible computer Before installing the card carefully read Chapter 3 Option Selection of this manual and configure the card according to your requirements Finally our SETUP EXE pro...

Страница 15: ...nimum susceptibility to EMI as well as minimum radiation it is important that the card mounting bracket be properly screwed into place and that there be a good chassis ground Also proper EMI cabling t...

Страница 16: ...5 operation In RS485 operations where there are multiple terminals only the RS485 ports at each end of the network should have terminating resistors as described above Also for RS485 operation there m...

Страница 17: ...PCI RS422 Manual Page 3 2 Manual 00650 521 1 Figure 3 1 PCI RS422 Option Selection Map...

Страница 18: ...e respective IRQs and DMAs if any allotted Alternately some operating systems Windows 95 98 2000 can be queried to determine which resources were assigned In these operating systems you can use either...

Страница 19: ...the DLAB Divisor Latch Access Bit high This bit is Bit 7 at Base Address 3 In C code the call would be outportb BASEADDR 3 0x80 You then load the divisor into Base Address 0 low byte and Base Address...

Страница 20: ...rtb BASEADDR 0x0C outportb BASEADDR 1 0 The second initializing step is to set the Line Control Register at Base Address 3 This register defines word length stop bits parity and the DLAB Bits 0 and 1...

Страница 21: ...r high data rates Writing an interrupt driven receiver is not much more complex than writing a polled receiver but care should be taken when installing or removing your interrupt handler to avoid writ...

Страница 22: ...tware uses this bit to gate interrupts and the card may not communicate if bit 3 of register 4 Modem Control Register is not set ACCES32 DLL Developed for use with Windows 95 98 NT this driver provide...

Страница 23: ...with three sample applications for Win32 in VisualBASIC 4 0 Delphi 2 0 and Borland C C 4 0 Under Windows95 98 NT ACCES32 DLL allows any windows language to access I O port memory resources It is a 32...

Страница 24: ...5 GND Signal Ground 6 7 8 9 Rx Receive Data Table 6 1 Connector Pin Assignments Data Cable Wiring The following table shows pin connections between two devices for Simplex Half Duplex and Full Duplex...

Страница 25: ...s is also true for RS422 but RS485 offers all the benefits of RS422 plus allows up to 32 devices to share the same twisted pairs An exception to the foregoing is that multiple RS422 devices can share...

Страница 26: ...The circuit may operate without the ground connection but may not be reliable Parameter Conditions Min Max Driver Output Voltage unloaded 4V 6V 4V 6V Driver Output Voltage loaded TERM 2V jumpers in 2...

Страница 27: ...rop Network The following illustration shows a typical multidrop or party line network Note that the transmission line is terminated on both ends of the line but not at drop points in the middle of th...

Страница 28: ...1995RadiatedRFFieldImmunity EN61000 4 4 1995EFTImmunityforACandI OLines EN 60950 1992 Safety of InformationTechnology Equipment Thetechnicaldocumentationrequiredtodemonstratethisproductmeetstherequire...

Отзывы: