• Aucun résultat trouvé

Serial I/O Example 1: Networking and Communications: RS-232

Dans le document Embedded Hardware (Page 161-165)

Embedded Board Buses and I/O

4.2.1 Serial I/O Example 1: Networking and Communications: RS-232

One of the most widely implemented serial I/O protocols for either synchronous or asynchro-nous transmission is the RS-232 or EIA-232 (Electronic Industries Association-232), which is primarily based on the EIA family of standards. These standards defi ne

the major components of any RS-232 based system, which is implemented almost entirely in hardware.

The hardware components can all be mapped to the physical layer of the OSI model (see Figure 4.7). The fi rmware (software) required to enable RS-232 functionality maps to the lower portion of the data link but will not be discussed in this section.

According to the EIA-232 standards, RS-232 compatible devices (shown in Figure 4.8) are called either Data Terminal Equipment (DTE) or Data Circuit-terminating Equipment (DCE).

DTE devices are the initiators of a serial communication, such as a PC or embedded board.

DCE is the device that the DTE wants to communicate with, such as an I/O device connected to the embedded board.

Figure 4.7: OSI model.

Network Session Presentation

Ethernet Data-Link Application

Transport

Physical

Ch04-H8584.indd 144

Ch04-H8584.indd 144 8/17/07 6:10:34 PM8/17/07 6:10:34 PM

Embedded Board Buses and I/O 145

w w w. n e w n e s p r e s s . c o m

The core of the 232 specifi cation is called the 232 interface (see Figure 4.9). The RS-232 interface defi nes the details of the serial port and the signals, along with some additional circuitry that maps signals from a synchronous serial interface (such as SPI) or an asynchro-nous serial interface (such as UART) to the serial port and by extension to the I/O device itself. By defi ning the details of the serial port, RS-232 also defi nes the transmission medium, which is the serial cable. The same RS-232 interface must exist on both sides of a serial com-munication transmission (DTE and DCE or embedded board and I/O device), connected by an RS-232 serial cable, in order for this scheme to work.

DTE Embedded System 1

Transmission Medium DCE

Embedded System 2

Figure 4.8: Serial network diagram.

RS-232 Cable

Embedded Device

Serial Port UART RS-232 Interface

Master or Slave Processor RS-232 System Model

Figure 4.9: Serial components block diagram.

The actual physics behind the serial port—the number of signals and their defi nitions—

differs among the different EIA232 standards. The parent RS-232 standard defi nes a total of 25 signals, along with a connector, called a DB25 connector, on either end of a wired transmission medium, shown in Figure 4.10a. The EIA RS-232 Standard EIA574 defi nes only nine signals (a subset of the original 25) that are compatible with a DB9 connector (shown in Figure 4.10b), whereas the EIA561 standard defi nes eight signals (again a subset of the original RS-232 25 signals) compatible with an RJ45 connector (see

Figure 4.10c).

Two DTE devices can interconnect to each other using an internal wiring variation on serial cables called null modem serial cables. Since DTE devices transmit and receive data on the same pins, these null modem pins are swapped so that the transmit and receive connections on each DTE device are coordinated.

Ch04-H8584.indd 145

Ch04-H8584.indd 145 8/17/07 6:10:34 PM8/17/07 6:10:34 PM

w w w. n e w n e s p r e s s . c o m

4.2.2 Example: Motorola/Freescale MPC823 FADS Board RS-232 System Model The serial interface on the Motorola/Freescale FADS board (a platform for hardware and software development around the MPC8xx family of processors) is integrated in the master processor, in this case the MPC823. To understand the serial port, the other major serial com-ponent located on the board, one only has to read the board’s hardware manual.

DB25

Pin Name Signal Description Voltage DTE DCE

1 FG Frame Ground/Shield Out In

2 BA TxD Transmit Data 12 In Out

3 BB RxD Receive Data 12 Out In

4 CA RTS Request To Send 12 In Out

5 CB CTS Clear To Send 12 In Out

