Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

EUSART Serial Communication.
Serial Communication Interface (SCI)
INPUT-OUTPUT ORGANIZATION
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
H. Huang Transparency No.9-1 The HCS12/MC9S12 Microcontroller Copyright © 2010 Delmar Cengage Learning Chapter 9: Serial Communication Interface – SCI.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Serial I/O - Programmable Communication Interface
Hierarchy of I/O Control Devices
Serial Communication Interface
COMP3221: Microprocessors and Embedded Systems Lecture 22: Serial Input/Output (II) Lecturer: Hui Wu Session 1, 2005.
USARTS CS423 Dick Steflik. USART ● Universal Synchronous Asynchronous Receiver Transmitter ● used to send and receive small packets over a serial line.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Harrison Jones Alexis Noel William Allen SERIAL COMMUNICATION INTERFACE (SCI)
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
INPUT-OUTPUT ORGANIZATION
Serial Communication Interface (SCI) Kevin Stuart Matt Betts March 27, 2007 ME 6405, Sp 07.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
Computers in Surveying SVY2301 / E4006 Automated Surveying.
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Universal Asynchronous Receiver/Transmitter (UART)
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
Chapter 8 Serial and Parallel Port Interfacing Valvano’s Intro. To Embedded Systems.
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
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)
Serial Communication Interface Ta Kim Nicholas Earnhart Razid Ahmad ME 6405 – Fall 2008 November 6, 2008.
CE-2810 Dr. Mark L. Hornick 1 Using the USART Configuration and Programming.
Asynchronous Serial I/O Unit 12 - Part 1. SCI Registers – Channel 0 SCI0BDH – SCI Baud Rate Register High Byte SCI0BDL – SCI Baud Rate Register Low.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
The Principle of Electronic Data Serial and Parallel Data Communication Transmission Rate Bandwidth Bit Rate Parity bits.
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
ESCI Base. Serial Communication TX RX 8bits Interrupt on Receiver Full 4 Enhanced Serial Communication Interface (eSCI) in the PXR40 eSCIB is used for.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
FUNDAMENTALS OF NETWORKING
Unit 1 Lecture 4.
Embedded Systems February 10, Serial Interface - SPI  Serial Peripheral Interface  Synchronous communications  Clock supplied by the Master.
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.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes.
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.
Types of format of data transfer
Serial mode of data transfer
6.1 Communication Methods
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
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
Serial Communication Interface
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
UART Protocol Chapter 11 Sepehr Naimi
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.
Serial Communications
Introduction Communication Modes Transmission Modes
Presentation transcript:

Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen

Overview  Types of Data TransmissionMichael Lennard Parallel Serial  Serial Communication Synchronous Asynchronous  Baud and Bit Rates  Asynchronous Serial TransmissionZachary Peters  Serial Communication With the HCS12Bao Nguyen  Examples of data words are transmitted

Parallel Data Transmission  Simultaneous transmission  Requires separate data lines  Uses a clock to keep bits synchronized  Fast but Expensive  Requires short cables to prevent Cross-Talk/Skewing  Example: Printer Cable Presenter: Michael Lennard Transmitter Receiver One ‘Word’

Serial Data Transmission  One bit sent at a time  Slow compared to Parallel  Requires only a single transmission line & port  Cheap!  Can often be clocked faster than parallel data  Example: USB, Firewire, Ethernet Presenter: Michael Lennard Transmitter Receiver One Word

Serial Data Transmission  Two Basic Types of Serial Data Transmission  Synchronous  Asynchronous  Two solutions to same problem - Receiver needs to know  When data starts  When data stops  If data was processed correctly Presenter: Michael Lennard

Synchronous Serial Communication  Transmitter and Receiver have synchronized clocks  Continuous data must be sent to maintain synchronization  Any data not on a clock cycle is considered noise  Establish transmission parameters before sending data  30% faster than asynchronous transmission for large continuous blocks of data Presenter: Michael Lennard Transmitter Receiver Data Clock Ticks 123

