home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / KAYPRO / KAYINFO.LBR / RS-232.DOC < prev   
Text File  |  2000-06-30  |  11KB  |  253 lines

  1.  
  2.  
  3.                        RS-232C INTERFACING
  4.  
  5.  
  6.      RS-232├á i≤ thσ mos⌠ recen⌠ versioε oµ thσ EI┴á (Electronic≤ ì
  7. Industr∙áá Association⌐á standarΣá fo≥á lo≈á speeΣá seria∞áá datß ì
  8. communication«á  I⌠á define≤á ß numbe≥ oµá parameter≤á concerninτ ì
  9. voltagσ levels¼ loadinτ characteristic≤ anΣ timinτ relationships«  ì
  10. Typica∞á practicσ require≤ mountinτ femalσ connector≤ (DB-25S⌐ oε ì
  11. thσá chassi≤ oµ thσ communication≤ equipment¼á anΣ malσá (DB-25P⌐ ì
  12. connector≤ oε thσ cablσ connectinτ tw∩ sucΦ devices.
  13.  
  14.      Therσá arσ tw∩ maiε classe≤ oµ RS-232├á devices¼á DT┼á (Datß ì
  15. Termina∞á Equipment⌐á anΣá DC┼ (Datßá Communication≤á Equipment)«  ì
  16. Terminal≤ arσ typica∞ DTE's¼ anΣ DCE'≤ ma∙ bσ printer≤ o≥ modems« ì
  17. Typically¼á onσ onl∙ interface≤ ß DT┼ t∩ ß DCE¼ a≤ opposeΣ t∩ onσ ì
  18. DT┼ t∩ anothe≥ DTE¼ o≥ onσ DC┼ t∩ anothe≥ DCE«  Therσ arσ way≤ oµ ì
  19. interfacinτ tw∩ likσ device≤ b∙ buildinτ ß non-standarΣ cable«  Iµ ì
  20. onσ oµ thσ device≤ involveΣ i≤ ß modem¼á thσ 'hand-shakingºá line≤ ì
  21. mus⌠ bσ supported«  Thesσ lines ma∙ bσ useΣ t∩ allo≈ thσ receivinτ ì
  22. devicσá t∩á causσá thσá transmittinτ devicσ t∩á pausσá whilσá thσ ì
  23. receivinτ devicσ catche≤ up.
  24.  
  25.      RS-232├ i≤ intendeΣ fo≥ relativel∙ shor⌠ (5░ fee⌠ o≥á less)¼ ì
  26. relativel∙á lo≈á speΣ (19,20░ bits/seconΣ o≥ les≤ (BAUD)⌐á seria∞ ì
  27. communication«á  BotΦá asynchronou≤ anΣ synchronou≤ seria∞á encodinτ ì
  28. arσ supported¼á anΣ Digita∞ signal≤ arσ useΣ a≤ opposeΣ t∩á Analoτ ì
  29. signals«á  RS-232├á wil∞ suppor⌠ simplex¼á half-duplex¼á o≥ full-duplexì
  30. channels.
  31.  
  32.      ┴á Simple° channe∞ mean≤ tha⌠ communicatioε i≤ onσá way«á  Aε ì
  33. examplσá woulΣá bσá ß receivσá onl∙á Printer«á  Iεá ßá half-duple° ì
  34. channel¼á datßá ma∙ trave∞ iε eithe≥ direction¼á bu⌠ a⌠ an∙á giveε ì
  35. timσ datß wil∞ onl∙ bσ travellinτ iε onσ direction«  Thσ linσ mus⌠ ì
  36. bσá turneΣ arounΣ beforσ datß caε trave∞ iε thσ othe≥á direction«  ì
  37. Iεá ßá full-duple°á channel¼á datß ma∙ trave∞ iεá botΦá direction≤ ì
  38. simultaneously.
  39.  
  40.      Therσ arσ twent∙ fivσ circuit≤ whicΦ makσ u≡ thσá interface«  ì
  41. Iε thσ simples⌠ case¼á aε interfacσ ma∙ bσ implementeΣ witΦ a≤ fe≈ ì
  42. a≤á tw∩á circuits«á  ┴ circui⌠ i≤ defineΣ t∩ bσ ß continuou≤á wirσ ì
  43. froφ onσ devicσ t∩ another.
  44.  
  45.              DEFINITION OF THE MOST COMMON CIRCUITS
  46.  
  47.  1.   CG    Chassis Ground
  48.       This circuit is Frame Ground and insures that the two
  49.       devices are at the same potential, to prevent electrical
  50.       shock to the operator.  This circuit is optional and is
  51.       not used as the reference for any other circuit.
  52.  
  53.  
  54.  
  55. è 2.   TD    Transmit Data
  56.       This circuit is the path whereby serial data is sent from
  57.       the DTE to DCE.  This circuit must be present if data is
  58.       to travel in that direction.
  59.  
  60.  3.   RD    Receive Data
  61.       This circuit is the path whereby serial data is sent from
  62.       the DCE to DTE.  This circuit must be present if data is
  63.       to travel in that direction.
  64.  
  65.  4.   RTS   Request To Send
  66.       This circuit is the signal that indicates that the DTE
  67.       wishes to send data to the DCE.  Note that the DTE must
  68.       always be ready to accept data.  Once the DTE has data 
  69.       to send it will set RTS to ON (logic 0), and wait for an
  70.       on condition on CTS from the DCE.  After sending the
  71.       data the DTE will set RTS to OFF (logic 1).
  72.  
  73.  5.   CTS   Clear To Send
  74.       This circuit is the signal that indicates that the DCE
  75.       is ready to accept data from the DTE.  In normal
  76.       operation it will be in the OFF state.  When the DTE
  77.       asserts RTS, the DCE will do whatever is necessary to
  78.       allow the data to be sent.  At this time the DCE would
  79.       set CTS to the ON state, which would allow the DTE to
  80.       send the data.  Note that the DTE must have an incoming
  81.       CTS before it can transmit.
  82.  
  83.  6.   DSR   Data Set Ready
  84.       This circuit informs the DTE that the DCE is alive and
  85.       well.  It is normally set to the ON state by the DCE
  86.       on power-up and left there.  The DTE must have an
  87.       incoming DSR in order to function normally.
  88.  
  89.  7.   SG    Signal Ground
  90.       This circuit is the neutral to which all other voltages
  91.       are referenced.  It must be present at all times.  (It
  92.       is the common line for all DC voltages.)
  93.  
  94.  8.   DCD   Data Carrier Detect
  95.       This circuit is the signal whereby the DCE informs the
  96.       DTE that it has an incoming carrier.  It may be used by
  97.       the DTE to determine if the channel is idle, so that
  98.       the DTE can request it with RTS.  Note that some DTE's
  99.       must have DCD before they will operate.
  100.  
  101. 15.   TC    Transmit Clock
  102.       This circuit provides the clock for the transmitter
  103.       section of a synchronous DTE.  It may or may not be
  104.       running at the same rate as the receiver clock, and
  105.       must be present on synchronous interfaces.
  106.  
  107. 17.   RC    Receiver Clock
  108.       This circuit provides the clock for the receiver
  109.       section of a synchronous DTE.  It may or may not be
  110.       running at the same rate as the transmitter clock,è      and must be present on synchronous interfaces.  Note
  111.       that both RC and TC are sourced by the DCE.
  112.  
  113. 20.   DTR   Data Terminal Ready
  114.       This circuit provides the signal that informs the DCE
  115.       that the DTE is alive and well.  It is normally set to
  116.       the ON state by the DTE at power-up and left there.
  117.       Note that a typical DCE must have an incoming DTR before
  118.       it will function normally.
  119.  
  120.      Thσá followinτá tablσá list≤ al∞á thσá informatioεá fo≥á thσ ì
  121. variou≤ circuit≤ whicΦ makσ u≡ thσ RS-232├ interface.
  122.  
  123. PIN    NAME    EIA  CCITT    DTE    DCE      FUNCTION
  124.  1    CG    AA    101    ==    ==    Chassis Ground
  125.  2    TD    BA    103    >>        Transmit Data
  126.  3    RD    BB    104        <<    Receive Data
  127.  4    RTS    CA    105    >>        Request To Send
  128.  5    CTS    CB    106        <<    Clear To Send
  129.  6    DSR    CC    107        <<    Data Set Ready
  130.  7    SG    AB    102    ==    ==    Signal Ground
  131.  8    DCD    CF    109        <<    Data Carrier Detect
  132.  9*                    <<    Pos Test Voltage
  133. 10*                    <<    Neg Test Voltage
  134. 11                        Not Used (usually)
  135. 12+    SCDC    SCF    122        <<    Secondary DCD
  136. 13+    SCTS    SCB    121        <<    Secondary CTS
  137. 14+    STD    SBA    118    >>        Secondary TD
  138. 15#    TC    DB    114        <<    Transmit Clock
  139. 16+    SRD    SBB    119        <<    Secondary RD
  140. 17#    RC    DD    115        <<    Receive Clock
  141. 18                        Not used (usually)
  142. 19+    SRTS    SCA    120    >>        Secondary RTS
  143. 20    DTR    CD    108.2    >>        Data Terminal Ready
  144. 21*    SQ    CG    110        <<    Signal Quality
  145. 22    RI    CE    125        <<    Ring Indicator
  146. 23*        CH    111    >>        Data Rate Selector
  147.         CI    112        <<    Data Rate Selector
  148. 24*    XTC    DA    113    >>        Ext. TC
  149. 25*                >>        Busy
  150.  
  151.  
  152. *  Denotes rarely used
  153. +  Denotes only if secondary channel implemented
  154. #  Denotes only on synchronous interfaces
  155. >> Denotes from DTE to DCE
  156. << Denotes from DCE to DTE
  157. == Denotes Ground line
  158. CCIT╘á ╜á Internationa∞á TelegrapΦá anΣá Telephonσáá Consultativσ ì
  159. Committee
  160.  
  161.  
  162.                   TYPES OF DATA COMMUNICATIONS
  163.  
  164.      Therσá arσá tw∩á way≤ oµ sendinτ datßá serially«á  The∙á arσ ìèAsynchronou≤á anΣá Synchronous«áá  Asynchronou≤á seria∞áá involve≤ ì
  165. sendinτá informatioεá witΦ precisσ timinτ betweeε bit≤ oµ ßá giveε ì
  166. character¼ bu⌠ witΦ arbitraril∙ lonτ interval≤ betweeε characters«  ì
  167. Iε orde≥ t∩ allo≈ thi≤ variablσ lengtΦ interval¼ certaiε overheaΣ ì
  168. informatioε i≤ requireΣ oε eacΦ character«á  Normally¼á durinτá aε ì
  169. inter-characte≥á ga≡á thσ linσ i≤ a⌠ ß logiπ ▒ state«á  Wheεá thσ ì
  170. characte≥ starts¼ ß star⌠ bi⌠ (logiπ 0⌐ is alway≤ first«  Oncσ thσ ì
  171. star⌠á bi⌠á ha≤á occurreΣá thσá othe≥á datßá bit≤á follow¼áá leas⌠ ì
  172. significan⌠á bi⌠á first«á  Therσá arσ normall∙ ╖ o≥á ╕á datßá bit≤ ì
  173. followeΣ b∙ ß parit∙ bit«  Iµ runninτ witΦ "eveε parity"¼ thi≤ bi⌠ ì
  174. wil∞á bσá se⌠á o≥ rese⌠ t∩ makσ aε evσn numbe≥ oµá oµá datßá bits«  ì
  175. Followinτ thσ parit∙ bi⌠ (iµ used⌐ arσ ▒ o≥ ▓ "sto≡ bits"«  Thesσ ì
  176. sto≡ bit≤ arσ alway≤ ß logiπ ▒ anΣ simpl∙ insurσ tha⌠ thσ linσ i≤ ì
  177. idleá fo≥ onσ o≥ tw∩ bi⌠ time(s⌐ whilσ thσ hardwarσ re-cycle≤á fo≥ ì
  178. thσáá nex⌠áá star⌠áá bi⌠.  ┴áá UAR╘áá (Universa∞ááá Asynchronou≤ ì
  179. Receiver/Transmitter⌐á caε bσ useΣ t∩ conver⌠ paralle∞ t∩ o≥á froφ ì
  180. Asynchronou≤ seria∞ data.
  181.  
  182.      Synchronou≤ seria∞ involve≤ sendinτ character≤ no⌠ onl∙ witΦ ì
  183. precisσá timinτ betweeε bit≤ oµ ß giveε character¼á bu⌠ a⌠ regula≥ ì
  184. intervals«á  Datßá i≤á normall∙ seεt iε largσ block≤ witΦá n∩á ga≡ ì
  185. betweeεá characters«á  N∩ overheaΣ i≤ requireΣ oε eaπhá character¼ ì
  186. althougΦá parit∙á i≤á stil∞ sometime≤á used«á  Therσá i≤á certaiε ì
  187. informatioεá requireΣá a⌠á thσá star⌠á anΣá enΣá oµá eacΦáá block« ì
  188. Synchronou≤á datß transmission≤ a≥e normall∙ morσ intelligen⌠ thaε ì
  189. asynchronous¼á anΣá ma∙ reques⌠ re-transmissioε oµ block≤á receiveΣ ì
  190. witΦ errors.
  191.  
  192.                    ELECTRICAL CHARACTERISTICS
  193.  
  194.      Thσ character≤ transmitteΣ b∙ aε RS-23▓ devicσ arσ sen⌠á ou⌠ ì
  195. t∩á thσ I/╧ por⌠ ß thσ bauΣ ratσ selecteΣ b∙ interna∞ switche≤ o≥ ì
  196. software«á  Thσ characte≥ i≤ made u≡ oµ ╖ o≥ ╕ bit≤ a≤ defineΣá b∙ ì
  197. thσ appropriatσ codσ chart«  Fo≥ ASCI╔ characte≥ thσ capita∞ ┴ i≤ ì
  198. sen⌠á a≤á 4▒á hex«á  Thσ binar∙ codσ i≤ 010░ 000▒á witΦá ▒á beinτ ì
  199. the leas⌠á significan⌠á bit¼á anΣ thσ lef⌠ mos⌠ ░ beinτá thσá mos⌠ ì
  200. significan⌠á bit«á  Thσ followinτ diagraφ i≤ wha⌠ i≤ seeε a⌠á thσ ì
  201. outpu⌠ port«  Bi⌠ flo≈ i≤ froφ lef⌠ t∩ right.
  202.  
  203.   ----    --------------------    ----  stop  
  204.    S    1   0   0   0   0   0   1   0   bits  
  205.       ----                    ----    --------
  206.  
  207.  
  208. Logic 1 is low as shown.
  209. S Denotes start bit
  210.  
  211.  
  212.  
  213.  
  214.  
  215.                  NON-STANDARD WIRING CONNECTIONS
  216.  
  217.      Therσá arσ severa∞ way≤ oµ hookinτ tw∩ non-standarΣá RS-232├ ì
  218. device≤ together¼ bu⌠ thσ followinτ threσ arσ thσ mos⌠ common«  Iµ ìèonl∙á onσ wa∙ communicatioε i≤ requireΣ ß minimuφ oµ tw∩ wire≤á i≤ ì
  219. al∞á tha⌠á wil∞ bσ required«á  Al∞ handshakinτ condition≤á caεá bσ ì
  220. satisfieΣ b∙ loopinτ bacδ thσ appropriatσ signal≤ oε botΦ end≤ oµ ì
  221. thσá cablσá (seσá Nul∞ Modeφ diagraφ below)«á  Thσá threσá typica∞ ì
  222. connection≤ arσ nul∞ modem¼ n∩ handshake¼ anΣ ful∞ handshake«  Thσ ì
  223. followinτ diagram≤ sho≈ thσ necessar∙ wiring«á  Bσ carefu∞ t∩ notσ ì
  224. tha⌠ thσ manufacture≥ ma∙ wirσ thσ devicσ eithe≥ a≤ ß DT┼ o≥ DCE«  ì
  225. Consul⌠ thσ manua∞ fo≥ fina∞ verificatioε oµ pinouts.
  226.  
  227.  
  228.      NULL MODEM         NO HANDSHAKE        FULL HANDSHAKE
  229.  
  230.  
  231.      1********1          1********1           1********1
  232.      2--------3          2--------3           2--------3
  233.      3--------2          3--------2           3--------2
  234.      4-|    |-4          7--------7           4--------5
  235.      5-|    |-5          5-|    |-5           5--------4
  236.      7--------7          6-|    |-6           7--------7
  237.      6-|    |-6          8-|    |-8           6------|-8
  238.      8-|    |-8         20-|    |-20                 |-20
  239.     20-|    |-20                              8-|------6
  240.                                              20-|
  241.  
  242.  
  243. NOTE: Pin 1 is optional for Chassis Ground between Terminals.
  244.  
  245.  
  246. This information furnished for all computer users.  I have spent 
  247. many hours to find the above information the hard way.
  248.  
  249. LARRY KRAEMER
  250. R 2 BOX 190
  251. JACKSON, MO.  63755
  252.  
  253.