Asynchronous Serial Communications

Slides:



Advertisements
Similar presentations
IO Interfaces and Bus Standards. Interface circuits Consists of the cktry required to connect an i/o device to a computer. On one side we have data bus.
Advertisements

INPUT-OUTPUT ORGANIZATION
ECT 357 Ch 18 UART. Today’s Quote: Be careful that your marriage doesn’t become a duel instead of a duet. Be careful that your marriage doesn’t become.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Starting with serial Chapter Ten 10.1, 10.2,
CSCI 4550/8556 Computer Networks Comer, Chapter 5: Local Asynchronous Communication (RS-232)
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Chapter 8 COMMUNICATION AND COMPUTER NETWORK
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
Local Asynchronous Communication
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
INPUT-OUTPUT ORGANIZATION
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
USART Communication using the RS standard ETEC6416.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
4.0 rtos implementation part II
The 8051 Microcontroller and Embedded Systems
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
Universal Asynchronous Receiver/Transmitter (UART)
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
Chapter 5: Local Asynchronous Communication 1. Bit-wise data transmission 2. Asynchronous communication 3. Sending bits with electric current 4. Standard.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
Example. SBUF Register SCON Register(1) SCON Register(2)
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
Universal Asynchronous Receiver/Transmitter (UART)
AS Computing Data transmission. Basic data transmission Baud The rate that the voltage changes is called the Baud. If the voltage changes 10 times every.
Unit 1 Lecture 4.
Chapter 7 Channel organization. Group members  Bilal Ahmed  Mehmal javed  Faisal khan janjua  Harris bashir.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Data and Computer Communications Digital Data Communications Techniques + Error Control+ Digital Data Communications Techniques + Error Control+Multiplexing.
Serial Communications
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Application Case Study Security Camera Controller
Chapter 6 Input/Output Organization
Serial mode of data transfer
RS-232 Communications.
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Input/Output and Communication
Serial I/O and Data Communication.
Transmission Modes The term transmission mode to refer to the manner in which data is sent over the underlying medium Transmission modes can be divided.
SERIAL PORT PROGRAMMING
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
RS-232 Communications.
E3165 DIGITAL ELECTRONIC SYSTEM
Local Asynchronous Communication (RS-232)
DIGITAL DATA COMMUNICATION TECHNIQUES
Computer Organization and Design
Source: Serial Port Source:
Lecture 4 Continuation of transmission basics Chapter 3, pages 75-96
DIGITAL DATA COMMUNICATION TECHNIQUES
Serial Communication Interface: Using 8251
Serial Communication Interface
UART Protocol Chapter 11 Sepehr Naimi
DIGITAL DATA COMMUNICATION TECHNIQUES
Chapter Nine: Data Transmission
Programmable Data Communication Blocks
BASIC TYPE OF DATA TRANSMISSION:
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Chapter 9 Transmission Modes
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Source: Serial Port Source:
PIC Serial Port Interfacing
PIC Serial Port Interfacing
Serial Communications
Introduction Communication Modes Transmission Modes
Presentation transcript:

