Modes of data Transmission
1
Parallel data transfer: Many bits (usually 4 or 8) are sent at a time over many wires in the cable. - Faster - Limited to small distances - Data skew: The difference in arrival time of bits transmitted at the same time. Serial data transfer: Sending one bit at a time over one wire through the serial port is known as serial transfer. - Slower - Cheaper
2
•
To interface a microcomputer with serial data lines, the data must be converted to and from serial form.
•
A parallel-in-serial-out shift register and a serial-in-parallel-out shift register can be used to conversion.
3
Terms in serial data transmission • Simplex – Transmit data only in one direction – Eg: radio station, earthquake sensor
• Half-duplex – Communication can take place in either direction between two systems, but can only occur in one direction at a time. – Eg: walky-talky, push to talk (PTT) devices
• Full-duplex – Full-duplex means that each system can send and receive data at the same time. – Eg: phone conversation. 4
Serial transmission Asynchronous -Each byte is encoded for transmission with Start and stop bits - No need for sender and receiver synchronization Synchronous -Sender and receiver must synchronize Done in hardware using phase locked loops (PLLs) -Block of data can be sent -More efficient and less overhead than asynchronous transmission -Expensive
5
6
ALWAYS HIGH
ALWAYS LOW
START
D0
D1
D2
D3
D4
D5
D6
PARITY
STOP
STOP
ONE CHARAC TER
Fig. Bit format used for sending asynchronous serial data
7
8
Format of asynchronous transmission (One byte of async data)
9
Pin Configuration of the 8251 USART
10
Pin Number
Description
27,28,1,2,5-8, D0-D7 -- Data Bus (8 bits) 3
RXD – Receiver data
4
GND -
9
TXC - Transmitter Clock (Input - Active Low)
10
WR - Write data or control command
11
CS - Chip Select
12
C / D – Control or data is to be written or read
13
RD - Read data command
14
RXRDY - Read Register Ready
15
TXRDY - Transmitter Register Ready
Ground
11
16
SYNDET/BD
- Refer Data Sheet
17
CTS
- Clear To Send data (Active Low)
18
TXEMPTY
- Transmitter Register Empty
19
TXD
- Transmitter data (Output)
20
CLK
- Clock
21
RESET
- Reset
22
DSR
- Data Set Ready
23
RTS
- Request To Send data
24
DTR
- Data Terminal Ready
25
RXC
- Receiver Clock (Active Low)
26
Vcc
--- + 5v Supply 12
Block diagram of the 8251 USART
13
D0 to D7 (l/O terminal) This is bidirectional data bus which receives control words and transmits data from the CPU and sends status words and received data to CPU. RESET (Input terminal) • The device waits for the writing of "mode instruction.“ • The min. reset width is six clock inputs during the operating status of CLK. CLK (Input terminal) • CLK signal is independent of RXC or TXC. • The frequency of CLK must be greater than 30 times the RXC and TXC at Synchronous mode and Asynchronous "x1" mode • It must be greater than 5 times at Asynchronous "x16" and "x64" mode. WR (Input terminal) It receives a signal for writing transmit data and control words from the CPU into the 8251. RD (Input terminal) 14 It receives a signal for reading receive data and status words from the 8251.
C/D (Input terminal) • It selects data or command words and status words when the 8251 is accessed by the CPU.
CS (Input terminal) TXD (output terminal) • This is an output terminal for transmitting data from which serialconverted data is sent out. TXRDY (output terminal) • This is an output terminal which indicates that the 8251is ready to accept a transmitted data character. • TxRDY=1 when holding buffer is empty
15
TXEMPTY (Output terminal) This is an output terminal which indicates that the 8251 has transmitted all the characters and had no data character. TxEMPTY=1 when both buffers are empty. In "synchronous mode," the terminal is at high level, if transmit data characters are no longer remaining and sync characters are automatically transmitted. TXC (Input terminal) 1. This is a clock input signal which determines the transfer speed of transmitted data. 2. In "synchronous mode," the baud rate will be the same as the frequency of TXC. 3. In "asynchronous mode", it is possible to select the baud rate factor by mode instruction. 4. It can be 1, 1/16 or 1/64 the TXC. The falling edge of TXC sifts the serial data out of the 8251. RXD (input terminal) This is a terminal which receives serial data. 16
RXRDY (Output terminal) This is a terminal which indicates that the 8251 contains a character that is ready to READ (by the CPU). RxRDY=1 when a character has been shifted into the receiver buffer. RXC (Input terminal) This is a clock input signal which determines the transfer speed of received data. SYNDET/BD (Input or output terminal) 1.
This is a terminal whose function changes according to mode.
2.
In "synchronous mode," it is at high level, if sync characters are received and synchronized.
3.
In "asynchronous mode," this is an output terminal which generates "high level” output upon the detection of a "break" character if receiver data contains a "low-level" space between the stop bits of two continuous characters. 17
DSR (Input terminal) : Data Set Ready •
This is an input signal for MODEM interface. The input status of the terminal can be recognized by the CPU reading status words.
DTR (Output terminal) : Data Terminal Ready •
This is an output signal for MODEM interface. It is possible to set the status of DTR by a command.
CTS (Input terminal) : Clear To Send data •
This is an input signal for MODEM interface which is used for controlling a transmit circuit. CTS=0 then terminal is ready to transmit data. RTS (Output terminal): Request To Send data •
This is an output signal for MODEM interface. It is possible to set the status RTS by a command. 18
The 8251 functional configuration is programmed by software. Operation between the 8251 and a CPU is executed by program control. Table below shows the operation between a CPU and the device.
19
Interfacing 8251 with 8086
20
21
RS-232 Interface: RS-232 stands for Recommend Standard number 232 and was given by the EIA (Electronic Industry Association), Bell Laboratories in the year 1969. The purpose of the standard was to provide an Interface between Data Terminal Equipment (DTE) and Data communication Equipment (DCE) employing serial data transfer. Data terminal equipment (DTE) is an end instrument that converts user information into signals or reconverts received signals. A DTE device communicates with DCE. The DTE/DCE classification was introduced by IBM The DTE device is the terminal (or a computer emulating a terminal), 22 and the DCE is a modem
• The RS-232 standard requires a modem to be connected between the receiving and transmitting ends.
• This interface is useful for point-to-point communication at slow speeds. For example, port COM1 in a PC can be used for a mouse, port COM2 for a modem, etc. • RS 232 was designed for communication of local devices, and supports one transmitter and one receiver. 23
• RS232 on DB9 (9-pin D-type connector)
Male RS232 DB9
24
Signals Commonly-used signals are: •
Transmitted Data (TxD) –
•
Received Data (RxD) –
•
Asserted by DCE to indicate the DCE is powered on and is ready to receive commands or data for transmission from the DTE.
Data Carrier Detect (DCD) –
•
Asserted by DTE to indicate that it is ready to be connected. If the DCE is a modem, this may "wake up" the modem, bringing it out of a power saving mode.
Data Set Ready (DSR) –
•
Asserted by DCE to acknowledge RTS and allow DTE to transmit
Data Terminal Ready (DTR) –
•
Asserted by DTE to indicate to DCE that DTE is ready to receive data.
Clear To Send (CTS) –
•
Asserted (set to logic 0, positive voltage) by DTE to prepare DCE to receive data.
Ready To Receive (RTR) –
•
Data sent from DCE to DTE.
Request To Send (RTS) –
•
Data sent from DTE to DCE.
Asserted by DCE when a connection has been established with remote equipment.
Ring Indicator (RI) –
Asserted by DCE when it detects a ring signal from the telephone line
25
Limitations of RS-232 RS-232 has some serious shortcomings as an electrical interface. •
Firstly, the interface pre-supposes a common ground between the DTE and DCE. -- This is a reasonable assumption where a short cable connects a DTE and DCE in the same room, but with longer lines and connections between devices that may be on different electrical busses, this may not be true. We have seen some spectacular electrical events causes by "uncommon grounds".
•
Secondly, a signal on a single line is impossible to screen effectively for noise. -- By screening the entire cable one can reduce the influence of outside noise, but internally generated noise remains a problem. -- As the baud rate and line length increase, the effect of capacitance between the cables introduces serious crosstalk until a point is reached where the data itself is unreadable. 26
TTL to RS 232C conversion • USART (8251) is not directly compatible with RS-232 signal levels. • The TTL to RS232 Serial Adapter is used to connect TTL (Transistor-Transistor Logic) level signals to an RS-232 interface. • The TTL side is a 9-pin female connector, and the RS-232 side is a 9-pin male connector. • The TTL side has a voltage suppression network designed to protect against ESD (Electro Static Discharge) and EFT (Electrical Fast Transient).
27
28
TTL to RS232 Serial Adapter
Serial RS232 to USB
29
RS232C to TTL conversion
30
31
High-Speed serial communication • RS-422: A high-speed system similar to RS-232 but with differential signaling • RS-423: A high-speed system similar to RS-422 but with unbalanced signaling • RS-449 : A functional and mechanical interface that used RS-422 and RS-423 signals - it never caught on like RS-232 and was withdrawn by the EIA • RS-485: A descendant of RS-422 that can be used as a bus in multidrop configurations • MIL-STD-188: A system like RS-232 but with better impedance and rise time control 32
• TIA-574: standardizes the 9-pin D-subminiature connector pinout for use with EIA-232 electrical signaling, as originated on the IBM PC/AT • SpaceWire high-speed serial system designed for use on board spacecraft
33
High-Speed serial communication standards IEEE 1394 interface: •
The IEEE 1394 interface is a serial bus interface standard for high-speed communications and isochronous real-time data transfer, frequently used by personal computers, as well as in digital audio, digital video, automotive, and aeronautics applications.
•
The ISOCHRONOUS (ISOC) format for data transmission is a procedure or protocol in which each information CHARACTER or BYTE is individually synchronized or FRAMED by the use of Start and Stop Elements (bits).
•
This interface is also known by the brand names of FireWire (Apple Inc.), i.LINK (Sony), and Lynx (Texas Instruments).
•
IEEE 1394 has been adopted as the High-Definition Audio-Video Network Alliance (HANA) standard connection interface for A/V (audio/visual) component communication and control.
•
FireWire is also available in wireless, fiber optic, and coaxial versions using the isochronous protocols
•
Nearly all digital camcorders have included a four-circuit 1394 interface
34
Standards and versions FireWire 400 (IEEE 1394 -1995): • A 6-circuit FireWire 400 alpha connector • The original release of IEEE 1394-1995 specified what is now known as FireWire 400. • It can transfer data between devices at 100, 200, or 400 Mbit/s half-duplex data rates (the actual transfer rates are 98.304, 196.608, and 393.216 Mbit/s, • These different transfer modes are commonly referred to as S100, S200, and S400. • Cable length is limited to 4.5 metres (14.8 ft), although up to 16 cables can be daisy chained using active repeaters. 35
The 6-circuit and 4-circuit alpha FireWire 400 connectors The alternative Ethernet-style cabling used by 1394c
a pair of 6-circuit alpha connectors on the edge of an expansion card
4-circuit (left) and 6-circuit (right) FireWire 400 alpha connectors 36
FireWire 800 (IEEE 1394b-2002) • A 9-circuit beta connector. • IEEE 1394b-2002 introduced FireWire 800 (Apple's name for the 9-circuit "S800 bilingual" version of the IEEE 1394b standard) • Data transfer rate is 786.432 Mbit/s fullduplex via a new encoding scheme termed beta mode. •
It is backwards compatible to the slower rates and 6-circuit alpha connectors of FireWire 400.
A 9-circuit beta connector 37
FireWire S1600 and S3200 • In December 2007, the 1394 Trade Association announced that products will be available before the end of 2008 using the S1600 and S3200 modes that, for the most part, had already been defined in 1394b and was further clarified in IEEE Std. 1394-2008. • The 1.6 Gbit/s and 3.2 Gbit/s devices use the same 9circuit beta connectors as the existing FireWire 800 and will be fully compatible with existing S400 and S800 devices. • It will compete with the forthcoming USB 38
FireWire S800T (IEEE 1394c-2006)
• IEEE 1394c-2006 was published on June 8 2007. • It provided a major technical improvement, namely new port specification that provides 800 Mbit/s over the same RJ45 connectors with IEEE 802.3 (Ethernet) devices. • Though the potential for a combined Ethernet and FireWire RJ45 port is intriguing, as of November 2008, there are no products or chipsets which include this capability.
39
Comparison to USB • • •
•
Firewire (which started development in 1986) had implementations predating USB. However USB reached industry standardization (1994) before the IEEE1394-1995 specification was released (1995). At this time USB 1.0 had a signaling speed of 12 and 1.5 Mbit/s (compared to 400 Mbit/s of IEEE-1394a (FireWire 400)) but cheaper implementations. USB 2.0 with (480 Mbit/s) signal rate was made available in computers early 2001. FireWire 800 is substantially faster than Hi-Speed USB, both in theory and in practice.
Alternative uses for IEEE 1394 1. Aircraft
2. Automobiles
40
USB-Universal Serial Bus • USB is intended to replace many varieties of serial and parallel ports. • USB can connect computer peripherals such as – – – – – – – – – – –
mice keyboards PDAs gamepads joysticks scanners digital cameras printers personal media players flash drives external hard drives.
• As of 2008, there are about 2 billion USB devices sold per year, and about 6 billion total sold to date. 41
• The design of USB is standardized by the USB Implementers Forum (USB-IF), an industry standards body incorporating leading companies from the computer and electronics industries. • Year created: January 1996 • Created by: Intel, Compaq, Microsoft, Digital Equipment Corporation, IBM, Northern Telecom
A USB Series “A” plug, the most common USB plug
42
• USB communication takes the form of packets. • The original USB 1.0 specification had a data transfer rate of 12 Mbit/s. • The USB 2.0 specification was released in April 2000 and was standardized by the USB-IF at the end of 2001. Data transfer rate of 480 Mbit/s • The USB 3.0 specification was released on November 12, 2008 by the USB 3.0 Promoter Group. It's maximum transfer rate is up to 10 times faster than the USB 2.0 release. It has been dubbed the Super Speed USB. 43
Different types of USB connectors from left to right • • • • •
8-pin AGOX Mini-B plug Type B plug Type A receptacle Type A plug
USB extension cord
44
• A USB system has an asymmetric design, consisting of a host, a multitude of downstream USB ports, and multiple peripheral devices connected in a tiered-star topology. •
Additional USB hubs may be included in the tiers, allowing branching into a tree structure with up to five tier levels.
•
A USB host may have multiple host controllers and each host controller may provide one or more USB ports.
• • Up to 127 devices, including the hub devices, may be connected to a single host controller. • USB devices are linked in series through hubs. A physical USB device may consist of several logical sub-devices that are referred to as device functions. 45
• A single device may provide several functions, for example, a webcam (video device function) with a built-in microphone (audio device function). Such a device is called a compound device in which each logical device is assigned a distinctive address by the host and all logical devices are connected to a built-in hub to which the physical USB wire is connected. • USB device communication is based on pipes (logical channels). • Pipes are connections from the host controller to a logical entity on the device named an endpoint. • USB endpoints actually reside on the connected device: the channels to the host are referred to as pipes. 46
USB mass-storage •
USB implements connections to storage devices using a set of standards called the USB mass storage device class (referred to as MSC or UMS).
•
This was initially intended for traditional magnetic and optical drives, but has been extended to support a wide variety of devices, particularly flash drives.
•
This generality is because many systems can be controlled with the familiar idiom of file manipulation within directories (the process of making a novel device look like a familiar device is also known as extension).
•
Though most newer computers are capable of booting off USB mass storage devices.
•
USB interface port: the drive appears to the user much like an internal drive. 47