background image

PCL-740

Serial Communication

RS-232/422/485/Current-Loop

Interface Card

Summary of Contents for PCL-740

Page 1: ...PCL 740 SerialCommunication RS 232 422 485 Current Loop InterfaceCard ...

Page 2: ...any means without the prior written permission of Advantech Co Ltd Information provid ed in this manual is intended to be accurate and reliable However Advantech Co Ltd assumes no responsibility for its use nor for any infringements of rights of third parties which may result from its use Acknowledgments PC LabCard is a trademark of Advantech Co Ltd IBM PC and PC XT AT are trademarks of Internatio...

Page 3: ... 2 Hardware Installation 7 Initial Inspection 8 PCL 740 Jumper and Switch Locations 9 Card Configuration 10 Jumper settings 12 Card installation 16 Appendix A Register structure and format 17 Register Structure 18 Programming example 21 Appendix B PC I O Address Reference 25 PC I O Address Usage 26 ...

Page 4: ...Chapter 1 Introduction 1 1 Introduction C H A P T E R ...

Page 5: ...ore putting it on the bus the UART drastically reduces the CPU load This makes the PCL 740 especially suitable for high speed serial I O applications and applications under MS Windows In RS 485 mode the PCL 740 automatically senses the direction of incomming data and switches its transmission direction accordingly Therefore no handshaking signal e g RTS signal is necessary This feature lets you si...

Page 6: ...ptional surge protection RS 422 485 only Space reserved for termination resistor RS 422 485 only LED indicator on each port indicates data flow Automatic data flow control in RS 485 mode Applications PLC monitoring and control Serial communication in harsh environments Data entry terminals Remote data acquisition and control Instrument controller distributed control systems Interface to modem bar ...

Page 7: ...1 12 or 15 Power consumption 5 V 250 mA typical 350 mA Max Connectors DB 9 male DB 25 male Operating temperature 32 to 122o F 0 to 50o C Dimensions 7 25 x 4 13 18 4 cm x 10 5 cm Weight 0 2 Kg RS 232 interface Signal driver receiver SN 75188 SN 75189 Signals TxD RxD RTS CTS DTR DSR DCD RI GND Mode Asynchronous full duplex Baud rate 50 to 115200 bps Stop bits 1 1 5 2 Parity Even odd or none Data bit...

Page 8: ...ission distance 1000 m RS 422 Interface Signal driver receiver SN75176 SN75173 Signals TxD TxD RxD RxD RTS RTS CTS CTS GND Mode Asynchronous full duplex point to point Max data rate 115 Kbps Max data distances 4000 feet 1220 meters RS 485 Interface Signal driver receiver SN75176 Signals DATA DATA GND Mode Half duplex multi drop Max data rate 115 Kbps Max data distances 4000 feet 1220 meters ...

Page 9: ...6 PCL 740 User s Manual ...

Page 10: ...Chapter 2 Hardware Installation 7 2 Hardware Installation C H A P T E R ...

Page 11: ...representative immediately Also notify the carrier Retain the shipping carton and packing material for inspection by the carrier After inspection we will make arrangements to repair or replace the unit When you handle the PCL 740 remove it from its protective packag ing by grasping the rear metal panel Keep the anti vibration pack ing Whenever you remove the card from the PC store it in this packa...

Page 12: ...Chapter 2 Hardware Installation 9 Protocol Selection Base Address IRQ Selection Rx Active Passive Tx Active Passive Current loop select RS 422 485 RS 232 Current loop PCL 740 Jumper and Switch Locations ...

Page 13: ... mode and receiver status all require setting up The functions of the relevant DIP switches and jumpers are shown below PCL 740SwitchandJumperOptions Selection Switches Jumpers Function Protocol Selection JP5 RS 232 422 485 Current Loop Current Loop Status JP2 Current Loop TX active passive JP3 4 Current Loop RX active passive Address Selection SW1 Base address for serial port IRQ Selection JP1 In...

Page 14: ...as this default setting you may simply install the card without the need for any setting up The PCL 740 DIP switch and jumper default settings are as shown below Protocol selection RS 232 mode JP5 JP5 Interrupt level IRQ4 JP1 JP1 Base address 3F8 SW1 SW1 ON A3 A4 A5 A6 A7 A8 SW1 RS 232 RS 422 RS 485 C L IRQ 15 12 11 10 9 7 6 5 4 3 ...

Page 15: ...et Tx and Rx for active or passive mode In the active mode the Tx or Rx will generate the current required for data transfer over the link In the passive mode the current is generated by the card at the other end of the link TxD RxD Active Passive You may configure both the Tx and Rx to operate in the same mode or you can configure each Tx and Rx to operate in different modes Note Whatever mode yo...

Page 16: ...ess area from hex 200 to hex 3F8 If you have more than one card installed you must select a different base address for each card The factory default settings for the base address is Hex 3F8 Desktop computer Tx Rx Tx Rx Rx Tx Rx Tx Workstation Plotter Active Passive Passive Active Active Active Passive Passive PCL 740 port 1 port 1 or SW1 Default base address 3F8 The required switch settings for va...

