SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes.

Slides:



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

EUSART Serial Communication.
Serial Communication Interface (SCI)
INPUT-OUTPUT ORGANIZATION
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
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.
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)
Local Asynchronous Communication
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)
Serial Communication ETEC 6416.
Input/Output mechanisms
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Unit 4 Design and Synthesis of Datapath Controllers
Lecture 14 DMA Controller & Serial Communications Interface (UART)
Universal Asynchronous Receiver/Transmitter (UART)
Serial I/O and the HC11. Overview General discussion of serial I/O operations oSynchronous vs. asynchronous operations oBaud rate vs. bit rate oTransmission.
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.
NS Training Hardware. Serial Controller - UART.
Universal Asynchronous Receiver/Transmitter (UART)
Serial Communication Interface Ta Kim Nicholas Earnhart Razid Ahmad ME 6405 – Fall 2008 November 6, 2008.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
The Serial Communication Interface (SCI) MC9S12-C32
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
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.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
ESCI Base. Serial Communication TX RX 8bits Interrupt on Receiver Full 4 Enhanced Serial Communication Interface (eSCI) in the PXR40 eSCIB is used for.
FUNDAMENTALS OF NETWORKING
Unit 1 Lecture 4.
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:
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.
Serial mode of data transfer
CS-401 Computer Architecture & Assembly Language Programming
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
COMP3221: Microprocessors and Embedded Systems
Configuration and Programming
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Serial Communications
Introduction Communication Modes Transmission Modes
Presentation transcript:

SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes

The outline of the presentation. Serial vs. Parallel Communication Synchronous vs. Asynchronous Serial Communication Baud and Bit Rates Asynchronous Serial Communication  Emphasis on HC11 implementation Explicit Outline of Data Transmission Process

Motivation. Suppose two devices need to communicate with one another…how can this be done? (a) Telephone (b) Smoke signals (c) Pony Express (d) Serial Communication

There are two major communication methods. Serial  One bit at a time on one data line  Slower than parallel transmission  Inexpensive  Example: modem, USB Parallel  N bits at a time over N data lines  Synchronization among all N bits  Faster than serial transmission  More expensive  Example: printer connections

Serial Parallel Transmitter Receiver 2 nd word 1 st word Transmitter Receiver 2 nd word 1 st word Hmm…how do I know where to start?

There are two breeds of serial communication. Synchronous  Additional clock signal to keep sync.  Bit transfer rate determined by the clock signal  Continuously transmitting characters to remain in sync. Asynchronous  No clock signal, intermittent data transfer  Uses fixed-size packets to keep sync.  Bit transfer rate preset by programmer  Transmission data contains information to synchronize receiver when receiving data

More on data transfer rates. Baud rate: net number of bits per second that can be transmitted, including overhead (start/stop/parity bits). Bit rate: number of data bits per second that can be transmitted.

Asynchronous Communication Most common form of serial communication Data is carried in fixed-size ‘packets’  Usually 8 data bits for word length  Bits are followed by a parity bit (optional) to verify signal integrity  Packet is surrounded by a start bit and stop bits (both zeros)

Asynchronous communication: anatomy of total data package Start BitData Bit 0Data Bit 1 Data Bit 2Data Bit 3Data Bit 4Data Bit 5Data Bit 6Data Bit 7 Parity BitStop Bit x52 start stop parity Bitstream was high before start bit

Start BitData Bit 0Data Bit 1 Data Bit 2Data Bit 3Data Bit 4Data Bit 5Data Bit 6Data Bit 7 Parity BitStop Bit x52 start stop parity If the Baud rate was set at 9600, then bitrate is 8/12*9600 = 6400 bps.

So what about that parity bit? Used to help verify signal integrity Even parity  Parity bit set or cleared such that the sum of all high bits (including the parity bit itself) is even Odd parity  Parity bit set or cleared such that the sum of all high bits (including the parity bit itself) is odd

More about parity. The type of parity is known a priori (determined by programmer) Parity bit calculated and set by software before transmission e.g. the HC11 knows nothing about parity Not used very often…better ways to check for errors…

An example of even parity. Start BitData Bit 0Data Bit 1 Data Bit 2Data Bit 3Data Bit 4Data Bit 5Data Bit 6Data Bit 7 Parity BitStop Bit x52 start stop parity ??????

Start bit—Ideal Case Receiver Idle

HC11’s got your back. Length (Time) of one serial bit Data receiving aborted!!!

Noise in action. Noise causes start bit to be detected too soon RT1, RT5 and RT7 are 0, so start will be accepted (majority rules) RT3 is 1, so noise flag will be set Period determine by baud rate Period determine by clock frequency (fixed)

The details of asynchronous serial data transmission on the 68HC11. 4 control and status registers:  BAUD – Sets the bit rate for the SCI system  SCCR1 – Sets control bits for the 9-bit character format and the receiver wake up feature  SCCR2 – Main control register for the SCI sub- system  SCSR – Status register for the SCI system 1 data register:  SCDR – Main data register for the SCI system Port D, pins 0 and 1 contain SCI Input/Output

