Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

I/O Interfaces.
Serial I/O - Programmable Communication Interface
Lecture 8: Serial Interfaces
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
PH4705 ET4305 Interface Standards A number of standard digital data interfaces are used in measurement systems to connect instruments and computers for.
Hierarchy of I/O Control Devices
Spring EE 316 Computer Engineering Junior Lab Serial Ports.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Memory-Mapped I/O, Bus Architectures January 20, 2015.
Input/Output and Communication
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
INPUT-OUTPUT ORGANIZATION
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses Oct 6, 2011.
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 7: Finish interrupts, group talks, start on serial buses Sept.
ECE 265 – LECTURE 12 The Hardware Interface 8/22/ ECE265.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
4.0 rtos implementation part II
The 8051 Microcontroller and Embedded Systems
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK–
Input/Output mechanisms
UART and UART Driver B. Ramamurthy.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
MICROPROCESSOR INPUT/OUTPUT
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 7: Finish interrupts, group talks, start on serial buses Feb.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Universal Asynchronous Receiver/Transmitter (UART)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Embedded System Design Laboratory October 4, 2002Stanford University - EE281 Lecture #3#1 Lecture #3 Outline Announcements AVR Processor Resources –UART.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted.
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.
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Serial buses, digital design Material taken from Dutta, Le, Ramadas,
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Embedded Communication Protocols Don Heer 10/18/10 1.
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 9 Serial Buses – SPI, I2C.
Networked Embedded Systems Pengyu Zhang & Sachin Katti EE107 Spring 2016 Lecture 4 Timers and Interrupts.
8251 USART.
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
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.
FPGA Configuration Chris Stinson, 1998.
Microprocessor Systems Design I
Slides developed in part by Mark Brehob & Prabal Dutta
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Input/Output and Communication
Diagram of microprocessor interface with IO devices
I/O Memory Interface Topics:
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
CS703 - Advanced Operating Systems
Atmega32 Serial Programming Basics
Computer Organization and Design
EECS 373 Design of Microprocessor-Based Systems Mark Brehob
Introduction to Microprocessors and Microcontrollers
Преглед Начин функционисања Имплементације
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Presentation transcript:

Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses

In Assignment 2 … You will implement drivers for two serial buses USART driver to connect the microprocessor to the PC SPI driver to talk to Digital potentiometers SD card (optional)

This Week: Serial interfaces 3 Timers CPU Software Hardware Internal External Input System Buses AHB/APB ldr (read) str (write) ISA USART DAC/ADC Internal & External Memory GPIO/INT Output Interrupt Compare Capture I2C SPI UART ADC DAC C Assembly Machine Code Interrupts interrupts EMC SVC # fault traps & exceptions INT#

Outline Introduction to Serial Buses UART SPI I2C 4

Parallel Bus VS Serial Bus

Serial bus interface motivations Motivation Without using a lot of I/O lines I/O lines require I/O pads which cost $$$ and size I/O lines require PCB area which costs $$$ and size Connect different systems together Two embedded systems A desktop and an embedded system Connect different chips together in the same embedded system MCU to peripheral MCU to MCU Often at relatively low data rates But sometimes at higher data rates So, what are our options? Universal Synchronous/Asynchronous Receiver Transmitter Also known as USART (pronounced: “you-zart”) 6

Serial bus design space Number of wires required? Asynchronous or synchronous? How fast can it transfer data? Can it support more than two endpoints? Can it support more than one master (i.e. txn initiator)? How do we support flow control? How does it handle errors/noise? How far can signals travel? 7

How can we handle multiple (potential) bus drivers? (1/3) Tri-state devices, just have one device drive at a time. Everyone can read though Pros: Very common, fairly fast, pin- efficient. Cons: Tri-state devices can be slow. Need to be sure two folks not driving at the same time Let out the magic smoke. Most common solution (at least historically) Ethernet, PCI, etc.

How can we handle multiple (potential) bus drivers? (2/3) MUX Just have each device generate its data, and have a MUX select. That’s a LOT of pins. Not generally realistic for an “on-PCB” design as we’ll need an extra device (or a lot of pins on one device) But reasonable on-chip In fact AHB, APB do this.

How can we handle multiple (potential) bus drivers? (3/3) “pull-up” aka “open collector” aka “wired OR” Wire is pulled high by a resistor If any device pulls the wire low, it goes low. Pros: If two devices both drive the bus, it still works! Cons: Rise-time is very slow. Constant power drain. Used in I2C, CAN

Outline Introduction to Serial Buses UART SPI I2C 11

UART Uses PC serial port is a UART! Serializes data to be sent over serial cable De-serializes received data Slides from BYU CS 224

UART Uses Used to be commonly used for internet access Slides from BYU CS 224

UART Universal Asynchronous Receiver/Transmitter Hardware that translates between parallel and serial forms Commonly used in conjunction with communication standards such as EIA, RS-232, RS-422 or RS

Protocol Each character is sent as a logic low start bit a configurable number of data bits (usually 7 or 8, sometimes 5) an optional parity bit one or more logic high stop bits with a particular bit timing (“baud”) 15

UART Example Send the ASCII letter ‘W’ ( )

UART Hardware Connection

UART Character Reception Slides from BYU CS 224

UART Character Reception Slides from BYU CS 224

UART Character Reception Slides from BYU CS 224

UART Character Reception Receiver also verifies that stop bit is ‘1’ If not, reports “framing error” to host system New start bit can appear immediately after stop bit Receiver will resynchronize on each start bit

Let us design a UART transmitter Slides from BYU CS 224

Transmitter/System Handshaking Slides from BYU CS 224 System asserts Send and holds it high when it wants to send a byte UART asserts Busy signal in response When UART has finished transfer, UART de-asserts Busy signal System de-asserts Send signal

Transmitter Block Diagram Slides from BYU CS 224

Discussion Questions How fast can we run a UART? What are the limitations? Why do we need start/stop bits? How many data bits can be sent? baud rate, no parity, 8 data bits, 1 stop bit 25