Asynchronous Serial Communications Asynchronous serial data transmission sends each datum as a separate frame Line goes to logic 0 for one period to signal the start of the frame (START) The datum bits are then transmitted one bit at a time least significant first Line goes to logic 1 for one period to signal the end of the frame (STOP) Line then idles at logic 1 until the next START pulse For example, transmitting the letter ‘E’ (h’45’ or b’01000101’) LS bit 1 MS bit START STOP Idle Idle 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points Concepts Baud rate is a measure of information flow rate. In simple systems this is the same as bit rate. Baud rate is conventionally 110, 300, 600, 1200, 2400, 4800 …. Bit period is 1/(Baud rate); e.g. 1/600 = 1.666ms. With a single Start and Stop bit there are ten bits in a frame. Thus at 600 baud, 60 characters per second are send at maximum. The receiver is set to the same nominal rate as the transmitter to avoid having to transmit the clock signal via a separate channel. The clocks can differ by no more than ±½ (±50%) of a bit period in the ten bits to avoid loss of synchronization; that is ±5% A Simplex channel can only transmit in one direction. A half Duplex channel can transmit in either direction but not simultaneously. full Duplex channel can transmit simultaneously in both directions. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points Normal logic voltages not suitable for transmission distances above around 30cm. Signalling techniques are used to modify the two signals to give longer ranges and suit the transmission channel (e.g. tones are used for telephone and wireless links). RS-232 is one of the most common of these signal standards. Two bipolar voltage levels are used; with the positive voltage representing logic 0 and the negative voltage logic 1. At the transmitter levels of typically ±12V with respect to ground. The receiver can sense voltages down to ±3V with respect to ground. Used for distances up to 15m at low speed Rather poor noise immunity, especially if there is any difference in the ground voltages between transmitter and receiver. Not designed for network use, which needs multiple transmitters and receivers sharing the one line. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points RS485 uses two conductors (instead of relying on the ground connections at remote points), usually twisted together. This is known as differential signalling as opposed to single-ended signalling where voltages are measured with respect to ground. Transmitter uses ±5V (when idling B wire is more positive than A wire) across the conductors to signal either logic level. Receiver can detect differences across the wires down to ±200mV Good noise immunity, as any externally induced noise will effect both conductors equally and the receiver is only interested in differences. Long distances at high speed are possible. Each transmitter has an enable input, so more than one driver can be connected to the link, provided that only one is enabled at any time. Multiple receivers can be connected to the link, giving with the above a network (LAN) capability. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points Handshaking or flow control is the protocol used by the transmitter to determine if the receiver is ready to accept a character. For an asynchronous link there are basically two different techniques: Hardware: Where there is a separate connection between transmitter and receiver, often labelled /CTS (Clear To Send) and /RTS (Ready To Send) – where the signals are active logic 0. When ready to TX, transmitter (Master) activates its /RTS line. Master then checks the /CTS line from receiver (Slave). If not active goto 1. Transmit the character. If another character to send THEN GO TO 2 ELSE deactivate /RTS Advantages; fast, reliable and simple. Disadvantages; Needs two extra wires or channels. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points Software: Where special reserved characters are sent to the Master by the Slave indicating the latter’s readiness to accept more information. These characters are usually named XON (code b’00010001’ or h’11’) and XOFF (code b’00010011’ or h’13’). Basically the Master keeps transmitting until and if the Slave sends back an XOFF character. It doesn’t start up again until an XON character is received. Master sends a character. Has the Slave sent an XOFF character? If not then GO TO 1 unless transmission is over. ELSE keep listening until an XON character is received in which case GO TO 1. Advantage: Doesn’t need two dedicated handshake channels. Disadvantages: Needs a Duplex link, not as reliable as a hardware scheme as can lock up of an XON or XOFF character is lost due to noise. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points How to generate asynchronous protocol signals. In software using bit twiddling; e.g. to code a subroutine to transmit a single character (putchar) at 4800 baud: Output a low on a port pin for one baud delay (1/4800 = 208µs) to give the Start bit. DO eight times: Shift datum right and set pin high or low according to the state of the bit that pops out into the Carry flag. Wait one baud delay. Output a high on the port pin for one baud delay to give the Stop bit. A receive (getchar) subroutine is similar but waits for the line connected to a port pin to go low and then uses a ½ baud delay to find the middle point of the Start bit. The signal is then sampled eight times at baud delay intervals. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points In hardware using shift registers and logic circuitry. A dedicated circuit to do this is called a Universal Asynchonous Receiver/ Transmitter (UART). A Basic UART will have the following properties: Baud-rate generator (sometimes an external BRG needs to be used) to generate shifting pulses at the appropriate clock rate to suit the baud rate. Transmit Shift and Buffer registers to hold the datum being shifted out with a Start and Stop bit appended. Transmit Buffer Empty flag to say when the Transmit Buffer register is empty and so can be updated. Receive Shift and Buffer registers. Receive Buffer Full flag to say when a new character has been shifted in and dumped into the Buffer ready for collection. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points To transmit a character: Software checks the TBUF flag. If active try again until Buffer is empty. Copy code into the Transmit Data Buffer Register. When the actual Transmit Data Register is empty, this datum will be automatically transferred from the Buffer and the TBUF flag reset. The datum is shifted out LSB first from the TX pin after which a Start bit is sent and a Stop bit is appended at the end. To receive a character: Software checks the RBUF flag to check if the Receive Data Buffer Register is full. If not active, try again. Copy the new datum into an internal register. This will automatically deactivate the RBUF flag. When another Start pulse is sensed at the RX pin, it is shifted in, the Start and Stop bits stripped and the datum copied into the Buffer and RBUF activated. 15-Nov-18 EEE305 Microcontroller Key Points

EEE305 Microcontroller Key Points 15-Nov-18 EEE305 Microcontroller Key Points