EUSART Serial Communication.

Slides:



Advertisements
Similar presentations
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
Advertisements

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.
COMP3221: Microprocessors and Embedded Systems Lecture 22: Serial Input/Output (II) Lecturer: Hui Wu Session 1, 2005.
Starting with serial Chapter Ten 10.1, 10.2,
Asynchronous Communication Hardware  Data within a DTE is usually stored and moved in a parallel fashion.  Data sent across the channel is generally.
USARTS CS423 Dick Steflik. USART ● Universal Synchronous Asynchronous Receiver Transmitter ● used to send and receive small packets over a serial line.
Eng. Husam Alzaq The Islamic Uni. Of Gaza
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)
EEE305 Microcontroller Systems Lecture 7: Embedded C using PIC microcontrollers Serial i/o with the XC8 Teaching resources are at
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
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.
USART interrupt.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
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)
“Describe the overview of hardware interfacing and the serial communication interface. Describe the PIC18 connections to RS232. Explain the serial port.
Universal Asynchronous Receiver/Transmitter (UART)
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
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.
CE-2810 Dr. Mark L. Hornick 1 Using the USART Configuration and Programming.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
7 - 1 Texas Instruments Incorporated Module 7 : Serial Peripheral Interface C28x 32-Bit-Digital Signal Controller TMS320F2812.
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.
Aum Amriteswaryai Namah:. PIN DIAGRAM WW hen two processors are to communicate, more often the communication is organized in a bit serial fashion The.
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.
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes.
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
INT. TO EMBEDDED SYSTEMS DEVELOPMENT
Source: Serial Port Source:
Chapter 10 PIC18 Serial Port Programming in Assembly
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
Source: Serial Port Source:
USART Universal Synchronous Asynchronous Receiver Transmitter
UART Serial Port Programming
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
UART Protocol Chapter 11 Sepehr Naimi
COMP3221: Microprocessors and Embedded Systems
Configuration and Programming
Programmable Data Communication Blocks
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.
Serial Communication 19th Han Seung Uk.
Source: Serial Port Source:
PIC Serial Port Interfacing
PIC Serial Port Interfacing
Introduction Communication Modes Transmission Modes
Presentation transcript:

EUSART Serial Communication

UART Universal Asynchronous Receiver/Transmitter Receive: Convert serial to parallel (SIPO) Transmit: Convert parallel to serial (PISO) Asynchronous: No clock; bytes sent in chunks. Start (0) and stop (1) signal for each byte

EUSART Enhanced Universal Synchronous / Asynchronous Receiver/Transmitter Synchronous: Constant stream of data matched with clock signal. More efficient, no start/stop framing required. Enhanced: Advanced features Sleep mode/auto-wake Calculate incoming baud rate Error Detection Full-duplex asynchronous, Half-duplex synchronous 8 or 9 bit character length

Flip-Flop Flip-flops store a single bit of data. SR NOR latch: Simplest type of flip flop.

D Flip-Flop Similar function, but uses clock to feed Data signal to Q in time with clock cycle.

Receive Shift Register (RSR): Cascade of flip-flops Data written serially by shifting. Upon filling register, all bits read simultaneously on clock cycle.

Transmit Altered shift register (TSR) reverses process. All bits written to register simultaneously. Bits shift to next flip-flop on cycles. Last bit feeds output.

Registers TXSTA & RCSTA: Status registers. TSR & RSR: Shift registers. Set modes. TSR & RSR: Shift registers. Not directly accessible. TXREG & RCREG: Container for transmitted data. BAUDCTL: 8-bit Baud Rate Control Register. SPBRG & SPBRGH: 16-bit Baud Rate Generator.

TXSTA – Transmit Status Register CSRC - Clock Source Select bit - determines clock source. It is used only in synchronous mode. 1 - Master mode. Clock is generated internally from Baud Rate Generator 0 - Slave mode. Clock is generated from external source. +TX9 - 9-bit Transmit Enable bit 1 - 9-bit data transmission via EUSART system 0 - 8-bit data transmission via EUSART system. *TXEN - Transmit Enable bit *1 - Transmission enabled 0 - Transmission disabled. *SYNC - EUSART Mode Select bit 1 - EUSART operates in synchronous mode 0 - EUSART operates in asynchronous mode. SENDB - Send Break Character bit is only used in asynchronous mode and only in case it is required to observe LIN bus standard. 1 - Sending Break character is enabled 0 - Break character transmission is completed. *BRGH - High Baud Rate Select bit determines baud rate in asynchronous mode. It does not affect EUSART in synchronous mode. 1 - EUSART operates at high speed 0 - EUSART operates at low speed. TRMT - Transmit Shift Register Status bit 1 - TSR register is empty 0 - TSR register is full. TX9D - Ninth bit of Transmit Data can be used as address or parity bit.

