USART Universal Synchronous Asynchronous Receiver Transmitter

Slides:



Advertisements
Similar presentations
EUSART Serial Communication.
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.
Serial I/O - Programmable Communication Interface
Hierarchy of I/O Control Devices
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,
Eng. Husam Alzaq The Islamic Uni. Of Gaza
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
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.
EEE305 Microcontroller Systems Lecture 7: Embedded C using PIC microcontrollers Serial i/o with the XC8 Teaching resources are at
Smart-grid Interface with Photovoltaic Installation – Phase 2 PP-01 Team members: Matt Koresh Ivan Mills Matt Martin Advisor: Dr. Aliprantis.
Microcontroller Programming How to make something almost do something else Raffi Krikorian MAS November 2003.
Serial Communication ETEC 6416.
USART interrupt.
The 8051 Microcontroller and Embedded Systems
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
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)
“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.
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.
CE-2810 Dr. Mark L. Hornick 1 Using the USART Configuration and Programming.
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
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.
Department of Electronic & Electrical Engineering Template program. Input / Output (IO) ● Template program. ● Introduction to IO ● Setting up for IO ●
Department of Electronic & Electrical Engineering Lecture 2 ● Introduction to IO ● Using a subroutine ● Driving a 7seg display.
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.
Department of Electronic & Electrical Engineering Lecture 3. ● Template program. ● Introduction to IO ● PORTA PORTB TRISA TRISB ● Using a subroutine ●
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
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.
TIMERS.
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
Refer to Chapter 16 in the reference book
Source: Serial Port Source:
Chapter 10 PIC18 Serial Port Programming in Assembly
SERIAL PORT PROGRAMMING
Interrupts, Counter and Timers
The PIC uCs PIC Microcontroller and Embedded Systems Muhammad Ali Mazidi, Rolin McKinlay and Danny Causey Eng. Husam Alzaq The Islamic Uni. Of Gaza 11-1.
Computer Organization and Design
Source: Serial Port Source:
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
PIC18 Timer Programming “Explain the assembly language programming for the timer and counter module”
Programmable Data Communication Blocks
Source: Serial Port Source:
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Prof Afonso Ferreira Miguel
Source: Serial Port Source:
PIC Serial Port Interfacing
PIC Serial Port Interfacing
PIC18 Interrupt Programming
Presentation transcript:

USART Universal Synchronous Asynchronous Receiver Transmitter Serial Communications Interface

How it Works: Transmission

How it Works: Transmission

How it Works: Transmission 1 start bit 8 (or 9) data bits 1 stop bit No parity bit lsb to msb

How it Works: Reception RCREG is actually a two-deep queue. It can be read from twice. So you can receive two bytes of data before needing to read.

How it Works: Reception

How it Works: Reception The data on the RB1/RX/DT pin is sampled three times by a majority detect circuit to determine if a high or allow level is present at the RX pin.

How it Works: Baud Rates BRGH = TXSTA,2 SPBRG = 99h (BANK 1!) Fosc = Frequency of Oscillation = 4 Mhz = 4000000 Taken from: http://www.microcontrollerboard.com/pic_serial_communication.html

A Chart! BRGH = 1

Assignment 2, but Easier!

TX and RX Pins B1 is RX B2 is TX bsf STATUS,RP0 movlw b'10000110' movwf TRISB Set TRISB pins 1 and 2 to 1 (even though we are transmitting).

Baud Rate Generator setBaudRate bsf TXSTA,BRGH ; Select high baud rate movlw d'25' movwf SPBRG ; 9600 baud TXSTA and SPBRG are in bank 1! BRGH – Baud Rate Mode 1 = high baud rate 0 = low baud rate

Enable Asynchronous Communication configureModes bcf TXSTA,SYNC ; selects Async mode bcf STATUS,RP0 ; return to bank 0 bsf RCSTA,SPEN TXSTA is in bank 1! Clear bit sync to enable async mode Set bit SPEN to enable PORTB pins 1 and 2 as serial port pins. bcf TXSTA,SYNC ; selects Async mode

Transmit Chip bsf TXSTA,TXEN Enables transmission. Sets the output line high.

Transmit Chip movlw d'7' movwf TXREG bsf STATUS,RP0 waitUntilDone btfss TXSTA,TRMT goto waitUntilDone As soon as TXREG is loaded with data, transmission will be enabled. TSR (Transmit Shift Register) will be loaded with data from TXREG and send data out of TX Once transmission is complete, bit TRMT is set. TRMT is cleared when data is put back into TSR.

Receive Chip bsf RCSTA,CREN Tells the USART to start listening on the RX pin. The RX line must be high before you start listening to it. Otherwise it will immediately start reading data and weird stuff will happen.

Receive Chip waitForData btfss PIR1,RCIF goto waitForData Received data goes into RSR – not visible to programmers. When RSR is full the data is put into RXREG Receive Interrupt Flag bit is set when when the RSR moves data to RXREG Can be polled or trigger an interrupt Is cleared when RXREG is read.

Pitfalls! Set TXEN before CREN Several registers in Bank 1

Extras! 9-bit transmission / reception Interrupt driven Synchronous mod