Asynchronous Serial Communication  Transmitter & Receiver are independent  Transmitter sends ‘Start’, ‘Stop’ and ‘Parity’ bits with each word of data  Simpler to implement and less expensive than synchronous  Data received between a Stop bits and the next Start bit is ignored Presenter: Michael Lennard Transmitter Receiver Data Word ParityStop Start

Baud Rate vs. Bit Rate  Baud Rate (Bd) is the rate at which Symbols (Signaling Events) are transferred  Number of bits per Symbol is Hardware Specific  Our hardware uses just 1 ’s and 0’s and thus just 1 bit/Symbol  Bit rate is the absolute rate at which bits are transmitted  Can be changed for each port Presenter: Michael Lennard

Baud Rate vs. Characters Per Second Presenter: Michael Lennard

Example Problem  You have an asynchronous serial connection with 2 bits/Symbol and a 9600 bd line speed. You want to send data in an 8 bit data format with 1 parity, 1 start bit and 1 stop bit. Calculate the throughput in cps. Presenter: Michael Lennard

Overview  Types of Data TransmissionMichael Lennard Parallel Serial  Serial Communication Synchronous Asynchronous  Baud and Bit Rates  Asynchronous Serial TransmissionZachary Peters  Serial Communication With the HCS12Bao Nguyen  Examples of data words are transmitted

Asynchronous Serial Communication  Transmitter and Receiver Operate independently  Transmitter sends data at any time  Receiver is always ready to accept data  No need for clock signals  However… format and transfer rate must match during transmission Presenter: Zachary Peters

Asynchronous Transmission  Data word contains information before and after that specifies the beginning and end of word  This synchronizes transmitter and receiver during transmission  Bit transfer rate is determined by programmer, but limited by interfaces Presenter: Zachary Peters

Data Format  Start bit – indicates the beginning of word  Data bit – data user is transmitting  Parity bit – checks integrity of data  Stop bit – indicates the end of the word Presenter: Zachary Peters

Start Bit  Opposite polarity from idle bit state  Idle state for HCS12 = all 1’s so start bit = 0  Alerts receiver that the data transmission is about to begin  Accuracy verification methods to reduce noise (discussed later) Presenter: Zachary Peters

Data Bits  Actual Data being sent or received plus parity bit  Most common mode: 8-bit transmission  Used for ASCII character transmission (ASCII code is 7-bit + 1 parity bit = 8-bit)  Less common mode: 9-bit transmission  Can be used to send a full byte of data + parity bit  Example: sending an address  LSB transmitted first Presenter: Zachary Peters

Data Bits  Example:  8-bit mode: ASCII Code in Data  “T”  9-bit mode: Hex equivalent in Data  $2B Presenter: Zachary Peters Data Start Bit Stop Bits Parity Bit Data Start Bit Stop Bits Parity Bit

 1 Bit  Located at end of data bits  Used as a method of ensuring proper data transmission  Even Parity  Parity bit = 1, if # of ones in the set is odd (makes the total # of ones even)  Odd Parity  Parity bit = 1, if # of ones in the set is even (makes the total # of ones odd) Presenter: Zachary Peters

Stop Bit  1 or 2 bits  Only used due to asynchronous nature (Synchronous transmitters/receivers don’t need start/stop bits)  Occurs directly after the parity bit  Bit is the same as the polarity of the data-line’s idle state  Idle state for HCS12 = all 1’s so stop bits = 1 Presenter: Zachary Peters

Noise Detection  Problem:  A premature bit (1 or 0) can cause the receiver to think it is receiving data before it should be, or receive incorrect data  Solution: Sample at higher freq than baud rate and take “average” of samples  RT Clock = Baud rate * 16  16 samples of each bit  RT3, RT5, RT7 are recorded Presenter: Zachary Peters

Noise Detection for Start Bit  Samples taken after the signal falls to 0 to verify if it is indeed a start bit  If two ‘1’s in sample then not a start bit  If one ‘1’ in sample then noise bit flagged Presenter: Zachary Peters

