Chapter III The Digital Interface 3.1 Control Signals When two people meet on the street, they greet each other in one of many common forms and set about talking to each in such a way that is usually orderly. "John, Hi, How ar you doing ?" " Hi Tim, I am doing great. How about you ?" When to military radio operators engage in communication they use the words Over and Out as a way of letting the other know when their transmission is completed so the other may transmit. If both attempted to transmit simultaneously over the same frequency, their message would be garbled. Data Communications is no different. An orderly process is required to insure that data is received when the receiving station is ready for it. The Computer has to be sure the transmitting modem, telephone line and receiving modem are all ready before attempting a transmission. To insure that all parties involved are ready to exchange data, we have a number of control signals at the computer-modem interface whose condition can permit or deny data exchange. The use of these control signals is sometimes referred to as "hand shaking" (see paragraph one of this page) Since we have not yet covered what happens on the Analog side of the modem, some of the explanation of our control signals will be presented in a simplified format. When we cover the "line side" of the modem, these control signals will become more important. Different modem manufacturers use different designation to represent control signals. I am presenting the proper designation followed by alternative designations where some exist. DTR - Data Terminal Ready - The Computer is telling the modem that it is powered on, the software is loaded and it is ready to communicate. DSR - Data Set Ready - MR - Modem Ready - The local modem is telling the computer that it is powered on and is ready to exchange data. DCD - Data Carrier Detected - CD - Carrier Detected - An indication that the remote modem is on line and is ready to exchange data. (the precence of carrier does NOT imply that the carrier has data in it) This signal is provided TO the computer FROM the LOCAL modem OH - OFF Hook - The Modem tells the computer that it has seized the line (as if you took the telephone handset off hook) AA - Auto Answer - Is used to indicate that the modem has auto matically answered an incoming call. It is also sometimes used to indicate that the automatic answer feature in the modem has been activated. This signal is provided by the modem to the computer. RI - RING INDICATOR - The modem senses ringing on the line. These will do for starters. Lets take a look at them in sequence of probable occurrence. On the interface between the computer and the modem, are logic signals that represent these control signals. Typically, when the signal is low (ground or Negative Voltage) the signal is in the OFF state. If the voltage is a positive voltage, the signal is said to be on. Lets take a look at the control signals I mentioned. In the manual communications mode we are use to, the signals may turn from OFF to ON in the following sequence. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Data Terminal Ready³ ÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Modem Ready ³ ÄÄÄÄÄÄÙ ÚÄÄ¿ Ring Indication ³ ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Auto Answer ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Off Hook ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Carrier Detected ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ In a world of communication we are NOT use to, where the word Hayes commands No recognition, where mainframes call or are called by remote batch sites, unattended, the controls may look more like this. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Auto Answer Enabled³ ÄÄÄÄÄÄÙ ÚÄÄ¿ ÚÄÄÄ¿ Ring Indication ³ ³ ³ ³ ÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Data Terminal Ready ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ OFF HOOK ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Data Set Ready ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Carrier Detected ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Whichever is in use, it is important to know that Modems Need DTR from the computer to permit Data Exchange and the Computer needs DSR from the Modem before it will begin exchanging Data. There are excpetions to this rule (there are exceptions to every rule) but for now we will not dwell on these. It is the relationship and who is telling who what, that is important with these control signals. RTS - RS - Request to Send - The computer is ASKING the modem if it is OK to start transmitting data CTS - CS - Clear to Send - The modem tells the computer, go ahead and start sending your data TD - SD - Transmit (send) Data - Data sent from the computer to the modem for transmission. RD - Receive (Data) - Data received by the modem from the remote modem and is provided to the computer. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Request To Send ³ ÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Clear To Send ³ ÄÄÄÄÄÄÄÄÙ ÚÄ¿ ÚÄÄÄÄÄ¿ ÚÄ¿ ÚÄ¿ Transmit Data ³ ³ ³ ³ ³ ³ ³ ³ ÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÙ ÀÄÙ ÀÄÄÄÄÄÙ ÀÄÄÄ It is ONLY after the modem responds with CTS to the computers RTS can a computer transmit data. HOWEVER when RTS goes high CARRIER IS TURNED ON. The transmitter will send all "1"'s or all "0"'s until CTS goes high and Data begins to flow. IMPORTANT : PLEASE note, the time between the computers Request to Send and the Modems answer Clear To Send is called the "Clear To Send Delay" which plays an important role later on. Before we review and move on, it is important to note, that while there is a standard that says what is suppose to happen, things do not always match these standards. It is very typical to find in an office enviorment, a cable connecting to a modem with just three wires in it. Transmit Data, Receive Data and Ground. NOTHING MORE. In this case, as in others, someone has configured the modem and or computer not to look for any control signals. OR the control signals may be faked by jumpering connector pins together to pretend these control signals exist. 3.2 DCE & DTE Before we get any deeper into control signals, it is important to know that there are two classes of interfaces. A Data Communications Equipment Interface (DCE) and A Data Terminal Equipment Interface (DTE) Why the difference. Imagine if you will, a computer transmitting Data of Pin 2 (an output) connected to another computer also transmitting on Pin 2 (an output). This would not work very well. Thus the DTE interface represents signal inputs and outputs as the Computer sees it. The DCE interface represents signals as the Modem sees it. It is possible to have a computer simulate a DCE or a communications device simulate a DTE. What is important is to know that a DCE can only talk to a DTE interface. A DCE may not talk to a DCE and a DTE may not talk to a DTE unless we rewire an interconnecting cable swapping the pins around. (Another item for later consumption). Data Terminal Equipment Data Communications Equipment DTE DCE ÉÍÍ ÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍ » º 1 o-º---- Power Ground ----º-o 1 º º 2 o-º-- Transmit Data ---º-o 2 º º 3 o-º--- Receive Data ---º-o 3 º º 4 o-º--Request to send---º-o 4 º º 5 o-º-- Clear to send ---º-o 5 º º 6 o-º-- Data Set Ready --º-o 6 º º 7 o-º---- Signal Ground ---º-o 7 º º 8 o-º--Carrier Detected--º-o 8 º º 20 o-º-- Terminal Ready --º-o 20 º º 22 o-º-- Ring Indication--º-o 22 º º o-º º-o º º o-º º-o º º o-º º-o º ÈÍÍ ÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍ ¼ 3.3 Sync & Async Communication Its time to divide the world of the serial interface into its two primary facets. Asynchronous Communication is the transmission mode most people are familiar with, especially in the Home Computer Market. Async was once the one and only method of communication. That was in the era when 300 bps was king. But Industry demanded higher throughput in transmission. MORE SPEED. What was developed was a form of communication known as Synchronous Communication. Sync Comm became the fashion as speeds reached 1200 & 2400 bps. For a while Async & Sync competed side by side. But research dollars favored Sync and soon speeds reached 4800, 9600 and even 19,200 bps in the sync world leaving async in the dust. Async was dead except for a few institutions that were behind the times. Then came the explosion in the Home Computer market. A cheap means of communication was needed to allow these home computers to communicate with each other and bigger computers. Research dollars began to flow into ASYNC development and ASYNC was reborn. So ends our brief History lesson (test to follow). Synchronous communication is the industry standard. High throughput. Low overhead. Very little waste. Synchronous Communication Data Terminal Equipment Data Communications Equipment DTE DCE ÉÍÍ ÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍ » º 1 o-º---- Power Ground ----º-o 1 º º 2 o-º-- Transmit Data ---º-o 2 º º 3 o-º--- Receive Data ---º-o 3 º º 4 o-º--Request to send---º-o 4 º º 5 o-º-- Clear to send ---º-o 5 º º 6 o-º-- Data Set Ready --º-o 6 º º 7 o-º---- Signal Ground ---º-o 7 º º 8 o-º--Carrier Detected--º-o 8 º º 15 o-º--Transmit Clock ---º-o 15 º º 17 o-º--Receive Clock ---º-o 17 º º 20 o-º-- Terminal Ready --º-o 20 º º 22 o-º-- Ring Indication--º-o 10 º º o-º º-o º ÈÍÍ ÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍ ¼ The big difference you will notice in Synchronous Communication is on pins 15 and 17; Transmit Clock and Receive Clock. These Clocks are OUTPUTS from the Modem. These clocks are used to keep the computer interface in Sync with the Modem. In the async world, the timing was in the "bit length", started by the "start bit". In the world of Synchronous Communication, the timing information is contained in the Transmit and Receive Clock. This may not become apparent to you until much later, but the last piece of news spells disaster for uniformity and compatibility. In the ASYNC world, a USR can talk to a Hayes which can talk to a Leading Edge Modem. In the Sync world, at rates over 2400 bps, A Racal Modem will NOT talk to a Codex which will NOT talk to a GDC. You HAVE TO HAVE the same modem at both ends. At 1200 & 2400, most modem manufacturers built their modems to be compatible with Bell specs. Over 2400, each Modem manufacturer developed their own techniques. While the Async Modem manufacturers seem to stress compatibility, the business modem makers are playing cut throat poker for very high stakes. Synchronous Communication : Transmission in which the Data Characters and bits are transmitted at a fixed rate with the transmitter and receiver synchronized. This eliminates the need for start-stop elements, thus providing greater efficiency. What we will see when we get to the Analog side of the modem, is that a "Clock" is derived from a sideband of the received signal, thus allowing the modems to be in Sync with each other. Each "Clock" represents ONE "bit time". In some modem manufac- turers the transition of the clock pulses from high to low is the trigger for sampling the data. In other modem manufacturers, it is the transition of the clock from low to high that triggers the sampling of data. In the ASYNC world, a narrow clock pulse opened the sampling window for the modem to look to see if the data bit was going to be a 1 or 0. Now it is a clock transition that is the key to opening the sampling window. s s t t a o r p t bit bit ³ time ³ ³ ³ time ³ ³ ³ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄ Clock ³ ³ ³ ³ ³ ³ ³ ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄ Data ³ ³ ³ ³ ³ ³ ³ Data Sampled ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ 1 0 1 1 0 1 0 What this means is that for EVERY clock there is a data bit, even when there is no data. The Modem will transmit and receive either all "1"'s or all "0"'s when NO data is actually being sent. The Transmit and Receive Clocks are ALWAYS present. The Modem is ALWAYS in sync with the computer as a result. With No start or stop bits to worry about, let us for the moment talk about transmission in terms of charcters instead of bits. Of course we know that each character is derived from data bits. If we were to put a Data Scope (a device for reading data bits) on our Receive Data or Transmit Data , we would see NORMAL TEXT with control characters. Example without Control Characters Now is the time for all good men to Example with Control Characters S EB SSSO OC YYYTNow is the time for all good men toTC SY= Sync Character - one or more sync characters is used to tell the computer that REAL data is on its way. SOT = Start of Text - obvious EOT = End of text - also obvious BCC = Our Block Check character - or CRC This is a sample of how Synchronous Transmissions occur. SYNC ---- The purpose of the Sync Character is to prompt the computer. The computer is looking at a steady stream of either 1' or 0's. The sync character tells the computer, that real data, not line noise, is on its way. BCC --- As we previously discussed, the BBC is a check character generated by the transmitting computer and added to the end of the data block. The receiving Computer, performs the same check on the received data as the trasmitting computer did. The receiving computer compares its results with the BBC to see if the data block was error free. While we know that Control Signals are the way that Modems Handshake, computers also Handshake. A terminal address or ID is how a computer says hello. A computer may be talking to many computers over many data lines at the same time. To know who it is talking to and to insure it is sending the right data to the right terminal, an address is used by the computer. An address similiar to that used by the post office to deliver your mail. Addressing is as different between computer systems is it is between Post Offices in different countries. Let us say that we have 10 remote computers tied in via modems to a mainframe. The computer starts by sending out a poll to ALL the computers. The same poll is received by all computers BUT since the poll has an address, only the computer with that address will recognize the poll and respond to it. In layman's terms it would look like this. Main Frame Remotes "Poll to Computer # 1" ---- "Computer # 1 Here" "OK received Comp # 1" "Poll to Computer # 2" ---- "Computer # 2 Here" "Ok Received Comp # 2" "Poll to Computer # 3" ---- "Poll to Computer # 3" ---- "Poll to Computer # 3" ---- "No response Comp # 3" ---- "Poll to Computer # 4" ---- etc etc etc --------------------------------------------------------------------- In Data Terms it looks as follows SEB SAEB SSS OOC SSS OCOC YYYC1TTC YYYC1TKTC OR Sync Sync Sync C1 (address to) SOT (no data) EOT BCC Response Sync Sync Sync C1 (address from) SOT ACKnowledge EOT BCC All this, JUST TO SAY HELLO. Two very standard terms are ACK and NAK ACK is an acknowledgement that the computer properly received the last transmission. NAK is a Negative acknoweldgement that says the Data was not received properly, Please retransmit. A NAK will be sent by a remote computer that sees a data block with the correct address, but what follows is garbled, Bad BCC or missing a SOT or EOT. A Mainframe Computer will issue a NAK when it receives a response to a poll different that it wanted to see. Maybe Garbled Data. Maybe bad BCC, maybe NO RESPONSE at all. Without the control signals you would see Mainframe Remote C1 C1 ACK C1 ACK C2 C2 (no responses) C2 c2 NAK c3 C3 NAK (garbled data) c3 C3 ACK (ok that time) ACK C4 etc etc This form of communication is called a protocol. A protocol as defined is as a code of etiquette and precedence. In the computer world it is defined as a formal set of conventions used in data exchange between two or more systems. There are many types of Protocols, and many variations of each protocol. The above was a sample of one of the BiSync Protocols. I hope I have not lost anyone with all this good stuff. Please feel free to ask any question you may have. My reasons for giving you a taste for protocols, is to let you see what is going on behind the flashing lights in a general sort of way BUT also to make life easier down the road. I will be using TEXT transmissions to illustrate points later on. -------------------------------------------------------------------