7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.

Slides:



Advertisements
Similar presentations
EUSART Serial Communication.
Advertisements

INPUT-OUTPUT ORGANIZATION
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
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.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Serial Buses. Serial Bus Features Allows several devices to be connected to a set of common signal wires Reduces inter-connections and complexity Asynchronous.
Serial I/O - Programmable Communication Interface
Lecture 8: Serial Interfaces
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
COMP3221: Microprocessors and Embedded Systems Lecture 22: Serial Input/Output (II) Lecturer: Hui Wu Session 1, 2005.
COE 342: Data & Computer Communications (T042) Dr. Marwan Abu-Amara Chapter 6: Digital Data Communications Techniques.
USART and Asynchrono us Communica tion The USART is used for synchronous and asynchronous serial communication. USART = Universal Synchronous/Asynchronous.
Input/Output and Communication
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
Unit-5 CO-MPI autonomous
Lecture 10 Serial Communication.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
EEE305 Microcontroller Systems Lecture 7: Embedded C using PIC microcontrollers Serial i/o with the XC8 Teaching resources are at
INPUT-OUTPUT ORGANIZATION
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
Serial Communication ETEC 6416.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
4.0 rtos implementation part II
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
SC200x Peripherals Broadband Entertainment Division DTV Source Applications July 2001.
Input/Output mechanisms
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
Universal Asynchronous Receiver/Transmitter (UART)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
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.
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)
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
8251 USART.
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
Digital Logic Design Alex Bronstein
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.
Serial I/O Port.
Chapter 6 Serial Communications
Serial mode of data transfer
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Serial I/O and Data Communication.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
E3165 DIGITAL ELECTRONIC SYSTEM
Computer Organization and Design
UART Serial Port Programming
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
UART Protocol Chapter 11 Sepehr Naimi
COMP3221: Microprocessors and Embedded Systems
Programmable Data Communication Blocks
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Prof Afonso Ferreira Miguel
PIC Serial Port Interfacing
Presentation transcript:

7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data transfer occurs on clock signal – usually a clock transition  Asynchronous no shared clock signal all devices have there own clock signal all devices must use the same clock frequency clock frequencies may differ slightly between devices device clock signals are out of phase with each other – not synchronised hence the term asynchronous receiver must synchronise with transmitter in order to receive data correctly

7-2 Serial I/O configurations and standards Simple point to point communications – e.g. RS232, RS423 and RS422. Bus based with  one master and one or more slaves e.g RS485 SPI(Serial Peripheral Interface) bus – Serial data out, serial data in and serial clock) I 2 C (Inter-IC bus) Universal Serial Bus (USB)  multiple masters and one or more slaves e.g. I 2 C bus  Peer to peer arrangement e.g. CAN(Control Area Network) bus

7-3 Baud Rate Bit rate = 2 x Baud rate Note: For a binary signal Baud rate = bit rate = 1/bit time Data Time Baud rate defines the switching speed of a signal (i.e. the Baud rate indicates how often a signal changes state). Bit rate defines the rate at which information flows across a data link. measured in bits/second(bps) For a binary two-level signal, a data rate of one bit per second is equivalent to one Baud

7-4 Universal Asynchronous Receiver/Transmitter(UART) Most UARTS are full duplex – they have separate pins and electronic hardware for the transmitter and receiver that allows serial output and serial input to take place in parallel Based around shift registers and a clock signal. UART clock determines baud rate UART frames the data bits with  a start bit to provide synchronisation to the receiver  one or more (usually one) stop bits to signal end of data Most UARTs can also optionally generate parity bits on transmission and parity checking on reception to provide simple error detection. UART often have receive and transmit buffers as well as the serial shift registers

7-5 UART - Transmitter Transmitter (Tx) - converts data from parallel to serial format  inserts start and stop bits  calculates and inserts parity bit if required  output bit rate is determined by the UART clock Serial output Parallel data UART Clock from baud rate generator Status information

7-6 Asynchronous serial transmission

7-7 UART - Receiver converts serial format back to parallel data  Rx synchronises with transmitter using the start bit  samples data line at UART clock rate (normally a multiple of baud rate, typically 16)  reads value in middle of bit period (Infineon 167 uses a majority decision of the 7 th, 8 th and 9 th sample to determine the effective bit value.  calculates parity and checks against received parity bit Serial input Status information Parallel data UART Clock from baud rate generator

7-8 Asynchronous serial reception Idle waiting for start bit Start bit 1 First data bit etc. 0 Start detected

7-9 Asynchronous Usually used on simple systems Typically point to point Various different formats and protocols Normally 8bit data format with one start and one stop bit Standards: E.g. RS232 –  defines connector type, pin assignments, voltage levels, max bit rate, cable length etc.  Min. 3 pins – TxD, RxD, Ground  Other pins for data flow control. Some common baud rates - 300,1200,9600,19200

7-10 Infineon 167 Asynchronous serial channel 0 (ASC0)

7-11 ASC0 Control Register – S0CON

7-12 S0CON - contd.

7-13 S0CON - contd.

7-14 ASC0 Baud Rate Generation The serial channel ASC0 has its own dedicated 13-bit baud rate generator; basically a timer with reload capability. The baud rate generator is clocked with the CPU clock divided by 2 (f CPU /2). The timer counts downwards and can be started or stopped through the Baud Rate Generator Run Bit S0R in register S0CON. Each underflow of the timer provides one clock pulse to the serial channel. The timer is reloaded with the value stored in its 13-bit reload register each time it underflows. The resulting clock is then divided according to the operating mode and controlled by the Baudrate Selection Bit S0BRS. If S0BRS = ‘1’, the clock signal is additionally divided to 2/3rd of its frequency (see formulas and table).

7-15 ASC0 Baud Rate Generation contd. So the baud rate of ASC0 is determined by the CPU clock, the reload value, the value of S0BRS and the operating mode (asynchronous or synchronous).

7-16 Infineon ASC0 Initialisation // This is zero 0, this is 'Oh' O //initialise serial port to 9600 baud void serial_init() { P3 |= 0x0400;// SET PORT 3.10 OUTPUT LATCH (TXD) DP3 |= 0x0400; // SET PORT 3.10 DIRECTION (TXD OUTPUT) DP3 &= 0xF7FF; // RESET PORT 3.11 DIRECTION (RXD INPUT) S0TIC = 0x80; // SET TRANSMIT INTERRUPT FLAG S0RIC = 0x00; // RESET RECEIVE INTERRUPT FLAG S0BG = 0x40; // SET BAUDRATE TO 9600 BAUD S0CON = 0x8011; // SET SERIAL MODE } NOTE: The Keil 166 C compiler standard I/O functions use the ASC0 serial port i.e printf,putchar,scanf etc. will use ASC0. But the user program MUST initialise the ASC0 before any of the functions can be used.

7-17 User functions for simple polled serial I/O char getbyte (void) { char c; while (S0RIR==0); // or while(!S0RIR) c = S0RBUF; S0RIR = 0; return (c); } void putbyte (signed char c) { while (!S0TIR); S0TIR = 0; S0TBUF = c; }