Overview  Types of Data TransmissionMichael Lennard Parallel Serial  Serial Communication Synchronous Asynchronous  Baud and Bit Rates  Asynchronous Serial TransmissionZachary Peters  Serial Communication With the HCS12Bao Nguyen  Examples of data words are transmitted

SCI Baud Rate Registers SCIBDH & SCHBDL - $00C8-$00C9  13-Bit register determines SCI Baud rate  Baud rate generator is Disabled until TE or RE bit is set for the first time after reset.  Baud rate generator is turned off when this register contains $0000  Note: Writing to SCIBDH has no effect w/out writing to SCIBDL Presenter: Bao Nguyen

SCI Control Register 1 SCICR1 - $00CA Presenter: Bao Nguyen  LOOPS (loop operation enable) – 0: Normal, 1: Loop Operation  SCISWAI (SCI wait mode enable) – 0: Off 1: On  M (data format mode) – 0: 8 data bits, 1: 9 data bits. Both use 1 start bit and 1 stop bit  PE (parity enable) – 0: Off, 1: On  PT (parity type) – 0: Even, 1: Odd

SCI Control Register 2 SCICR2 - $00CB  TIE (transmit interrupt enable) – 0: disables interrupts for transmit data register empty, 1: enables  TCIE (transmit complete interrupt enable) – 0: disables interrupts for transmit complete, 1: enables  RIE (receiver interrupt enable) – 0: disables interrupts for receiver full and overrun, 1: enables  ILIE (idle line interrupt enable) – 0: disables interrupts for idle line, 1: enables  TE (transmit enable) – 0: disable transmitter, 1: enable  RE (receiver enable) – 0: disable receiver, 1: enable Presenter: Bao Nguyen

SCI Status Register 1 SCISR1 - $00CC  Read only register  Can be used to provide input to the microcontroller for generation of SCI interrupts  TDRE (transmit data register empty) – 0: No byte transferred,1: byte successfully transferred to transmit shift register  TC (transmit complete flag) – 0: transmission in progress, 1: no transmission in progress  RDRF (receive data register full) – 0: no data in data register, 1: data in data register  IDLE (idle flag) – 0: receiver input is active, 1: receiver input has become idle Presenter: Bao Nguyen

SCI Status Register 2 SCISR2 - $00CD  BK13 (break transmit character length) – 0: 10 or 11 bit, 1: 13 or 14 bit  TXDIR (transmitter pin direction) – 0: TXD pin used as input, 1: TXD pin used as output. (used only in single wire mode)  RAF (receiver active flag) – 0: no reception in progress, 1: reception in progress Presenter: Bao Nguyen

SCI Data Registers SCIDRH &SCIDRL - $00CE - $00CF  SCIRDL contains incoming bytes of data from serial port  R8 – bit 8 of received 9-bit data  T8 – bit 8 of transmitted 9-bit data Presenter: Bao Nguyen

Asynchronous Data Transmission  Example 1:  Hex# 4A 16 is to be sent with one start bit, even parity, 8-bit data length and two stop bits  4A 16 =  Note: Little endian communication used (LSB sent first) Start BitData Bit 0Data Bit 1 Data Bit 2Data Bit 3Data Bit 4Data Bit 5Data Bit 6Data Bit 7 Parity BitStop Bit Presenter: Bao Nguyen

Asynchronous Data Transmission  Example 2:  Hex# B4 16 is to be sent with one start bit, even parity, 8-bit data length and two stop bits  B4 16 = Start BitData Bit 0Data Bit 1 Data Bit 2Data Bit 3Data Bit 4Data Bit 5Data Bit 6Data Bit 7 Parity BitStop Bit Presenter: Bao Nguyen

Asynchronous Data Transmission  Example 3:  Hex# B4 16 is to be sent with one start bit, odd parity, 8-bit data length and two stop bits  B4 16 = Start BitData Bit 0Data Bit 1 Data Bit 2Data Bit 3Data Bit 4Data Bit 5Data Bit 6Data Bit 7 Parity BitStop Bit Presenter: Bao Nguyen

Thank You! Any Questions?