Serial Communication Interface (SCI) Kevin Stuart Matt Betts March 27, 2007 ME 6405, Sp 07.

Slides:



Advertisements
Similar presentations
EUSART Serial Communication.
Advertisements

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.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Serial I/O - Programmable Communication Interface
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.
Input/Output and Communication
Harrison Jones Alexis Noel William Allen SERIAL COMMUNICATION INTERFACE (SCI)
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.
Unit-5 CO-MPI autonomous
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
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.
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)
Unit 4 Design and Synthesis of Datapath Controllers
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.
Serial Communications
Chapter 8 Serial and Parallel Port Interfacing Valvano’s Intro. To Embedded Systems.
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.
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.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
 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.
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
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
Appendix B: System Development Example MTT48 V2.1 B - 1 APPENDIX B: SYSTEM DEVELOPMENT.
HCS12 Technical Training, Rev 2.0 Module 7- SCI, Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other.
RX Serial Peripheral Interface (RSPI)
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.
ESCI Base. Serial Communication TX RX 8bits Interrupt on Receiver Full 4 Enhanced Serial Communication Interface (eSCI) in the PXR40 eSCIB is used for.
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:
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.
Input/Output and Communication
Serial I/O and Data Communication.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Computer Organization and Design
UART Serial Port Programming
Serial Communication Interface
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
SPI Protocol and DAC Interfacing
COMP3221: Microprocessors and Embedded Systems
Programmable Data Communication Blocks
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Serial Communications
Introduction Communication Modes Transmission Modes
Presentation transcript:

Serial Communication Interface (SCI) Kevin Stuart Matt Betts March 27, 2007 ME 6405, Sp 07

Types of communication 2 main types Serial Telegraph Light Signal Parallel ISDN line Factory line

Serial Communication One line of communication, long string of data Time Signal

Parallel Communication Many lines of communication, synchronized bursts of data Time TransmitterReceiver

Endianness, how it relates to communication Big Endian- MSB first, less significant bytes in descending order Little Endian- MSB last, data in ascending order Endian type determines how the data is interpreted, and how it should be sent in both serial and parallel communication.

RS232, SCI, and SPI RS232- Typical computer COM port SCI- Serial Communication interface, uses the universal asynchronous receiver/transmitter or UART SPI Serial peripheral interface, part of Port D.

Cable Length / Data Transfer Rate Relation As cable lengths increase, signal quality degrades As data transfer speed increases, signal quality degrades much faster for increasing length

Synchronous Communication Clock speed determines the data transfer rate Transmitter and receiver use the same clock to keep signal cohesive. Constantly sending data to maintain clock synchronization, including idle characters.

Asynchronous Communication Transmitter and receiver operate independently No synchronization So no idle characters HC11 uses this type of communication

Bit Rate Number of possible on/off switches per second, based on the clock. Faster clock, faster bit rate Standard bit rates Some typical bit rates

Baud Rate Number of actual data bits per second Different from Bit Rate because of required setup bits per word transmitted. Setup bits explained more later

HC11 SCI registers 5 major registers BAUD$102B SCCR1$102C SCCR2$102D SCSR$102E SCDR$102F

BAUD 0 BAUD register, sets speed TCLR : Clear baud rate timing chain bit SCP : Baud rate pre-scale select bits RCKB : Baud rate clock test bit SCR : SCI baud rate select bits Read: 00 Write:TCLRRCKB SCR1SCR0SCP00SCP1SCR2

SCCR1 SCCR1 : Serial Communication Interface Control Register 1 R8 : Receive data bit 8 T8 : Transmit data bit 8 M : SCI character length bit WAKE : Wakeup method select bit Bits & 5 are not used (always 0) Read: Write: R8 T8MWake 0000

SCCR2 SCCR2 : Serial Communication Control Register 2 TIE : Transmit interrupt enable bit TCIE : Transmit complete interrupt enable bit RIE : Receive interrupt enable bit ILIE : Idle-line interrupt enable bit TE : Transmit enable bit RE : Receive enable bit RWU : Receiver wakeup bit SBK : Send break bit Read: Write: RWUSBKTIETETCIERIEILIERE

SCSR SCI status register 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) Read: Write: TDRETCRDRFIDLEORNFFE0

SCDR SCI data register Two separate registers, same address Used to Read the Received data Used to Write the Transmit data R7 - R0 – Read bits T7 - T0 – Write bits Read: Write: R7R6R5R4R3R2R1R0 T7T6T5T4T3T2T1T0

SPCR Serial Peripheral Interface Control Register SPIE- Serial Peripheral Interrupt Enable 0 = SPI Interrupts disabled 1 = SPI Interrupts enabled Serial Peripheral System Enable 0 = SPI off 1 = SPI on DWOM – Port D Wired OR mode Option for Port D pins (PD 5:0) 0 = Normal CMOS outputs (Leave it as 0) 1 = Open Drain outputs Read: Write: SPIESPEDWOMMSTRCPHASPR1SPR0CPOL

How to set up Serial Communication on the HC11 Set Baud rate using BAUD Set interrupt states using SCCR2 Set data length using SCCR1 Make / Set routines to be jumped to when interrupt is triggered Read or Write data to the SCDR Note- Data direction register is overridden by SCI logic

UART (Universal Asynchronous Receiver/Transmitter) Beforehand Knowledge Need to know Transmitting speed (and therefore Receiving speed) Need to know packet construction (# data and formatting bits) Packet Construction: Start Bit (1 bit) Data Bits (8-9 bits) Parity Bit (1 bit) …optional Address Marker (1 bit) …optional Stop Bit (1 bit) Challenge: Noise

UART: Start Bit 1 Bit (at beginning of message) Only used due to asynchronous nature (synchronous Transmitters/Receivers don’t need start/stop bits) Opposite polarity of data-line’s idle state Idle state for HC11 = all 1’s  start bit = 0

UART: Data Bits 8-9 Bits (in middle of message) Most common mode = 8 data bits (SCCR1, M = 0) Alternative mode = 9 data bits (SCCR1, M = 1) Can be used for parity Can be used as an address marker (in “address-mark variation”)  telling a microprocessor when to sleep or wake up LSB first

UART: Parity Bit (optional) 1 Bit Located at end of data bits (It is one of the data bits.) Even Parity Parity bit = 1, if # of ones in the set is odd (you make total # even) Odd Parity Some say more reliable (guarantees at least one data transition) Parity bit = 1, if # of ones in the set is even (you make total # odd) Note: Parity can be implemented with 8 Data Bits when transmitting ASCII characters (since ASCII is represented with only 7 bits).

UART: Stop Bit 1 bit (at end of message) Only used due to asynchronous nature (synchronous Transmitters/Receivers don’t need start/stop bits) It is the polarity of data-line’s idle state Idle state for HC11 = all 1’s  stop bit = 1

Ex: Packet Format

Ex: Packet Format-ASCII character ‘H’ (without parity)

Ex: Packet Format-ASCII character ‘H’ (with even parity and odd parity)

Ex: Packet Format-ASCII character ‘l’ (with odd parity)

Ex: Packet Format-ASCII character ‘EOT’ (with odd parity)

UART: Noise Problem: A premature ‘1’ or ‘0’ can make the HC11 Receiver think that it’s receiving data before it really is or that it’s receiving incorrect data. One Solution: HC11 takes 3 samples near the middle of each bit time  majority decision Another Solution: Break Command (= all 0’s for >=1 character time, for HC11) Used to get attention of Receiver (i.e. change to default rate)

Ex: Full Transmission Format (idle line)EOT!olleH(idle line) H = 0x48 = 0b e = 0x65 = 0b l = 0x6C = 0b o = 0x6F = 0b ! = 0x21 = 0b EOT = 0x04 = 0b Packet composition = Start Bit + 9 Data Bits [+ Parity Bit (odd parity scheme) as last Data Bit] + Stop Bit Note: 9 Data Bit transmission was used (instead of 8) so that the receiver doesn’t store the parity bit in the SCDR register. (You can directly store SCDR [the ASCII values] to memory without having to take off the parity bit.)

Advanced Features of HC11 UART HC11 resynchronizes the Receiver’s bit clock on all 1-to-0 transitions (instead of just on startup) HC11 takes 3 logic-samples near the middle of each bit time (majority rules) HC11’s Receiver can enter a standby mode (“sleep mode”) HC11 has a TC (Transmit Complete) Flag …in addition to the standard TDRE (Transmit Data Register Empty) Flag.

References: M68HC11ERG/AD Reference Guide (Rev. 2, 10/2003) M68HC11 Reference Manual (Rev. 4, 2001) Section 9: p Wikipedia.org: Asynchronous Serial Communication, UART, Parity (Used to get a fundamental understanding.)