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.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
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
COMP3221: Microprocessors and Embedded Systems Lecture 22: Serial Input/Output (II) Lecturer: Hui Wu Session 1, 2005.
Chapter 9 Serial Communication Interface  SCI. Why Serial Communication? Parallel data transfer requires many I/O pins. This requirement prevents the.
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.
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 7 Universal Asynchronous Receiver/Transmitter (UART) NCHUEE 720A Lab Prof. Jichiang Tsai.
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
Universal Asynchronous Receiver/Transmitter (UART)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Serial Communications
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
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.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
PPI-8255.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
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.
The 8085A is a general-purpose microprocessor with low hardware overhead requirements. Within the 8085A are contained the functions of clock generation,
Why are Timer Functions Important?
Serial Communications
Serial I/O Port.
Serial mode of data transfer
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Source: Serial Port Source:
Input/Output and Communication
Chapter 11: Inter-Integrated Circuit (I2C) Interface
Presented By: Navneet Kaur Randhawa Lect. I.T. Deptt. GPC,Amritsar
Diagram of microprocessor interface with IO devices
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
Introduction to Micro Controllers & Embedded System Design I/O Processing and Serial Port Operation Department of Electrical & Computer Engineering Missouri.
Computer Organization and Design
Source: Serial Port Source:
UART Serial Port Programming
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
COMP3221: Microprocessors and Embedded Systems
Programmable Data Communication Blocks
8051 Micro Controller.
Source: Serial Port Source:
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
EUSART Serial Communication.
Source: Serial Port Source:
PIC Serial Port Interfacing
PIC Serial Port Interfacing
Introduction Communication Modes Transmission Modes
Presentation transcript:

Copyright@2005 Thompson Learning

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 block diagram is shown in Figure 9.7. The SCI uses the data format of one start, eight or nine data bits, and one stop bit. The collection of the start bit, eight or nine data bits, and the stop bit is called a frame. The SCI function supports parity checking. This option requires the use of 9-bit data format. One SCI channel uses two signal pins from Port S. The SCI0 shares the use of PS0 (RxD0) and PS1 (TxD0), whereas SCI1 shares the use of PS2 (RxD1) and PS3 (TxD1). The SCI has the capability to send break to attract the attention of the other party of communications. The SCI supports hardware parity for transmission and reception. The SCI supports idling line and address mark wakeup, which is useful in multi-drop environment to reduce the software overhead.

Baud Rate Generation The HCS12 SCI module uses a 13-bit counter to generate this clock signal. This circuit is called baud rate generator. The baud rate generator divides down the E clock to derive the clock signal for reception and transmission. The user writes an appropriate value into the SCIxBDH and SCIxBDL (x = 0 or 1) register pair to set the baud rate.

The value to be written into the baud rate generator register is the rounding of the following expression: SBR = fE / (16 * baud rate )

The SCI Control Registers

SCI Status Registers

Character Transmission The block diagram of the SCI transmitter is shown in Figure 9.11. To transmit a character from the SCI module, the user writes the data bits into the SCIxDRH and SCIxDRL registers. The data bits in SCIxDRH and SCIxDRL registers will be transferred to the transmit shift register and shifted out serially from the TxD pin. Each time the SCI transfers data from the buffer SCIxDRH/L to the transmit shift register, it also sets the TDRE flag in the SCIxSR1 register. The setting of the TDRE flag indicates that the MCU can write new data into the SCI data register. When the transmit shift register is not transmitting data, the TxD signal goes to idle state. When both the transmit data registers and shift register are empty, the TC flag in the SCIxSR1 register is set to 1. An interrupt may be requested to the MCU if the TDRE or TC flag is set to 1.

Character Reception The block diagram of the SCI receiver is shown in Figure 9.14. The SCI receiver can handle either 8- or 9-bit characters. When receiving 9-bit data, the R8 bit of the SCIxDRH register holds the ninth bit. During an SCI reception, the receive shift register shifts in a frame from the RxD pin. After a complete frame is shifted into the receive shift register, the data portion of the frame is transferred to the SCI data register. The receive data register full flag in the SCIxSR1 register is set to 1. An interrupt may be requested to the MCU if it is enabled.

Example 9.2 Write an instruction sequence to configure the SCI0 to operate with the following parameters: 9600 baud (E clock is 24 MHz) one start bit, 8 data bits, one stop bit no interrupt address mark wakeup disable wakeup initially long idle line mode enable transmit and receive no loop back disable parity checking Solution: The following instruction sequence will configure the SCI0 properly: movb #$00,SC0BDH ; set up baud rate movb #156,SC0BDL ; “ movb #$4C,SC0CR1 ; select 8 data bits, address mark wakeup movb #$0C,SC0CR2 ; enable transmitter and receiver

Single-Wire Operation In this operation, the RxD pin is disconnected from the SCI module. The SCI module uses the TxD pin for both receiving and transmitting as illustrated in Figure 9.15. Single-wire operation is enabled by setting the LOOPS and the RSRC bits in the SCIxCR1 register. Setting the LOOPS bit disables the path from the RxD pin to the receiver. Setting the RSRC bit connects the receiver input to the output of the TxD pin driver. Both transmitter and receiver must be enabled. The TXDIR bit determines whether the TxD pin is going to be used as an input (TXDIR = 0) or output (TXDIR = 1) in this mode of operation.

Flow Control of UART in Asynchronous Mode The SCI module will transmit data as fast as the baud rate allows. In some circumstances, the software may not be able to read data as fast as the data is received. There is a need for the MCU to tell the transmitting device to suspend transmission of data temporarily. Similarly, the HCS12 may need to be told to suspend transmission temporarily. This is done by flow control. There are two common methods of flow control: XON/XOFF and hardware. XON/XOFF is implemented completely in software but requires a full-duplex communication. When incoming data needs to be suspended, am XOFF byte is transmitted back to the other device that is transmitting. To start the other device transmitting again, an XON character is transmitted. The XON and XOFF characters have the ASCII code of 0x11 and 0x13, respectively. Hardware flow control requires the use of extra signals. Generally, an input pin of the transmitter is controlled by the receiver. Before transmitting any character, the transmitter needs to test the flow control input pin.