Inter-Processor and Inter-Computer Communications
Total Page:16
File Type:pdf, Size:1020Kb
Inter-processor and Inter-computer Communications David Rye :: MTRX3700 Communications :: Slide 1 of 87 Classification . Close-coupled . Loose-coupled . On-board busses . Serial . Backplanes . RS-232 . RS-422 . RS-485 . CAN . Ethernet David Rye :: MTRX3700 Communications :: Slide 2 of 87 Classification . Interface standard: . Software protocol: physical definition of definition of . Connectors . Order and encoding of . Pin assignments the data words being . Voltage levels transmitted (logic encoding) . Flow control . Timing and handshaking . Error detection and correction David Rye :: MTRX3700 Communications :: Slide 3 of 87 Parallel Busses . Single processor . Multi-processor . Bus mastering . Always short – less than 5m, and often much less David Rye :: MTRX3700 Communications :: Slide 4 of 87 Some Parallel Bus Standards . IEEE-488 (HP-IB, GPIB) . S-100 bus (Altair) . Intel Multibus (Intel, Sun). Adopted as IEEE-765 bus . VMEbus (Motorola 68000). Adopted as IEEE-1014 bus . ISA . PCI . PCIe . etc, etc, etc… David Rye :: MTRX3700 Communications :: Slide 5 of 87 Backplanes, sub-racks and enclosures . Backplanes provide electronic connection for bus signals between processor, memory and I/O boards CAMAC VME Bus All are passive backplanes PCIe David Rye :: MTRX3700 Communications :: Slide 6 of 87 Backplanes, sub-racks and enclosures . Sub-racks provide physical mounting and restraint for backplanes and plug-in cards Eurocard subrack and cards 19” subrack David Rye :: MTRX3700 Communications :: Slide 7 of 87 Backplanes, sub-racks and enclosures . Enclosures and cases provide mounting and environmental protection 19” Rack Case Enclosures Floor-standing 19” rack enclosure 19” Desktop case (exploded view) David Rye :: MTRX3700 Communications :: Slide 8 of 87 IEEE-488 Standard (HP-IB1 or GPIB) . Developed in 1965 by HP as a standard for interconnecting “intelligent” test instruments . Adopted as IEEE-488.1 in 1975 . IEEE-488.1 defines mechanical, electrical and hardware specifications (≡ IEC2 625) . IEEE-488.2 defines software protocol 1HP-IB ≡ Hewlett Packard Instrument Bus 2IEC ≡ International Electrotechnical Commission David Rye :: MTRX3700 Communications :: Slide 9 of 87 IEEE-488 Connector . Mechanically robust stackable 24 pin connector . 8 data lines and 8 pairs of control lines . Bus managed by a GPIB chip David Rye :: MTRX3700 Communications :: Slide 10 of 87 IEEE-488 Connection . Can be star or chain connected . Up to 15 instruments connected Total cable length < 20m . Cable length between instruments < 4m David Rye :: MTRX3700 Communications :: Slide 11 of 87 IEEE-488 . Allows connection of up to 15 instruments on a common parallel bus (multicore wire) . 4 classes of instrument . Talker e.g. digital volt meter . Listener e.g. printer, plotter . Talker/listener e.g. programmable DVM . Controller . GP-IB controller coordinates activity by commanding instruments to listen or talk . One active controller David Rye :: MTRX3700 Communications :: Slide 12 of 87 IEEE-488 Bus Bus Control Handshaking 8-bit Data . Asynchronous communication . TTL logic levels, but negative logic . Each connected instrument has unique device address between 0 & 30 . Must be designed to recognise its own talk & listen addresses David Rye :: MTRX3700 Communications :: Slide 13 of 87 IEEE 488 Bus Control . Three interlocked handshaking lines for control of data transfer . DAV Data Available: asserted by talker when NDAC is false . NRFD Not Ready for Data: goes false (= ready for data) when all listeners are ready for data . NDAC Not Data Accepted: goes false (= data accepted) when last listener has read the data byte David Rye :: MTRX3700 Communications :: Slide 14 of 87 IEEE 488 Bus Control . Five general bus control lines for signalling . ATN Attention: asserted by controller when writing data lines . IFC Interface Clear: asserted by controller during bus initialisation . REN Remote Enable: controller selects remote program mode or local program mode . SRQ Service Request: asserted by device to request service by the controller . EOI End of Identity: used by talker to signal the end of a message string David Rye :: MTRX3700 Communications :: Slide 15 of 87 IEEE 488.2 and SCPI . IEEE-488.2 extends IEEE-488.1 by defining data formats, status reporting, error handling and common commands . SCPI1 extends IEEE-488.2 by defining programming commands for measurement, signal generation, etc. :MEAS:VOLT:DC? 10,0.01 1Standard Commands for Programmable Instruments David Rye :: MTRX3700 Communications :: Slide 16 of 87 Serial Data Communications David Rye :: MTRX3700 Communications :: Slide 17 of 87 Basics: Logic Encoding . Serial data transmission is always digital, for noise immunity . Logic levels may be encoded by (e.g.) . Voltage level . Frequency (FSK) . Manchester code . Current level . Phase (PSK) . 0 = transition . 1 = no transition . In digital communications . Logic 1 is termed “mark”, and . Logic 0 is termed “space” David Rye :: MTRX3700 Communications :: Slide 18 of 87 Basics: Simplex and Duplex . Simplex . Data transmitted in one direction only . Full duplex . Data transmitted simultaneously in both directions David Rye :: MTRX3700 Communications :: Slide 19 of 87 Basics: Coding of Messages . Sender and receiver must agree on the codes for transmitting data words . Data words may be transmitted as . Binary numbers or . Character codes (e.g. ASCII) . 8 bits per data word means 28 = 256 different codes . Often 7-bit ASCII is used – bit 7 is zero David Rye :: MTRX3700 Communications :: Slide 20 of 87 Basics: Asynchronous & Synchronous Transmission . Asynchronous . Receiver and transmitter have separate clocks, running at the same nominal frequency . Receiver synchronises with the transmitter by detecting the start of each data byte . Synchronous . Receiver and transmitter synchronised by a common clock . Much faster than asynchronous communications David Rye :: MTRX3700 Communications :: Slide 21 of 87 RS-232 Standard . EIA1 standard RS-232C equivalent to ITU-T2 standard V.24 . Originally (1966) a standard for data communications through the Bell telephone system . Specifies interchange between DCE (e.g. computer) and DTE (e.g. modem) . Now seldom used with modems, but widely used for other short-range serial communications 1 Electronic Industries Association 2 International Telecommunications Union David Rye :: MTRX3700 Communications :: Slide 22 of 87 RS-232 Standard . RS-232C standard defines . Mechanical characteristics (connector and pin assignment) . Functions of signals . Electrical signal characteristics . Does not define software protocol David Rye :: MTRX3700 Communications :: Slide 23 of 87 RS-232 Capabilities (Limitations) . Point-to-point communication . Maximum distance 15.2 m . 20 kbps maximum data rate David Rye :: MTRX3700 Communications :: Slide 24 of 87 RS-232 Connector . The standard specifies a D25 connector . D9 is often used, as now RS-232 applications use (at most) only 9 signals . In fact, one can get away with only 3 signals: Rx, Tx and GND David Rye :: MTRX3700 Communications :: Slide 25 of 87 RS-232 Pin D25 Signal Name Code D9 1 Frame Ground FG - Assignments 2 Transmit Data TD 3 3 Receive Data RD 2 4 Request to Send RTS 7 5 Clear to Send CTS 8 6 Data Set Ready DSR 6 7 Signal Ground SG 5 8 Data Carrier Detect DCD 1 9 +Voltage (test) - 10 -Voltage (test) - 11 Unassigned - 12 2nd Data Carrier Detect - 13 2nd Clear To Send - 14 2nd Transmitted Data - 15 Transmitter DCE Timing - 16 2nd Receive Data - 17 Receiver DCE Timing - 18 Local Loopback - 19 2nd Request To Send - 20 Data Terminal Ready DTR 4 21 Signal Quality Detect - 22 Ring Indicator RI 9 23 Data Signal Rate - 24 Transmitter DTE Timing - 25 Test Mode - David Rye :: MTRX3700 Communications :: Slide 26 of 87 RS-232 Signal Functions (DCE is computer, DTE is modem) . SG Signal ground . TD Transmit Data – data sent from DTE to DCE on TD . RD Receive Data – data received at DTE from DCE on RD . RTS Request To Send – asserted when DTE ready to send data . CTS Clear To Send – DCE responds with CTS if it is ready to receive data . DTR Data Terminal Ready – asserted when DTE powered & ready . DSR Data Set Ready – asserted when DCE is powered & ready . DCD Data Carrier Detect – asserted by DCE when connection is made David Rye :: MTRX3700 Communications :: Slide 27 of 87 RS-232 Cables . To connect DTE to DCE, just . Loopback can be used to use a pin-to-pin connection reduce the number of wires: David Rye :: MTRX3700 Communications :: Slide 28 of 87 RS-232 Null Modem . What if we want to connect a DCE to another DCE (computer to computer)? . Use a null modem connection: David Rye :: MTRX3700 Communications :: Slide 29 of 87 RS-232 Electrical Levels . Logic 1 (“mark”) is a voltage between -5V and -15V (transmitter) or -3V and -25V (receiver) . Logic 0 (“space”) is a voltage between +5V and +15V (transmitter) or +3V and +25V (receiver) . Often ±7V or ±10V is used . Not compatible with TTL levels use an RS-232 driver (e.g. MC1488, MC1489, MAX232, MAX202) David Rye :: MTRX3700 Communications :: Slide 30 of 87 RS-232 Electrical Levels . Data transmitted asynchronously, least significant bit first. For example, here is ASCII ‘Q’: . Line idles at “mark” (logic 1 or negative voltage) . Byte framed by a logic 0 start bit & a logic 1 stop bit . Bit 0 transmitted first David Rye :: MTRX3700 Communications :: Slide 31 of 87 RS-232 Electrical Levels . Before transmission begins, transmitter and receiver must agree on: . baud rate (1200, 2400, 4800, 9600, 19200, etc) . 1, 1.5 or 2 stop bits . 5, 6, 7 or 8 data bits . even, odd or no parity . This is done by programming the serial IC (a UART or USART) . A frame can be anywhere from 7 to 12 bits long David Rye :: MTRX3700 Communications :: Slide 32 of 87 Parity . Parity is a simple means of error detection . A parity bit is an extra bit between the last data bit and the stop bit . Even parity means that there is an even number of 1s in the data bits plus parity bit . Odd parity means that there is an odd number of 1s . The parity bit is adjusted to achieve the required parity David Rye :: MTRX3700 Communications :: Slide 33 of 87 Baud Rate vs.