SCDR Register SCI data register  Two separate registers, same address  Use it to Read the Received data  Use it to Write the Transmit data  R7 - R0 – Read bits  T7 - T0 – Write bits

SCCR1 Register Contains control bits to set Word length and Wakeup feature  M – SCI character length bit (to send either 8 or 9 bits)  R8, T8 – Receive and Transmit data bit 8 (for Parity)  WAKE – Wakeup method select bit  Bits 0:2 & 5 are not used (always 0) Parity bit can go here (optional)

SCCR2 Register Main control register for SCI sub-system  TIE – Transmit interrupt enable bit  TCIE – Transmit complete interrupt enable bit  RIE – Receive interrupt enable bit (Receive Data Register Full)  ILIE – Idle-line interrupt enable bit  TE – Transmit enable bit  RE – Receive enable bit  RWU – Receiver wakeup bit  SBK – Send break bit

SCSR Register SCI status register. Used for system interrupt.  TDRE – Transmit data register empty bit  TC – Transmit complete bit  RDRF – Receive data register full bit  IDLE – Idle-line detect bit  OR – Overrun error bit  NF – Noise flag  FE – Framing Error bit  Bit 0 is not used (always 0) Should be “0s” after data is received Will be “1” after data is received

The BAUD register BAUD register  TCLR – Clear baud rate timing chain bit  SCP[2:0]– Baud rate pre-scale select bits  RCKB –Baud rate clock test bit  SCR[2:0]– SCI baud rate select bits Address:$102B Bit Bit 0 Read: 00 Write: TCLRRCKB Reset:00000UUU U = Unaffected SCR1SCR0SCP00SCP1SCR2

Set Baud rate of transmitter  Must match Receiver Set M bit of SCCR1 for 8 or 9 bit data  Must match Receiver Set TE bit of SCCR2 high to enable transmitter Set Baud rate of receiver  Must match Transmitter Set M bit of SCCR1 for 8 or 9 bit data  Must match Transmitter Set RE bit of SCCR2 high to enable receiver How to Send and Receive Data Transmitter Receiver

Activate WAKE condition in SCCR1 register Load data character into SCDR When TDRE bit of SCSR register goes high, the SCDR register is clear and another character can be loaded Set WAKE bit on SCCR1 RDRF bit of SCSR set when all data has entered RDR Read data from RDR and Store Check flags (NF, FR, OR) for possible error protocols How to Send and Receive Data Transmitter Receiver

When TC bit of SCSR register goes high, transmit buffer clear Transmitter resumes Idle by sending stream of “1s” Receiver returns to wake/sleep mode previously set How to Send and Receive Data Transmitter Receiver

This program can be used to send data. * * Test program for transmitting for serial data. User * specifies 8-bit data. See below. * MAIN EQU $1040 *Assemble code here starting at $1040 PORTC EQU $1003 *Equate PORTC to $1003 DDRC EQU $1007 *Equate data direction register DDRC SCCR2 EQU $102D *Equate SCI control register 2 BAUD EQU $102B *Equate BAUD register SCSR EQU $102E *Equate SCI status register SCDR EQU $102F *Equate SCI data register *===========================PROGRAM========================================== ORG MAIN LDAA #$33 *Select 1200 baud. Refer to Pink book P9-7 STAA BAUD LDAA #$08 *Enable TX and RX STAA SCCR2 LOOP LDAA #$05 *Put data into TXD for transmission. User *specify data here! STAA SCDR *Put transmit data into SCI data register CHECK LDAA SCSR *Check to see if data has been transferred ANDA #$C0 CMPA #$C0 BNE CHECK BRA LOOP *Do it again

This program can be used to receive data. * * Test program for serial receive using MING RF Rx module. MCU waits for data * and then outputs received data to PORT C. Connect LEDs to PORT C to see the * 8-bit data that has been received. * MAIN EQU $1040 *Assemble code here starting at $1040 PORTC EQU $1003 *Equate PORTC to $1003 DDRC EQU $1007 *Equate data direction register DDRC SCCR2 EQU $102D *Equate SCI control register 2 BAUD EQU $102B *Equate BAUD register SCSR EQU $102E *Equate SCI status register SCDR EQU $102F *Equate SCI data register *===========================PROGRAM========================================== ORG MAIN LDAA #$FF *Load ACCA with $FF to config PORTC as input STAA DDRC LDAA #$33 *Select 1200 baud. Refer to Pink book P9-7 STAA BAUD LDAA #$04 *Enable RX STAA SCCR2 CHECK LDAA SCSR *Check to see if data has been received ANDA #$20 CMPA #$20 BNE CHECK *Branch back up to check if not received LDAA SCDR STAA PORTC *Send data to PORT C. Use LEDs on PORT C *to display received data. BRA CHECK *Repeat process *============================================================================