6 CC DSR Data Set Ready 12

7 AB SG Signal Ground

8 CF DCD Data Carrier Detect 12 In Out

9 Positive Test Voltage

10 Negative Test Voltage

11 Not Assigned

12 sDCD Secondary DCD 12 In Out

13 sCTS Secondary CTS 12 In Out

14 sTxD Secondary TxD 12 Out In

15 DB TxC DCE Transmit Clock In Out

16 sRxD Scondary RxD 12 In Out

17 DD RxC Receive Clock In Out

18 LL Local Loopback

19 sRTS Secondary RTS 12 Out In

20 CD DTR Data Terminal Ready 12 Out In

21 RL SQ Signal Quality 12 In Out

22 CE RI Ring Indicator 12 In Out

23 SEL Speed Selector DTE In Out

24 DA TCK Speed Selector DCE Out In

25 TM TM Test Mode 12 In Out

Looking Into the DTE Device Connector DB25 Male

Transmitter Signal Timing (DTE Source) Data Signal Rate Selector Ring Indicator Remote Loopback DTE Ready Sec. Request to Send Local Loopback

Receiver Signal Timing (DCE Source) Sec. Received Data

Transmitter Signal Timing (DCE Source) Sec. Transmitted Data

Sec. Clear to Send Sec. Received Line Signal Detect (Unassigned) (reserved for testing) (reserved for testing) Received Line Signal Detect Signal Ground

Looking Into the DCE Device Connector DB25 Female

Transmitter Signal Timing (DCE Source) Sec. Transmitted Data

Receiver Signal Timing (DCE Source) Local Loopback

Sec. Clear to Send DTE Ready Remote Loopback Ring Indicator Data Signal Rate Selector Transmitter Signal Timing (DTE Source) Test Mode Received Line Signal Detect (reserved for testing) (reserved for testing) (Unassigned) Sec. Received Line Signal Detect

Sec. Request to Send Shield

Figure 4.10a: RS-232 signals and DB25 connector.

DB9

Pin Name Signal Description Voltage DTE DCE

1 109 DCD Data Carrier Detect 12 In

Leading Into DTE Device DB9 Male

Leading Into DCE Device DB9 Female

9 Ring Indicator 8 Clear to Send 7 Request to Send 6 Received Line Signal Detect

1 2 3 4 5 Received Line Signal Detect

Transmitted Data 7 Clear to Send 8 Request to Send 9 Ring Indicator

Figure 4.10b: RS-232 signals and DB9 connector.

Ch04-H8584.indd 146

Ch04-H8584.indd 146 8/17/07 6:10:35 PM8/17/07 6:10:35 PM

Embedded Board Buses and I/O 147

w w w. n e w n e s p r e s s . c o m

Section 4.9.3 of The Motorola/Freescale 8xxFADS User’s Manual (Rev. 1) details the RS-232 system on the Motorola/Freescale FADS board as follows:

DB9

Pin Name Signal Description Voltage DTE DCE

1 125 RI Ring Indicator 12 In

Same Leading Into DTE Device and DCE Device

8

Figure 4.10c: RS-232 signals and RJ45 connector.

To assist user’s applications and to provide convenient communication channels with both a terminal and a host computer, two identical RS232 ports are provided on the FADS. …..

Use is done with 9 pins, female D-type stack connector, confi gured to be directly (via a fl at cable) connected to a standard IBM-PC-like RS232 connector.

4.9.3.1 RS-232 Signal Description In the following list:

DCD (O) – Data Carrier Detect TX (O) – Transmit Data

Figure 4.11: RS-232 serial port connector.

From this manual, we can see that the FADS RS-232 port defi nition is based on the EIA574 DB9 DCE female device connector defi nition.

Ch04-H8584.indd 147

Ch04-H8584.indd 147 8/17/07 6:10:36 PM8/17/07 6:10:36 PM

4.2.3 Serial I/O Example 2: Networking and Communications: IEEE 802.11

Dans le document Embedded Hardware (Page 161-165)