02-11-2016, 03:54 PM
1463633262-HW2.docx (Size: 84.51 KB / Downloads: 2)
UART
Universal Asynchronous Receiver/Transmitter (UART) is a communication standard (RS-232) which is used in computer hardware device for serial data transmission. The term “universal” represents that the data format and transmission speeds are standard and configurable. The electrical signaling levels and methods are handled by a driver circuit external to the UART.
UART needs a serial port for interfacing and it allows only peer-peer communication type. UARTs are commonly used in embedded systems as it is included in microcontrollers. There is also a USART, which supports the synchronous communication.
a) A UART (RS-232) usually contains the following components:
A clock generator, usually a multiple of the bit rate to allow sampling in the middle of a bit period.
Input and output shift registers
Transmit/receive control
Read/write control logic
Transmit/receive buffers (optional)
Parallel data bus buffer (optional)
First-in, first-out (FIFO) buffer memory (optional)
b) Data Handling:
UART takes bytes of data and transmits the individual bits in a sequential fashion. At other end a second UART assembles the bits into complete bytes. It is compulsory to have UART ports at both the ends to establish the communication.So if there is any other external signaling used then it needs to be converted to UART standards and then transmitted or received. Communication may be simplex/full-duplex/half-duplex.
Data Framing:
Each character is sent as a logic low start bit, a configurable number of data bits, an optional parity bit if the number of bits per character chosen is not 9 bits, and one or more logic high stop bits. In most applications the least significant data bit is transmitted first, but there are exceptions.
The start bit signals the receiver that a new character is coming. The next five to nine bits, depending on the code set employed, represent the character. If a parity bit is used, it would be placed after all of the data bits. The next one or two bits are always in the mark (logic high, i.e., '1') condition and called the stop bit(s). They signal the receiver that the character is completed. Since the start bit is logic low (0) and the stop bit is logic high (1) there are always at least two guaranteed signal changes between characters.
If the line is held in the logic low condition for longer than a character time, this is a break condition that can be detected by the UART.
Advantages:
1. UART is a single wire, easy interface to PCs, MCU UARTSs etc. 2.
2. Also, range of standard physical interfaces (TTL, RS232, RS422, and RS485) covers a big range of distance/speed capabilities with off-the-shelf hardware.
Disadvantages:
1. Needs reasonable clock accuracy both ends. Max data rate in practice about 1mbit/sec (typically limited by UART capabilities).
2. Due to clock requirement, it's not generally practical to wake an MCU on reception and have the first character available once woken due to clock startup delays.
II) SSI:
Synchronous Serial Interface (SSI) is a widely used serial interface standard which is based on RS-422 standard and can be used in applications involving master and slave combination. It is different from the Serial Peripheral Interface Bus (SPI): A SSI is differential, simplex, non-multiplexed, and relies on a time-out to frame the data. A SPI is single-ended, duplex, and multiplex and uses a select-line to frame the data. However, SPI peripherals on microcontrollers can implement SSI with external differential driver-ICs and program-controlled timing.
SSI is a synchronous, point to point, serial communication channel for digital data transmission.The CLOCK and DATA signals are transmitted according to RS-422 standards.The master controls the clock sequence and the slave transmits the current data/value through a shift register. When invoked by the master, the data is clocked out from the shift register. The master and slave are synchronized by the common clock of the controller.
Advantages:
1. SSI design due to use of minimal number of components, has considerably reduced the cost and created more transmission bandwidth for message bits.
2. High Electromagnetic interference immunity due to RS-422 standards and higher reliability of data transmission due to differential signaling.
3. Slaves use master’s clock and hence don’t need precision oscillators.
4. The SSI allows to connect up to three slaves to a common clock. Therefore, it is possible to attain values from multiple sensors.
Disadvantages:
1. SSI can handle only short distance communication (up to 1.2 km) and supports only one master device.
2. When compared to advanced communication systems based on field buses or Ethernet, SSI is limited to a master slave architecture and a simple point to point communication between a master and a slave.
3. Another disadvantage is that there is no hardware slave acknowledgment i.e. detection of slave for communication.
III) I2C:
Inter Integrated Circuit(I2C) protocol is used to communicate across circuit-board distances.I2C is a two-wire serial bus.
The two I2C signals are serial data (SDA) and serial clock (SCL). Together, these signals make it possible to support serial transmission of 8-bit bytes of data-7-bit device addresses plus control bits-over the two-wire serial bus. The device that initiates a transaction on the I2C bus is termed the master. The master normally controls the clock signal. A device being addressed by the master is called a slave.
The I2C bus is a multi-master bus. This means that more than one IC capable of initiating a data transfer can be connected to it.
Function:
First, the MCU will issue a START condition. This acts as an 'Attention' signal to all of the connected devices. All ICs on the bus will listen to the bus for incoming data.Then the MCU sends the ADDRESS of the device it wants to access, along with an indication whether the access is a Read or Write operation. Having received the address, all IC's will compare it with their own address. If it doesn't match, they simply wait until the bus is released by the stop condition. If the address matches, however, the chip will produce a response called the ACKNOWLEDGE signal.Once the MCU receives the acknowledgement, it can start transmitting or receiving DATA. When all is done, the MCU will issue the STOP condition.
Advantages:
1. supports multiple masters
2. incorporates ACK/NACK functionality for improved error handling
3. maintains low pin/signal count even with numerous devices on the bus
Disadvantages:
1. Imposes protocol overhead that reduces throughput.
2. I2C draws more power than SPI/SSI.
3. I2C is slower compared to SSI/SPI/UART.
2] Examples:
I) UART:
PC with Modem:
Original purpose of UART was for PCs to communicate via telephone network. Telephones were for voice communication whereas computers need to exchange digital data. So, Modem is used as a communication equipment between both of them.
Other than this, widely available GSM/GPRS cell phone modem, Bluetooth modem, GPS receiver etc. supports UART interfaces.
II) SSI:
SSI is widely used in applications in industrial automation like encoder interface with Synchronous Serial Interface, interfacing of motor drivers , motion controller interface etc.
III) I2C:
I2C is widely used to interface two circuits for example interfacing of memory chip like Flash / SRAM etc. using I2C is possible if the circuit for that chip supports the interface.