RCSTA – Receive Status Register *SPEN - Serial Port Enable bit *1 - Serial port enabled. RX/DT and TX/CK pins are automatically configured as input and output respectively 0 - Serial port disabled. +RX9 - 9-bit Receive Enable bit 1 - Receiving 9-bit data via EUSART system 0 - Receiving 8-bit data via EUSART system. SREN - Single Receive Enable bit is used only in synchronous mode when the microcontroller operates as master. 1 - Single receive enabled 0 - Single receive disable. *CREN - Continuous Receive Enable bit acts differently depending on EUSART mode. Asynchronous mode: *1 - Receiver enabled 0 - Receiver disabled. Synchronous mode: *1 - Enables continuous receive until the CREN bit is cleared 0 - Disables continuous receive. +ADDEN - Address Detect Enable bit is only used in address detect mode. 1 - Enables address detection on 9-bit data receive 0 - Disables address detection. The ninth bit can be used as parity bit. ~FERR - Framing Error bit 1 - On receive, Framing Error is detected 0 - No framing error. ~OERR - Overrun Error bit. 1 - On receive, Overrun Error is detected 0 - No overrun error. RX9D - Ninth bit of Received Data can be used as address or parity bit.

BAUDCTL – Baud Rate Control Register *Bit 7: ABDOVF — Flag bit indicates time of overflow; sets rate. 1 - Auto-baud timer overflowed 0 - Auto-baud timer did not overflow. Bit 6: RCIDL — Idle/Sleep; only used in asynchronous mode. 1 - Receiver is idle 0 - START bit has been received and receiving is in progress. Bit 4: SCKP Synchronous: indicate which Idle state is used for the data Clock (CK) 1 - Synchronization on rising edge of the clock 0 - Synchronization on falling edge of the clock. Asynchronous: indicate transmit polarity. 1 - Transmit inverted data to the RC6/TX/CK pin 0 - Transmit non-inverted data to the same pin. *Bit 3: BRG16 — Enable 16-bit 1 – Enable 16-bit (disables BAUDCTL from setting rate). 0 – Disable 16-bit mode. Bit 1: WUE — Auto-wake/Interrupt 1 - Receiver waits for a falling edge on the RC7/RX/DT pin to wake from sleep. 0 - Receiver operates normally. Bit 0: ABDEN — Reset Baud – auto-baud recalculation on next character (async only) 1 - Auto-baud detect mode is enabled. Bit is automatically cleared on baud rate detect. 0 - Auto-baud detect mode is disabled.

Transmitter Set Baud: BRGH (TXSTA) & BRG16 (BAUDCTL) TXEN = 1: Enable transmitter (TXSTA) SPEN = 1: Enable Serial Port (RCSTA) TX/CK pin is output SYNC: Synchronous-1 or Asynchronous-0 (TXSTA) TXREG: Write data to be sent here. TSR: Data automatically transferred to TSR shift register from which it is serialized and output. TXREG is cleared and awaits new data to repeat transmission.

Receiver Set Baud: BRGH (TXSTA) & BRG16 (BAUDCTL) CREN = 1: Enable receiver (RCSTA) SPEN = 1: Enable Serial Port (RCSTA) Input to RX/DT pin SYNC: Synchronous-1 or Asynchronous-0 (TXSTA) RX/DT serial pin data sent to RSR shift register. RCREG: 8 or 9-bit data from RSR automatically transferred here. Input data will be readable from RCREG register.

TX/RC Interrupts Interrupt represents each successive byte. Transmit Enable TXIE or RCIE to enable interrupt. Transmit When TXREG is empty, TXIF flag is set. FlagInterrupt: Send to TXREG TXIF is reset until TXREG is re-emptied. Receive Upon filling RCREG, RCIF flag is set. FlagInterrupt: Read RCREG RCIF flag is reset until RCREG is re-filled.

Example Code Utilizing data received by EUSART. http://pastebin.com/W1cP6bh8 Interrupt Routine If RCIF flag is set, read EUSART (RCREG). Flag code when read. Main function: Enable interrupt. Endless loop. If flagged, read new data and place in array.

Address Detection ADDEN bit (RCSTA) determines address size. ADDEN = 1 allows 9-bit, excludes 8-bit ADDEN = 0 disables address detection

Errors Framing Error: In asynchronous mode Overrun Error Stop bit not received at expected time. Enables FERR bit (RCSTA). Interrupt not necessarily generated, simply informs of possibly incorrect data. FERR is cleared by once data is read. Overrun Error RCREG is FIFO and can hold no more than two bytes. Third byte while RCREG is still full Enables OERR bit (RCSTA). No more data received until OERR is manually cleared (clear CREN). Manual clearing of SPEN (RCSTA) will reset entire EUSART.

Reference http://ww1.microchip.com/downloads/en/AppNotes/00944A.pdf http://www.mikroe.com/chapters/view/7/chapter-6-serial-communication-modules/