Home

User`s Manual

image

Contents

1. 35 25 2 64 7 4 0 He uao ua Dj n cn E emo c JE mm C cm ZJE mr Figure 6 4 External Dimensions CONTEC 38 COM 1PD FIT GY COM 1PD FIT GY User s Manual CONTEC CO LTD December 2003 Edition 3 9 31 Himesato Nishiyodogawa ku Osaka 555 0025 Japan Japanese http www contec co jp English http www contec com Chinese http www contec com cn No part of this document may be copied or reproduced in any form by any means without prior written consent of CONTEC CO LTD 08062003 12102003 Management No A 46 812 Parts No LYDC891
2. COM 1PD Figure 3 1 Connecting an interface connector and connectors that can be used Transmit Data TxD Transmit Data TxD 6 RxD Receive Data Request to Send RTS 7 F RxD ReceiveData 8 F CTS Clear toSend 9 F CTS Clear to Send Request to Send RTS Signal Ground SG CHO D SUB9 pin F emale Figure 3 2 Signal Layout on the Interface Connector A CAUTION For TxD RxD and RTS big numbered pins are and small numbered pins are For CTS big numbered pins are and small numbered pins are This is the opposite of the other signals but is not a misprint The external metal frame shell of the connector is insulated from the unit or not in contact with any part of the unit When grounding is required for example as data transfer remains unstable ground the remote device to the earth Q CONTEC COM IPD FIT GY 13 3 Connecting to an External Device Types of Cable and Example Connections The figures below show examples of how to connect the cable for the module The RS 422A 485 interface works based on a differential signal whereby the signal is carried by the potential difference between two lines and Using twisted pair cable is recommended to improve resistance to noise I p TxD A A DB VU LS TxD f TxD CY CY bd M L RxD RxD CY CY MV V A RxD A A RxD p T RTS RTS O A A A i RE M
3. CHO LSR D5 Bit 1 Send CHO data I 3 Show an interrupt count CH1LSR D5 Bit 1 Send CH1 data Show an interrupt count Restore the interrupt vector Show data End Interrupt processing ll Read interrupt vector register CHO IVR DO Bit 0 Count number of interrupts Read CHO data No Count number of interrupts Read CH 1 data No 5 Using the Module CONTEC COM IPD FIT GY 31 5 Using the Module Sample Program Sample program 2 UNITO lt gt UNITI Loop Test UNIT No 0 d DEVICE ID 4 7 Mode Enhanced Mode Channel 0 1A0H 2A0H Baud Rate 115 200 bps Interrupt IRO5 IRQ7 include lt stdio h gt include lt conio h gt include lt dos h gt faa Constant s2 54 R 43s Seen gS SS eS SS nae define CH 2 no of channels define NUM 10 data of total number define BPS 1 baud rate define IRO5 0 IRQS define IRQ7 1 IRQ7 volatile unsigned char rbuf CH NUM receive buffer volatile unsigned int ADR CH 0xla0 0x2a0 I O address volatile unsigned int intcnt CH 0 0 interrupt counter volatile int IrqLevel IRQ5 interrupt level int OrgMas
4. CONTEG COM IPD FIT GY 9 2 Module Nomenclature and Settings Setting of Terminator The terminator setting switch controls whether or not a terminator is inserted into each signal line Set the terminators on or off in accordance with the devices with which you are communicating The terminators on the module are 100Q resistors See Figure 2 4 for details on how to use terminators in a multi drop party line connection Each bit in the switch corresponds to a different signal line bit 7 for RxD bit 8 for CTS bit 9 for TxD and bit 10 for RTS Setting Procedure If you wish to use a terminator of other than 1000 set the terminator switch OFF and insert an external terminator Table2 3 Setting of Terminator Inserted Nat inserted Term ON Term OFF N NS a N Hi Factory Nn E setting Setting x n n 4 lt m m N N E E Figure2 3 Aor D Figure 2 3 B or C Both terminators Other than both of the line terminators of the line Terminator 3 i ERP Es disces art es E i Ji EE 1 Di tit 1 i a e i ti iI i jn 1 1 ia ee i Tu 1 toy i A B C Figure 2 3 Party Line Connection N CAUTION When the data transfer mode is set to half duplex only set bit 9 ON Communications may not function if other
5. printf Mn printf Interrupt CH0 02d CH1 02d n intcnt 0 intent 1 i End of file CONTEC 34 COM 1PD FIT GY 6 System Reference Block Diagram lt Interface Connector CHO ZN Recei ver Driver UART XR16C2850 Compatible kK kK Control Circuit Kem Device ID lt Stack Connector Figure 6 1 Block Diagram CONTEC 6 System Reference COM 1PD FIT GY 35 6 System Reference Equivalence Circuit S SPAL t o 1002 TxD RTS I I sno 6 2kQ l He o 1009 RxD CTS L 1 o MORS ENT 6 2kQ C ATQ Fr Figure 6 2 Circuitry Diagrams RS 422A 485 in Full Duplex SP491 ee I n 4 o T gt TxD RxD l T o l l l axo i i 62ko 4 7 TIT 1000 lor est 6 2kQ AKO Hr Figure 6 3 Circuitry Diagrams RS 422A 485 in Half Duplex CONTEG 36 COM IPD FIT GY 6 System Reference Specification Table 6 1 Specification Item Specification Number of channels Data length 5 6 7 8 bits 1 1 5 2 stop bits 1 Parity check Even Odd Non parity 1 Controller chip 162850 or equivalent Each channel has 128 byte receive and 128 byte transmit FIFO buffers 25 2 W x 64 7 D x 94 0 H exclusive of protrusions Module installatio
6. a RTS RTS a T pu CTS A A CTS 2 Nf M CTS f CTS o O SG SG I AtxD I A TxD4 4 df NI kin f TxD zy RxD A RxD pu i d hd RxD A J RxD A Y Y a SG SG oA I External device Figure 3 5 Example Connection in Half Duplex A CAUTION If connecting between external devices and this board with faulty wiring it will become the cause of failure CONTEC 14 COM IPD FIT GY 4 Functions 4 Functions This section describes the functions of the module Communication Function Serial Data Transmission Sends and receives data in accordance with the RS 422A 485 standard The baud rate for each channel can be set independently in the range 2 to 921 600bps by software RS 422A 485 Control Lines All ports include the RTS RTS CTS and CTS control lines The lines can be controlled or monitored by software from the application Send and Receive Data Buffers Each channel has a separate 128 byte send and 128 byte receive buffer The buffers operate as FIFO buffers and help reduce the load on the CPU for high speed communications or system operation The FIFO trigger size is a data buffer size that determines the timing of generating a hardware interrupt Increasing the FIFO trigger size decreases the number of times hardware interrupts occur for data transmission and reception thereby reducing the load on the CPU However this delays the timing
7. Bits Enable 4h Modem Control Register MCR Clock IR Loop OP2 and Out 1 RTS DTR Prescaler Mode Back INT O INT Select Enable 2 Enable Enable Enable 2 2 LINT Disable 1 ph Disable ton Disabled 7h Scratch Pad Register SPR 7h Enhanced Mode Select Registers EM SR 3 LUE e Bit 3 Bit 2 1 For details see the Using an Interrupt section 2 These bits are enabled with EFR bit 4 1 3 These registers are enabled with FCTR bit 6 1 Figure 5 6 Output port General Registers Output port 2 Baud Rate Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 40h LSB of Divisor Latch DLL 1h MSB of Divisor Latch DLM eee a eT Figure 5 7 Output port Baud Rate Registers CONTEG COM IPD FIT GY 23 5 Using the Module Output port 3 Enhanced Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 40h FIFO Level Counter Hh Mode Swap Bit1 Bit 0 Auto Inv Delay Delay control Bit 1 Bit 0 42h Auto Enable RTS IER Bits 4 7 ISR FCR Bits 4 5 MCR Bits 5 7 44h 45h 6h Xoff 1 Word E Oe 7h Xoff 2 Word et Word i Figure 5 8 Output port Enhanced Register Output port 4 Interrupt Vector Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 1Fh Interrupt Vector Registers Clock Clock Reserved selection selection Bit1 Bit 0 Figure 5 9 Output port Interrupt Vector Registers CONTEC 24 COM IPD FIT GY 5 Using the Module Interrupt Vector
8. bits are set ON 10 CONTEC COM IPD FIT GY 2 Module Nomenclature and Settings The figure below shows the circuit associated with the data transfer mode setting switch and terminator setting switch 65 4 Terminator SON 2 Da 1 9 910 o oU LL o 62 Terminator 1 2W 1000 or E quive Data transmission SOUT OTxD Do OTxD O RxD M dis O RxD OCTS CTS 4 b OCTS 1 ORTS BIS ORTS DCD DTR DSR i Figure 2 4 Setting Switch Circuits e LED Indicator RX Indicates that the module is receiving serial data green TX Indicates that the module is transmitting serial data green CONTEG 11 COM 1PD FIT GY 2 Module Nomenclature and Settings CONTEC 12 COM IPD FIT GY 3 Connecting to an External Device 3 Connecting to an External Device Interface Connector How to Connect an Interface Connector When connecting the Module to an external device you can use the supplied connector plug Lock nut UNC 4 40 inch screw Connector used DELC J 9SAF 20L9 Female Connector type mfd by J AE equivalent d Applicable cud 17 E 23090 02 D8C Male Connector type mfd by DDK CN5 D9M Male Connector type mfd by CONTEC e
9. char inp ADR 1 0x1f Int Vector Register if stsl amp 0x1 CHO status while inp ADR 1 0x05 amp 0x1 rbuf 1 intcnt 1 unsigned char inp ADR 1 0x0 intent 1 count times of an interrupt while stsl amp Oxf CONTEG COM 1PD FIT GY 33 5 Using the Module _disable disable outp 0x20 0x20 EOI Tee main f void main void unsigned int i j Initialize initialize ChgVect change vector for j 0 j lt NUM j send CHO to CH1 while inp ADR 0 0x5 amp 0x20 transmitter empty outp ADR 0 0x0 j while intcnt 1 lt 10 printf Interrupt CH0 02d CH1 02d n intcnt 0 intcnt 1 printf Nin for j 0 j lt NUM j send CH1 to CHO while inp ADR 1 0x5 amp 0x20 transmitter empty outp ADR 1 0x0 j while intcnt 0 lt 10 printf Interrupt CH0 02d CH1 02d n intcnt 0 intcnt 1 printer vate ResVect restore vector for j 0 j lt NUM j printf CH0 02x gt CH1 02x We rout EI IIT if rbuf 1 j j printf Verify Error n verify data else printf n printf Mn for j 0 j lt NUM j printf CH1 02x gt CH0 02x j rbuf 0 if rbuf 0 j j printf Verify Error Wn else printf Mn
10. follow the disposal procedures stipulated under the relevant laws and municipal ordinances CONTEG COM IPD FIT GY 5 1 Before Using the Product CONTEC 6 COM IPD FIT GY 2 Module Nomenclature and Settings 2 Module Nomenclature and Settings Nomenclature of Module Components Figure 2 1 shows the names of module components In the figure the indicated switch settings represent factory settings LED Indicator Device ID t gt ES Transmission mode terminators F Interface connector lo O COM 1PD EEEE Oo Figure 2 1 Names of module components Q CONTEC COM IPD FIT GY 7 2 Module Nomenclature and Settings Setting a Device ID Depending on the specific Device ID that is set the COM IPD FIT GY can be switched over between the compatible mode and the enhanced mode Table 2 1 shows the relationship between Device IDs and the modes For a description of the compatible and enhanced modes see Chapter 4 Using the Module The factory setting is 0 in which the COM IPD FIT GY can be used as a COMG standard port Setup Method A device ID can be set by turning the rotary switch on the device face To set a device ID turn the switch knob Factory settings Device ID 0 Figure 2 2 Setting a Device ID Table 2 1 I O Address Cho o fosestoo3erF nos IRQ7 IRQS e fozaotooza7 iros Is 800
11. in property damage CONTEC COM IPD FIT GY 3 1 Before Using the Product Handling Precautions N CAUTION Take the following precautions when handling this module Do not modify the module CONTEC will bear no responsibility for any problems etc resulting from modifying this module Do not use or store the equipment in a hot or cold place or in a place that is subject to severe temperature changes Operating temperature range 0 to 50 C Do not use or store the equipment in a place subject to direct sunlight or near a heating device such as a stove Do not use or store the equipment in a dusty or humid place Operating humidity range 10 to 9096 RH no condensation As this product contains precision electronic components do not use or store in environments subject to shock or vibration Do not use or store the product near equipment generating a strong magnetic field or radio waves If you notice any strange odor or overheating please unplug the power cord immediately In the event of an abnormal condition or malfunction please consult the dealer from whom the equipment was purchased To avoid electric shock please do not touch the system with a wet hand Do not open the module casing CONTEC will disclaim any responsibility for equipment whose casing has been opened To prevent damage please do not subject the module to impact or bend it To prevent contact malfunctio
12. of transmitting data to the remote device and the timing of notifying an application of data reception because actual transmission and reception take place after a certain amount of data has been collected In contrast decreasing the FIFO trigger size or disabling FIFO memory shortens the timing of data transmission and reception but may increase the load on the CPU or miss some receiving data Since the FIFO trigger size is variable adjusting it depending on the system results in optimum performance CONTEC COM IPD FIT GY 15 4 Functions Setting the Baud Rate The output baud rate can be set by setting the appropriate value to the Baud Rate Generator register The available setting range depends on which clock mode is used Clock 3 mode 15 to 921 600bps Clock 2 mode 8 to 460 800bps Clock 1 mode 4 to 230 400bps Clock 0 mode 2 to 115 200bps However some baud rate values do not have a corresponding Baud Rate Generator register setting If the result of substituting the baud rate into the equation below is an integer then that baud rate can be set If the result contains a fractional part the baud rate cannot be set Clock 3 mode 921600 Desired baud rate Division register setting value Ex 921600 9600bps 96 As the result is an integer this baud rate can be set 921600 128000bps 7 2 As the result contains a fractional part this baud rate cannot be set Clock 2 mode 460800 Desired baud rate Divisio
13. 5 2 Input port General Registers CONTEC COM IPD FIT GY 21 5 Using the Module Input port 2 Baud Rate Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 40h LSB of Divisor Latch DLL 1h MSB of Divisor Latch DLM Figure 5 3 Input port Baud Rate Registers Input port 3 Enhanced Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 40h FIFO Level Counter Hh Mode Swap Bit1 Bit 0 Auto Inv Delay Delay control Bit 1 Bit 0 42h Enable Cont 3 Cont 2 Cont 1 Cont 0 IER Tx Rx Tx Rx Tx Rx Tx Rx Bits 4 7 Control Control Control Control ISR FCR Bits 4 5 MCR Bits 5 7 44h 5h Xon 2 Word 36h Xoff 1 Word 7h Xoff 2 Word Figure 5 4 Input port Enhanced Registers Input port 4 Interrupt vector register Starting I O D7 D6 D5 D4 D3 D2 D1 DO address 1Fh Interrupt vector register reco 0 Interrupt Figure 5 5 Input port Interrupt vector register CONTEC 22 COM IPD FIT GY 5 Using the Module Output port 1 General Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 40h Transmit Holding Register res 1h Interrupt Enable Register IER CTS RTS Xoff MODEM Receive Transmit Receive Interrupt Interrupt Interrupt Status Line Holding Holding 2 2 2 Interrupt Status Register Register Interrupt 32h FIFO Control Register FCR RCVR RCVR TX TX XMIT RCVR FIFO CERERE MSB LSB Select 43h Line Control Register r LCR ea Latch Break Parity Parity Enable
14. F amp elT Series Isolated RS 422A 485 Ich Communication Module COM 1PD FIT GY User s Manual CONTEC CO LTD Check Your Package Thank you for purchasing the CONTEC product The product consists of the items listed below Check with the following list that your package is complete If you discover damaged or missing items contact your retailer Product Configuration List Module COM IPD FIT GY 1 User s Manual this booklet 1 User s Manual User s Manual CONTEC COM IPD FIT GY i Copyright Copyright 2003 CONTEC CO LTD ALL RIGHTS RESERVED No part of this document may be copied or reproduced in any form by any means without prior written consent of CONTEC CO LTD CONTEC CO LTD makes no commitment to update or keep current the information contained in this document The information in this document is subject to change without notice All relevant issues have been considered in the preparation of this document Should you notice an omission or any questionable item in this document please feel free to notify CONTEC CO LTD Regardless of the foregoing statement CONTEC assumes no responsibility for any errors that may appear in this document nor for results obtained by the user as a result of using this product Trademarks F amp elT is a registered trademark or trademark of CONTEC CO LTD Other company and product names that are referred to in this manual are generally tr
15. Please read this manual carefully to create application programs and configure the system such as setting the switches and connecting it to external devices Features RS 422A 485 serial communication ports The communication lines for each channel are electrically isolated from each other and from the module Baud rates can be selected from 50 to 921 600 bps by means of software For each channel a separate baud rate can be specified A baud rate can be set for each channel by software Each channel is equipped with separate 128 byte FIFO buffers for transmit and receive Driver software is supplied to allow the serial ports to be used as standard Windows or Linux COM ports The data transfer mode full duplex or half duplex can be set by a switch The board includes a 100Q terminating resistor required for multi drop party line connections The resistor for each channel can be inserted into the signal line by a switch Surge protection is provided for each RS 422A 485 signal line Similar to other F amp elT series products the system in the module itself incorporates a 35 mm DIN rail mounting mechanism as a standard item A connection to a controller module can be effected on a lateral stack basis in a unique configuration which permits a simple smart system configuration without the need for a backplane board CONTEC COM IPD FIT GY 1 1 Before Using the Product Customer Support CONTEC provi
16. Registers Output port Reserved D7 D6toD2 D1 DO Starting 1 0 adores 1F ze Clock selection see setting a Baud Rate 00 Clock 0 mode 1 8432MH z 01 Clock 0 mode 3 6864MH z 10 Clock 0 mode 7 3728M H z 11 Clock 0 mode 14 7456MHz Fixed at 0 Input port Starting 1 0 D7 D6toD1 DO address Reserved 1Fh CHO interrupt see U sing an Interrupt 0 Interrupt detected 1 Nointerrupts Fixed at 0 Figure 5 10 Interrupt Vector Registers CONTEC COM IPD FIT GY 25 5 Using the Module Using an Interrupt Compatible Mode When the Module is operated in the compatible mode channel CHO is assigned to standard I O addresses COM3 and COMA respectively The interrupt levels will be IRQ5 for COMG and IRQ7 for COMA Enhanced Mode When the Module is being used in enhanced mode interrupt generation can be checked with the interrupt vector register IVR The Device ID switch is used to specify the interrupt line to be used When accepting an interrupt you can check by reading the IVR whether the interrupt has been generated within the interrupt service routine Before exiting from the executed interrupt service read the IVR again to check for any pending interrupt The XR16C2850 contains an internal register to enable itself for interrupts make them available or to check whether any interrupt has been generated For using the register refer to the data sheet for t
17. a CHO LSR DO Bit 1 Yes Receive CHO data Final data Show data n End 28 CONTEC COM IPD FIT GY 5 Using the Module Sample Program Sample program 1 UNITO lt gt UNITI Loop Test UNIT No 0 1 DEVICE ID 0 2 Mode Compatible Mode Channel 0 03E8H COM3 02E8H COM4 Baud Rate 115 200 bps Interrupt N A include lt stdio h gt include lt conio h gt Rass Constant nn e rr x define CH 2 no of channels define NUM 10 data of total number define BPS 1 baud rate unsigned char rbuf CH NUM receive buffer unsigned int ADR CH 0x3e8 0x2e8 I O address unsigned int rcnt CH 0 0 receive count fea Prototype Sa SS ee m void main void ER Main mr eee eee void main void unsigned char E33 int dummy for i 0 i CH i RS 232C initialize outp ADR i 0x3 0x80 Line Control Register DLAB SET outp ADR i 0x0 BPS amp Oxff Divisor Latch Baud Rate SET outp ADR i 0x1 BPS gt gt 8 amp Oxff outp ADR i 0x3 0x0 Line Control Register DLAB RESET outp ADR i 0x3 0x7 Line Control Register Bit 0 1 Word Length 8 bit J C BEE 2 125 2 stop bit for j 0 j lt 10 j hardware wait dummy inp Ox2ef outp ADR i 0x4 0x3 MODEM Control Register DTR RTS dummy in
18. ademarks or registered trade trademark Q CONTEC ii COM IPD FIT GY Table of Contents Check Yo r Package scasescsscicssssescascacatessccessscescecesccseisseesscsdscadascensscensscevdaceracuccudeteues caves ceveuceudcendaceneaceteadsveces i COPY DE ii Trademarks all 1 1 BEFORE USING THE PRODUCT 1 About the Module Features Customer Support WEED SIE Limited One Year Warranty HOW LO ODIAS CIVIC ORNINA EN PDT RTT S DRESS SENSERI ra MEE BG B B BG 2 Safety UCET 3 Safety Infortnation i icieeeeiiniiciseteeeeenici ecd e elei detiene een eee eee ee e eU Handling Precautions ENVIFONMENt ROVER UU NA TREE REESE Inspection cdi liti i ilii i i eiii as e deg 5 Cj C DTE 5 DIL 5 2 MODULE NOMENCLATURE AND SETTINGS 7 Nomenclature of Module Components iii 7 Set ng a Device ID 5 RR AAA EAEE OEEO EEEE ERROR RERER ERE 8 Setup Method M 8 Setting Transmission MOde a aaea liacle 9 Nrannpqvilcsnncrui d M 10 TEED IMAC ALOT HERR RR E REA 11 Intertace ConnectoE 5a dM RITIRATI 13 How to Connect an Interface Connector i 13 Types of Cable and Example Connections 14 Communication Function tette teen tete nnt nennt tntne tenete eni
19. and from the PC This isolation prevents electrical disturbances from occurring between the Module and the external circuitry The Module can therefore be used comfortably even when line noise can be easily generated to seemingly cause the Module to malfunction or break Surge Protection As surge protection is provided on all RS 422A 485 control lines you can safely use the modules in environments where you are concerned about surges causing incorrect operation or damage to the PC CONTEC 18 COM IPD FIT GY 5 Using the Module 5 Using the Module Compatible and Enhanced Modes The COM 1PD FIT GY can operate in two modes the compatible mode in which the COM IPD FIT GY when connected to a CPU SBxx FIT GY acts as a standard serial port and the enhanced mode in which the COM 1PD FIT GY operates under CONTEC s unique control method Before building a system using the COM 1PD FIT GY a working understanding of the features of these modes may be in order Compatible Mode The COM 1PD FIT GY can use two channels as standard serial ports COM 1PD FIT GY can be assigned to COM3 or COM4 The module uses the I O addresses assigned for a standard serial port As the module is handled as the standard serial port it can run under other driver software that can operate standard serial ports Although OS dependent the I O addresses in the COM 1PD FIT GY can be recognized by the system and used as standard ports You can use these ad
20. des the following support services for you to use CONTEC products more efficiently and comfortably Web Site Japanese _http www contec co jp English http www contec com Chinese http www contec com cn Latest product information CONTEC provides up to date information on products CONTEC also provides product manuals and various technical documents in the PDF Free download You can download updated driver software and differential files as well as sample programs available in several languages Note For product information Contact your retailer if you have any technical question about a CONTEC product or need its price delivery time or estimate information Limited One Year Warranty CONTEC Interface modules are warranted by CONTEC CO LTD to be free from defects in material and workmanship for up to one year from the date of purchase by the original purchaser Repair will be free of charge only when this device is returned freight prepaid with a copy of the original invoice and a Return Merchandise Authorization to the distributor or the CONTEC group office from which it was purchased This warranty is not applicable for scratches or normal wear but only for the electronic circuitry and original modules The warranty is not applicable if the device has been tampered with or damaged through abuse mistreatment neglect or unreasonable use or if the original invoice is not included in which case repairs will be cons
21. dressed by checking the system settings Enhanced Mode The enhanced mode operates the COM 1PD FIT GY by using CONTEC s unique control method For I O addresses CONTEC designated addresses must be used Notice that the enhanced mode requires different programming than the compatible mode Table 5 1 I O Address e o cows fosestooser mos jEnhancedmode olAotoo147 firas e Enhanced mode _ ozaotooza7 imos s Enhanced mode _ 9800to9807 firas 9 Enhanced mode 9820t09827 iROS Enhanced mode o860to9867 Not Used Reserved D Reserved Reserved Reserve CONTEC COM IPD FIT GY 19 5 Using the Module I O Ports and Registers The module uses the XR16C2850 Exar Corporation upward compatible with the 16550 UART For details on the internal registers of the XR16C2850 and its control refer to the XR16C2850 data sheet In enhanced mode starting I O address 1Fh is used as an interrupt vector register I O Ports Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 0h 1h 42h 43h 4h 45h 46h 7h 1Fh Interrupt vector register Channel 0 register Figure 5 1 I O Ports N CAUTION Each port must be accessed in bytes to conform to device specifications Non byte access to any port is not allowed such as word access or doubleword access CONTEG 20 COM IPD FIT GY 5 Using the Module Details on I O Ports and Registers Th
22. e XR16C2850 s internal registers are port mapped differently depending on the value set in the Line Control Register LCR The General Registers are enabled at startup or with LCR bit 7 0 and LCR other than OxBF The Baud Rate Registers are enabled with LCR bit 7 1 The Enhanced Registers are enabled with LCR OxBF Input port 1 General Registers Starting 1 0 D7 D6 D5 D4 D3 D2 D1 DO address 40h Receive Holding Register RHR 1h Interrupt Enable Register IER CTS RTS Xoff MODEM Receive Transmit Receive Interrupt Interrupt Interrupt Status Line Holding Holding 2 2 2 Interrupt Status Register Register Interrupt 42h Interrupt Status Register ISR FIFOs FIFOs RTS Xoff Int Int Int Int Enable Enable CTS Priority Priority Priority Status Bit 2 Bit 1 Bit 0 43h Line Control Register LCR Divisor Even Parity Stop Latch oe Li Parity Enable Bits Enable 4h Modem Control Register MCR Clock OP2 and Out 1 RTS DTR Prescaler ius INT O INT Select 2 Enable Enable 2 LINT Disable 1 35h Line Status Register LSR FIFO THR amp THR Break Framing Parity Overrun Receive Error TSR Empty Interrupt Error Error Error Data Empt Read 36h Modem Status Register MSR 7h Scratch Pad Register SPR 7h FIFO Level Counter FLVL 3 ose Ml 1 For details see the Using an Interrupt section 2 These bits are enabled with EFR bit 4 1 3 These registers are enabled with FCTR bit 6 1 Figure
23. erator error register 96 register 96 register 96 register 96 2 57600 4 28800 57600 5 23040 46080 8 14400 28800 57600 15 7680 15360 30720 61440 50 2304 4608 9216 18432 75 1536 3072 6144 12288 110 1047 0 026 2094 0 026 4189 0 0022 8378 0 0022 134 5 857 0 058 1713 0 0006 3426 0 0006 6852 0 0006 150 768 1536 3072 6144 300 384 768 1536 3072 600 192 384 768 1536 1200 96 192 384 768 1800 64 128 256 512 2000 58 0 68 115 0 17 230 0 17 461 0 04 2400 48 96 192 384 3600 32 64 128 256 4800 24 48 96 192 7200 16 32 64 128 9600 12 24 48 96 14400 8 16 32 64 19200 6 12 24 48 28800 4 8 16 32 38400 3 6 12 24 57600 2 4 8 16 76800 3 6 12 115200 1 2 4 8 153600 3 6 230400 1 2 4 460800 1 2 921600 1 CONTEC COM 1PD FIT GY 17 4 Functions Automatic RTS Control Functions This function applies to half duplex mode communications As half duplex means that the same line is used for sending and receiving the RTS and CTS signals are used to switch between sending and receiving Normally RTS is set by writing to the corresponding register bit but on this module it is controlled by hardware This reduces the load on the CPU Other Functions Bus Isolation The communication lines are electrically isolated from each other
24. he XR16C2850 supplied by Exar Corporation For setting to use interrupts use the D2 bit in the modem control register MCR D2 bit of MCR Write 0 Enable when the power is turned on Write 1 Disable CONTEG 26 COM IPD FIT GY 5 Using the Module Examples Following is a COM 1PD FIT GY sample program The sample program executes transmission and reception between two COM IPD FIT GY units To connect RTS and CTS to an external device in full duplex mode use a connection cable as illustrated below Code Pin Pin Code SG 5 5 SG TxD 2 7 RxD TxD 1 6 RxD RxD 7 2 TxD RxD 6 1 TxD RTS 4 8 CTS RTS 3 9 CTS CTS 8 4 RTS CTS 9 3 RTS 1st set CHO 2nd set CH 1 Figure 5 11 Cable Connection Diagram CONTEC COM IPD FIT GY 27 5 Using the Module Compatible Mode Flowchart Start I Set Baud Rate Generator Set transmissi on format WAIT time Set modem control output Line status register dummy READ RECEIVE register dummy READ Interrupt I D register dummy READ Modem status register dummy READ Final channel 1 Yes Send CHO data m CH1LSR DO Bit 1 Yes Receive CH1 data Final data Show data lt CH1 LSR DINNO Bit 1 Yes Send CH1 dat
25. idered beyond the warranty policy How to Obtain Service For replacement or repair return the device freight prepaid with a copy of the original invoice Please obtain a Return Merchandise Authorization Number RMA from the CONTEC group office where you purchased before returning any product No product will be accepted by CONTEC group without the RMA number Liability The obligation of the warrantor is solely to repair or replace the product In no event will the warrantor be liable for any incidental or consequential damages due to such defect or consequences that arise from inexperienced usage misuse or malfunction of this device Q CONTEC 2 COM IPD FIT GY 1 Before Using the Product Safety Precautions Understand the following definitions and precautions to use the product safely Safety Information This document provides safety information using the following symbols to prevent accidents resulting in injury or death and the destruction of equipment and resources Understand the meanings of these labels to operate the equipment safely A DANGER DANGER indicates an imminently hazardous situation which if not avoided will result in death or serious injury A WARNING WARNING indicates a potentially hazardous situation which if not avoided could result in death or serious injury A CAUTION CAUTION indicates a potentially hazardous situation which if not avoided may result in minor or moderate injury or
26. n please do not touch the metallic pins on the external module connector The module contains switches that need to be properly set Before using the module please check its switch settings To avoid malfunction please do not change the module switch settings in an unauthorized manner Do not operate the device module when the power for the Controller Module is on To avoid malfunction please be sure to turn off the power for the Controller Module CONTEC 4 COM IPD FIT GY 1 Before Using the Product Environment Use this product in the following environment If used in an unauthorized environment the module may overheat malfunction or cause a failure Operating temperature 0 to 50 C Humidity 10 to 90 RH No condensation Corrosive gases None Floating dust particles Not to be excessive Inspection Inspect the product periodically as follows to use it safely The ventilation slits are not covered and neither dust nor alien substance is attached to the ventilation slits ll Storage When storing this product keep it in its original packing form 1 Put the module in the storage bag 2 Wrap it in the packing material then put it in the box 3 Store the package at room temperature at a place free from direct sunlight moisture shock vibration magnetism and static electricity Disposal When disposing of the product
27. n One touch connection to 35mm DIN rails Theseitems can be set by software 2 Data transmission at high speed may not be performed normally depending on the environment induding the type of status of connected material of cable and environment 3 Thetable below lists an example of the relationship between baud rate and communication distance Communication Baud rate distance 300m 115 200bps 57 600bps 19 200bps 1200m 9 600bps Communication cable 28AWG double shielded cable twisted pairs used for each signal line A CAUTION When connecting the module to a controller module the internal power consumption should be taken into account If the total current exceeds the capacity of the power supply unit the integrity of the operation cannot be guaranteed For further details please see the Controller Module manual CONTEC COM IPD FIT GY 37 6 System Reference Table 6 2 Installation Environment Requirements Requirement description Operating temperature 0 to 50 C Storage temperature 10 to 60 C 10 to 90 No condensation Floating dust particles Not to be excessive Corrosive gases None External Dimensions 12 TODO oe Don TO 1 2 35 0 Tao Urri Urri 94 0 45 0
28. n register setting value Ex 460800 9600bps 48 As the result is an integer this baud rate can be set 460800 128000bps 3 6 As the result contains a fractional part this baud rate cannot be set Clock 1 mode 230400 Desired baud rate Division register setting value Ex 230400 9600bps 24 As the result is an integer this baud rate can be set 230400 128000bps 1 8 As the result contains a fractional part this baud rate cannot be set Clock 0 mode 115200 Desired baud rate Division register setting value Ex 115200 9600bps 12 As the result is an integer this baud rate can be set 115200 76800bps 1 5 As the result contains a fractional part this baud rate cannot be set A CAUTION See Chapter 5 Interrupt Vector Registers for selecting the clock frequency 1 8432 3 6864 7 3728 or 14 7456 MHz For use in compatible mode clock 0 1 8432 MHZ is used as a fixed setting CONTEC 16 COM IPD FIT GY 4 Functions Refer tothe following baud rate setting examples Baud rates other than those listed below can also be set if they produce a valid setting valuein the equation described above Table4 1 Baud Rate Generator Programming Table Clock 0 mode Clock 0 mode Clock 0 mode Clock 0 mode 1 8432M Hz 3 6864M Hz 7 3728M Hz 14 7456M Hz icon BaudRate Setup BaudRate Setup BaudRate Setup BaudRate Setup Generator error Generator error Generator error Gen
29. p ADR i 0x5 Line Status Register Dummy Read dummy inp ADR i 0x0 Receiver Buffer Register Dummy Read dummy inp ADR i 0x2 Interrupt ID Register Dummy Read dummy inp ADR i 0x6 Modem Status Register Dummy Read outp ADR i 0x1 0x1 Interrupt Enable Register for j 0 j lt NUM j send CHO to CH1 while inp ADR 0 0x5 amp 0x20 transmitter empty outp ADR 0 0x0 j while inp ADR 1 0x5 amp 0x1 data ready rbuf 1 rent 1 unsigned char inp ADR 1 0x0 rent 1 CONTEG COM IPD FIT GY 29 5 Using the Module for j 0 j lt NUM j printf CH0 02x gt CH1 02x Ys Jy xbutpT TITY if rbuf 1 j j printf Verify Error Mn verify data else printf Mn printf Nn for j 0 j lt NUM j send CH1 to CHO while inp ADR 1 0x5 amp 0x20 transmitter empty outp ADR 1 0x0 j while inp ADR 0 0x5 amp 0x1 data ready rbuf 0 rcnt 0 unsigned char inp ADR 0 0x0 rent 0 for j 0 j lt NUM j printf CH1 02x gt CH0 02x Mr dporbutqQ0 l3 y if rbuf 0 j j printf Verify Error Mn verify data else printf Mn D ira c A C RECEN ERE End of file Q CONTEC 30 COM IPD FIT GY Enhanced Mode Flowchart Start Initialize Change interrupt vectors
30. terImr original IMR unsigned char IntVector 2 0x0d Ox0f interruput vector unsigned char PicMask 2 Oxdf Ox7f mask bit unsigned char IsrClear 3 0x65 0x67 0x61 ISR clear T9 Prototype cce ee esi sedie i esi iue ee dese cadit cioe sta void main void void Initialize void initialize void ChgVect void change vector void ResVect void restore vector void interrupt far inthandler void interrupt handler void interrupt far OrgVect 0 original vector SX esa Inatlalizar __ _ _ __o eTe ee af void Initialize void unsigned int i j int dummy for i 0 i CH it outp ADR i 0x3 0x80 Line Control Register DLAB SET outp ADR i 0x0 BPS amp Oxff Divisor Latch Baud Rate SET outp ADR i 0x1 BPS gt gt 8 amp Oxff outp ADR i 0x3 0x0 Line Control Register DLAB RESET outp ADR i 0x3 0x7 Line Control Register eC BLE 0 1 Word Length 8 bit KBE 2 wis 2 stop bit for j 0 j lt 10 j hardware wait dummy inp 0x2ef Q CONTEC 32 COM IPD FIT GY 5 Using the Module outp ADR i 0x4 0x3 MODEM Control Register DTR RTS dummy inp ADR i 0x5 Line Status Register Dummy Read dummy inp ADR i 0x0 Receiver Buffer Register Dummy Read dummy inp ADR i 0x2 Interrupt ID Register Dumm
31. tn tne te tne te teen tnter eterne 15 Serial Data Transmission PH EST RS 422A 485 Control Lines ii 15 Send and Receive Data Buffers eS SRERRSIISEEII RII INERENTI 15 Serino theiBaud Rate 2 endete RR ERO ede 16 Automatic RTS Control Functions essere entente tnter ennt tenete nne nennene 18 CONTEC COM IPD FIT GY iii Other FUNCOMS ere EE AIESEC AECE TERT ENEE RIEN NER ERREUR EN NERERUR 18 Bus Isolation SHE giro rre do REPRE TEPATE PETI NC 18 5 USING THE MODULE 19 Compatible and Enhanced Modes i 19 Details n I O Ports and ReglSters er iO 21 Interrupt Vector Registers Usine am Interr pt eeeeecetcee eee eee HARI HEIR RR Xam ples c Raie 27 Compatible MOodes ose RERBA EE 28 Enhanced Mode vies 31 6 SYSTEM REFERENCE 35 Block Diagram 332 rideo BGB RR 36 Seem 37 External Dimensions eese nenenenenenetetntnene nete tenenetnen treten tete nenn ener nene 38 Q CONTEC COM IPD FIT GY 1 Before Using the Product 1 Before Using the Product This chapter provides information you should know before using the product About the Module The COM 1PD FIT GY performs serial communication with an external device in compliance with RS 422A 485 capable of serving as COM3 or COMA of an F amp elT series microcontroller module CPU SBxx FIT GY
32. to9807 firas s820t098227 sings B os60to9867 Notusa c Reserved Reserved p Reserved Reserved CONTEC 8 COM IPD FIT GY 2 Module Nomenclature and Settings Setting Transmission Mode The data transfer mode setting switch is used to switch between full duplex and half duplex and to specify whether to use RTS CTS in full duplex mode Set the appropriate data transfer mode for the device with which you are communicating Bits 1 to 5 are used to set the data transfer mode Always set bit 6 is to OFF Setting Procedure Table2 2 Setting Transmission Mode Full duplex Full Transmissi on Half el When there are no Ha RTS and CTS When there are RTS and CTS RTS RIS CTS 4 CTS4 S8 S Ss o o o oo oo oo Setting rs rs __ Factory Blo Ho Wo setting E n Ho Ho B Es Bs m Ho Ho i N LI N N Z per H E TXD is only used for data With above setting RTS and To connect RTS and CTS to transmission the sending CTS are connected in the the other unit and receiving modes should board communication is available be switched over using Communication is available the modem control without wiring of RTS and register CTS N CAUTION Do not use with bits 1 and 2 both set ON as this may result in damage to the module
33. y Read dummy inp ADR i 0x6 Modem Status Register Dummy Read outp ADR i 0x1 0x1 Interrupt Enable Register outp ADR 0 0x1f 0x80 Select Clock Mode means change Vector Sasa Sasa ae Sas esse Se Se sea void ChgVect void OrgVect dos getvect IntVector IRQ5 OrgVect dos getvect IntVector IRQ7 _disable _dos_setvect IntVector IRQ5 inthandler _dos_setvect IntVector IRQ7 inthandler outp 0x21 OrgMasterImr inp 0x21 amp PicMask IRQ5 amp PicMask IRQ7 outp 0x20 IsrClear IRQ5 ISR clear outp 0x20 IsrClear IRQ7 ISR clear _enable enable y eene testore VecLor SHH Sse eS a eS Se RS SRS RRS a Re Sa aoe A void ResVect void _disable disable outp 0x21 OrgMasterImr _dos_setvect IntVector IRQ5 OrgVect restore orgvect dos setvect IntVector IRO7 OrgVect restore orgvect _enable enable sar interrupt handler void _interrupt far inthandler void unsigned char sts0 stsl _enable enable do sts0 unsigned char inp ADR 0 0x1f Int Vector Register if stsO amp 0x1 CHO status while inp ADR 0 0x05 amp 0x1 rbuf 0 intcnt 0 unsigned char inp ADR 0 0x0 intent 0 count times of an interrupt while sts0 amp Oxf do stsl unsigned

Download Pdf Manuals

image

Related Search

Related Contents

使用ーこついて 構成  Manual - Penguin Computing  Piano di sicurezza D. Lgs. n. 81 2008 agg  穿刺部止血デバイスに関する 使用上の注意について  CENTRAL SOUND U-1510  TriStar  WA100-7 - コマツ建機販売    Anleitungsbuch BT Compact 1500-P gesamt d,f,i.qxd  CICATRAL POMADA CICATRIZANTE Bacteriostática  

Copyright © All rights reserved.
Failed to retrieve file