Page 17: ... example shows how to set the base address to 2F8 The switch sum is set to 2F8 200 80 40 20 10 8 HEX NOTE On the PCL 740 the address line A9 is does not appear on the DIP switch as it is permanently hard wired to HEX 200 on the card ON A3 A4 A5 A6 A7 A8 Base address Deci mal HEX line value value A3 8 8 A4 16 10 A5 32 20 A6 64 40 A7 128 80 A8 256 100 A9 512 200 ...

Page 18: ... 3 up to level 15 with the exception of 8 13 and 14 If the card is to be designated as COM1 the interrupt level must be set to IRQ4 the default For COM2 the setting is IRQ3 Ensure that this does not conflict with any other card s IRQ Simply place the jumper link on the required interrupt level as shown below JP1 ...

Page 19: ... expansion slots or passive backplane at the rear of the PC and choose any unused slot 5 Remove the screw that secures the expansion slot cover to the PC save the screw to secure the interface card retaining bracket Remove the anti vibration card clamp if supplied 6 Carefully grasp the upper edge of the PCL 740 card Align the hole in the retaining bracket with the hole on top of the expansion slot...

Page 20: ...Appendix A Register structure and format 17 A Register structure and format A P P E N D I X ...

Page 21: ... or SW2 DLAB is the Divisor Latch Access Bit bit 7 of BASE 3 BASE 0 Receiver buffer register when DLAB 0 and the opera tion is a read BASE 0 Transmitter holding register when DLAB 0 and the operation is a write BASE 0 Divisor latch bits 0 7 when DLAB 1 BASE 1 Divisor latch bits 8 15 when DLAB 1 The two bytes BASE 0 and BASE 1 together form a 16 bit number the divisor which determines the baud rate...

Page 22: ... 0 Enable transmit and receive FIFOs bit 1 Clear contents of receive FIFO bit 2 Clear contents of transmit FIFO bits 6 7 Set trigger level for receiver FIFO interrupt Bit 7 Bit 6 FIFO trigger level 0 0 01 0 1 04 1 0 08 1 1 14 BASE 3 Line Control Register LCR bit 0 Word length select bit 0 bit 1 Word length select bit 1 Bit 1 Bit 0 Word length bits 0 0 5 0 1 6 1 0 7 1 1 8 bit 2 Number of stop bits ...

Page 23: ...eak interrupt bit 5 Transmitter holding register empty bit 6 Transmitter shift register empty bit 7 At least one parity error framing error or break indication in the FIFO BASE 6 Modem Status Register MSR bit 0 Delta CTS bit 1 Delta DSR bit 2 Trailing edge ring indicator bit 3 Delta received line signal detect bit 4 CTS bit 5 DSR bit 6 RI bit 7 Received line signal detect BASE 7 Temporary data reg...

Page 24: ... direct register control include dos h include io h include stdio h include conio h Timeout value in seconds define TIME_OUT 10000 static int base0 0x3f8 Port 1 base address COM1 static int base1 0x2f8 Port 2 base address COM2 static char rec 16 Receive buffer static char cmd 16 Command buffer void main int i timeout counter for timeout char flag Set up Port 1 COM1 outport base0 2 0xc9 Enable FIFO...

Page 25: ...5 200 outp base1 0x01 outp base1 1 0 outp base1 3 0x03 Set data 8 stop 1 no parity outp base1 1 0x00 Disable interrupt printf nEnter string max 15 char or Q to quit gets cmd while cmd 0 q cmd 0 Q Send string on Port 1 COM1 i 0 cmd strlen cmd 0x0d flag 1 while flag outportb base0 cmd i Send data if cmd i 0x0d flag 0 i ...

Page 26: ...ived data on port if inportb base1 5 1 0 rec i inportb base1 Receive data if rec i 0x0d rec i 1 0 flag 0 printf nReceived data s n rec i else Check timeout timeout if timeout 0 flag 0 printf nTimeout error n End of receive data while printf nEnter string max 15 char or Q to quit gets cmd End of Enter string while End of main ...

Page 27: ...24 PCL 740 User s Manual ...

Page 28: ...Appendix B PC I O Address Assignments 25 B PC I O Address Reference A P P E N D I X ...

Page 29: ...r 060 063 PPI 8255A 070 071 Real Time Clock 080 08F DMA Page Register 0A0 0BF 8259A Interrupt Chip 0C0 0DF Second DMA Controller 8237A 0F0 0FF Math Coprocessor 1F0 1F8 AT Fixed Disk 200 20F Game I O 278 27F Parallel Printer Adaptor 2 2F8 2FF Serial Adaptor COM 2 320 32F XT Fixed Disk 378 37F Parallel Printer Adaptor 1 380 38F SDLC Binary Communication Adaptor 3A0 3AF Master Binary Communication Ad...

Reviews: