1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.

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.
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.
OUTLINE WHAT ? HOW ? WHY ? BLUEPOST Poster and Message Content Specified by the User Displaying the Poster Content on a Monitor Sending Messages to.
USART and Asynchrono us Communica tion The USART is used for synchronous and asynchronous serial communication. USART = Universal Synchronous/Asynchronous.
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
Embedded Systems Design
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.
The 8051 Microcontroller and Embedded Systems
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Unit 4 Design and Synthesis of Datapath Controllers
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.
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
The Principle of Electronic Data Serial and Parallel Data Communication Transmission Rate Bandwidth Bit Rate Parity bits.
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.
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.
Serial I/O Port.
Serial mode of data transfer
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
E3165 DIGITAL ELECTRONIC SYSTEM
DIGITAL DATA COMMUNICATION TECHNIQUES
Computer Organization and Design
UART Serial Port Programming
DIGITAL DATA COMMUNICATION TECHNIQUES
Serial Communication Interface
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
COMP3221: Microprocessors and Embedded Systems
DIGITAL DATA COMMUNICATION TECHNIQUES
Configuration and Programming
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Source: Serial Port Source:
Serial Communications
Introduction Communication Modes Transmission Modes
Presentation transcript:

1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets

2 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Presentation Outline  Types of Data Transmission Parallel Serial  Serial Communication Synchronous Asynchronous  Baud and Bit Rates  Asynchronous Serial Transmission  Serial Communication With the HC11  Examples of data words are transmitted

3 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Types of Data Transmission Parallel Data Transmission ♦Simultaneous transmission ♦Requires separate data lines ♦Bits must stay synchronized ♦Fast ♦Expensive ♦Example: Printer connections Transmitter Receiver One Word

4 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Types of Data Transmission Serial Data Transmission ♦Transfers one bit at a time ♦Requires only one data line Bits must stay synchronized ♦Slow compared to parallel transmission ♦Less Expensive ♦Example: USB Transmitter Receiver One Word

5 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Serial Data Communication ♦Two basic types of Serial Data Communication: –Synchronous Communication –Asynchronous Communication

6 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Synchronous Communication ♦Transmitter and receiver have their clocks synchronized ♦Data rates are dependent on clock rates ♦Continuously transmitting characters to remain in sync.

7 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Communication ♦NO synchronization –No need to send idle characters ♦Transmitter and receiver operate independently –Transmitter can send data at any time –Receiver is always ready to accept data ♦Requires a start and stop bit to identify each byte of data ♦How does receiver know that data is arriving? –If the line is idle, it is sending a constant ‚1‘ (mark state) –The receiver is able to recognize a jump from ‚1‘ to ‚0‘ with the start bit and is alerted that data is about to be sent.

8 October 26, 2006ME 6405 MechatronicsSerial Communication Interface BIT RATE (Bit/s) ♦Number of data bits (High/Low V) transmitted per second. Example of Windows Bit Rates

9 October 26, 2006ME 6405 MechatronicsSerial Communication Interface BAUD RATE (Bd) ♦Rate of “Symbol” transfer ♦Each symbol > 1 bit ♦Symbol type and size determined by quality of hardware

10 October 26, 2006ME 6405 MechatronicsSerial Communication Interface BAUD RATE (Bd) Example Calculations ♦Consider baud rate: 4800 baud ♦12 bits/word = 1 start bit + 8 data bits + 1 parity bit + 2 stop bits –Bit time = 1/(baud rate) = 1/4800baud = 0.208ms/bit –Word time = (12 bits)*(bit time) = 2.5ms –Word rate = 1/(word time) = 400 words/s –Bit rate = (word rate)*(8 data bits) = 3200 bits/s

11 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission ♦Bits are transmitted in a specified format ♦Defined by settings on transmitter and receiver: -Start Bit -Data Bits -Parity Bits -Stop Bits Example of Windows setting

12 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission One Data Package ♦Four parts per package Start Bit Data Bit 0 Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7 Parity Bit Stop Bits (2) HIGH LOW

13 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission Start Bits ♦Start bit drops from 1 to 0 to signal start of transmission Start Bit Previously HIGH Now LOW

14 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission Data Bits ♦The content of the package ♦Usually 8 bits ♦LSB sent First Ex: This transmitted word is , or $B9 Data Bit 2 Data Bit 0 Data Bit 1 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7 LSBMSB FLOW

15 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission Parity Bit ♦ Used to check for errors ♦ Helps verify signal integrity ♦ 2 Types: -Even: makes sum of all bits INCLUDING parity bit EVEN -Odd: makes sum of all bits INCLUDING parity bit ODD ♦ Not applicable to HC11 Data Bit 7 Parity Bit (H or L)

16 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission Stop Bit ♦ Stop bit indicates all data has been transferred ♦ 1 or 2 Stop bits Stop Bit 1 Stop Bit 2 Parity or Bit 7

17 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Asynchronous Serial Transmission Noise ♦ Causes errors in reading data ♦ Start bit is misread and begins reading too early Start Bit NOISE Goes LOW Stop Bit

18 October 26, 2006ME 6405 MechatronicsSerial Communication Interface HC11 SCI Registers ♦5 Main Registers: –BAUD: Sets bit rate for SCI –SCCR1: Sets control bits for the 9-bit character format and the receiver wake up feature –SCCR2: Main control register –SCSR: Status Register –SCDR: Main Data Register

19 October 26, 2006ME 6405 MechatronicsSerial Communication Interface HC11 SCI Registers BAUD Register ♦ Used to set the bit rate of the SCI system – TCLR: Clear baud rate timing chain bit – SCP1: SCP0 – Baud rate pre-scale select bits – RCKB: SCI baud rate clock test bit – SCR2: SCR0 – SCI baud rate select bits Address:$102B Bit Bit 0 Read: 00 Write: TCLRRCKB Reset:00000UUU U = Unaffected SCR1SCR0SCP00SCP1SCR2

20 October 26, 2006ME 6405 MechatronicsSerial Communication Interface HC11 SCI Registers SCCR1 Register ♦ Contains control bits related to the 9-bit data character format and the receiver wake up feature – R8: Receive data bit 8 – T8: Transmit data bit 8 – M: SCI character length bit – WAKE: Wakeup method select bit – Bits 0, 1, 2 & 5: Not used (always 0)

21 October 26, 2006ME 6405 MechatronicsSerial Communication Interface HC11 SCI Registers 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 –ILIE: Idle-line interrupt enable bit –TE: Transmit enable bit –RE: Receive enable bit –RWU: Receiver wakeup bit –SBK: Send break bit

22 October 26, 2006ME 6405 MechatronicsSerial Communication Interface HC11 SCI Registers SCSR Register ♦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)

23 October 26, 2006ME 6405 MechatronicsSerial Communication Interface HC11 SCI Registers SCDR Register ♦SCI data register – Two separate registers – When SCDR is read, the read-only RDR is accessed – When SCDR is written, the write-only TDR is accessed – R7 - R0: Read bits – T7 - T0: Write bits

24 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Auxiliary Port D ♦SCI uses the 2 least significant bits of Port D ♦These bits are used for receiving and transmitting data ♦Data direction register does not control Port D while SCI is in use but it is important since it will have control when the SCI operation is aborted ♦SPCR register controls the Port D wire-OR mode bit, which controls the driver functions of the Port D pins, even if they are being used by the SCI

25 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Wake Up ♦M68HC11 supports a receiver wake up function, which is intended for systems having more than one receiver ♦The transmitting device directs messages to an individual receiver or group of receivers by passing addressing information in the initial byte ♦Receivers not addressed activate the receiver wakeup function –This makes these receivers dormant for the remainder of the unwanted message ♦Wake up mode is enable by writing a 1 to the RWU bit in the SCCR2 register

26 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Wake Up ♦Two methods of Wakeup –Address-Mark Wakeup Most significant bit is used to indicate if the message is data(0) or address(1) All receivers wake up if the bit is 1 and check to see if the message is for them ♦Send Breaks –Break characters are character-length periods where the TxD line goes to 0 –Character length is influenced by the M bit in the SCCR1 M = 0 – All characters are 10 bit times long M = 1 – all characters are 11 bit times long –Break characters have no start and stop bits

27 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Examples of SCI Transmit - Configuration MAIN EQU $1040 SCCR2 EQU $102D BAUD EQU $102B SCSR EQU $102E SCDR EQU $102D Assemble code starting here Address of SCI control register 2 Address of Baud rate control register Address of SCI status register Address of SCI data register ♦ Let’s say we want to transmit hex number 2C at a Baud rate of 1200 ♦ First set up variables and set Baud rate:

28 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Examples of SCI Transmit – Set Baud Rate ♦How to set the Baud rate: –Crystal Frequency = 8 MHz –First, set BAUD bits SCP2 =1 and SCP1 = 1 Divides crystal freq. by 13 8 MHz ÷ 13 ≈ 9600 –Then set SCR2 = 0, SCR1 = 1, SCR0 = 1 Divides result by ÷ 8 = 1200 See tables on P ! TCLRSCP2SCP1SCP0RCKBSCR2SCR1SCR0 BAUD

29 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Examples of SCI Transmit ! ORG MAIN LDAA #$33 STAA BAUD LDAA #$08 STAASCCR2 LOOP LDAA #$2C STAA SCDR CHECK LDAA SCSR ANDA #$C0 CMPA #$C0 BNE CHECK SWI This sets bits like in last slide Write to the Baud register Set the Transmit Enable bit high Write to SCCR2 Put you data to transmit here Store it in the SCI data register Load the status register to Acc A Check to see if Transmit Complete flag is set If it is not, loop and keep checking If it is, we’re done

30 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Examples of SCI Receive- Configuration ♦Once again, Baud rate of 1200 ♦Set up things in a similar way: MAIN EQU $1041 SCCR2 EQU $102D BAUD EQU $102B SCSR EQU $102E SCDR EQU $102F STORE EQU $1040 Assemble code starting here Address of SCI control register 2 Address of Baud rate control register Address of SCI status register Address of SCI data register Address of place to store incoming data

31 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Examples of SCI Receive! ORG MAIN LDAA #$33 STAA BAUD LDAA #$04 STAA SCCR2 CHECK LDAA SCSR ANDA #$20 CMPA #$20 BNE CHECK LDAA SCDR STAA STORE SWI This sets bits like in previous slide Write to the Baud register Set the Receive Enable bit high Write to SCCR2 Load the status register into Acc A Check to see if RDRF flag is set (Receive Data Register Full) If not, keep checking until it is When data has been received, store it

32 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Questions ?