Serial I/O Communication

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

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.
Serial I/O - Programmable Communication Interface
COMP3221: Microprocessors and Embedded Systems Lecture 22: Serial Input/Output (II) Lecturer: Hui Wu Session 1, 2005.
Better Debugging of Embedded via a Debug Port ECE152.
Better Debugging of Embedded via a Debug Port ECE152.
USARTS CS423 Dick Steflik. USART ● Universal Synchronous Asynchronous Receiver Transmitter ● used to send and receive small packets over a serial line.
Serial Input/Output Interface Outline –Serial I/O –Asynchronous serial I/O –6850 ACIA –68681 DUART –Synchronous serial I/OInterface Standards –68000 Serial.
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.
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.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
EEE305 Microcontroller Systems Lecture 7: Embedded C using PIC microcontrollers Serial i/o with the XC8 Teaching resources are at
The Arduino Platform A “development module”
KyungHee Univ. 2-0 Parallel Port LCD Interface with the HD44780 Controller.
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.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
The 8051 Microcontroller and Embedded Systems
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
Digilent System Board Capabilities Serial Port (RS-232) Parallel Port 1 Pushbutton Hint: Good for a reset button Connected to a clock input. See Digilent.
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
인터럽트의 개요 Interrupt의 처리 과정
Universal Asynchronous Receiver/Transmitter (UART)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
Serial Communications
Embedded System Design Laboratory October 4, 2002Stanford University - EE281 Lecture #3#1 Lecture #3 Outline Announcements AVR Processor Resources –UART.
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.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
Universal Asynchronous Receiver/Transmitter (UART)
CE-2810 Dr. Mark L. Hornick 1 Using the USART Configuration and Programming.
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.
ELE22MIC Lecture 9-12 Serial Communications AVR USART –Universal Synchronous Asynchronous Receiver Transmitter (ACIA: Asynchronous Communications Interface.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
Synchronous vs asynchornous communication. What is a USART A USART (Universal Synchronous/Asynchronous Receiver/Transmitter) is a microchip that facilitates.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Chap.6.3 UART.
8251 USART.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
Serial mode of data transfer
CS-401 Computer Architecture & Assembly Language Programming
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
SERIAL PORT PROGRAMMING
ATMEGA 32 CONNECTIONS TO RS232; UDR AND UCSR REGISTERS
COMP2121: Microprocessors and Interfacing
Atmega32 Serial Programming Basics
Computer Organization and Design
UART Serial Port Programming
Serial Communication Interface: Using 8251
UART Protocol Chapter 11 Sepehr Naimi
COMP3221: Microprocessors and Embedded Systems
Преглед Начин функционисања Имплементације
Configuration and Programming
NS Training Hardware.
Programmable Data Communication Blocks
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.
Prof Afonso Ferreira Miguel
8051SERIAL PORT PROGRAMMING
AVR UART The UART, or Universal Asynchronous Receiver Transmitter, provides hardware support for a serial port on AVR processors Signaling is compatible.
Presentation transcript:

AVR UART Serial I/O KyungHee Univ.

Serial I/O Communication UART(Universal Asynchronous Receiver/Transmitter). DTE(Data Terminal Equipment) DCE(Data Communication Equipment) UART DTE DCE Interface KyungHee Univ.

USART(Universal Synchronous and Asynchronous Receiver/Transmitter) Block Diagram KyungHee Univ.

USART and Asynchronous Communication Serial frame format Every frame will have at least 1 start bit data bits (5,6,7,8 or 9) 1-2 stop bit Parity is optional KyungHee Univ.

USART and Asynchronous Communication Start Bit 를 Sampling 하기 위하여 16배 속도의 내부 Clock를 사용 한다. 중간 부분에서 3번 Sampling 하여 2개 이상이 0 이면 0, 2개 이상이 1이면 1로 결정 한다. . KyungHee Univ.

Error detection : Parity Data bits의 XOR에 의하여 Parity Bit를 생성 한다. Parity는 Even 과 Odd Parity 로 구분 한다. Peven= dn XOR dn-1 XOR dn-2 ........ XOR d0 XOR 0 Podd= dn XOR dn-1 XOR dn-2 ........ XOR d0 XOR 1 data bits Parity Bit KyungHee Univ.

Error detection : Frame error Frame Error : Stop Bit 가 발견 되지 않는 경우 첫 번째 Stop bit가 0으로 검출되는 경우 Data Overrun Error : 수신 버퍼에 현재 읽지 않은 데이터가 들어있는 상태에서 새로운 데이터가 수신 완료되고, 그 다음 수신 데이터인 Start bit가 검출된 경유 Stop bits KyungHee Univ.

Logic(0,1)의 전압 USART and Asynchronous Communication TTL Logic : 0V, 5V RS-232 : -12V, +12V MAX232 : Negative와 Positive 전압을 발생 시키는 Charge pump 기능을 포함 함. KyungHee Univ.

Serial Communication에 사용하는 Connector 예 간단한 RS232 Cable 연결 예 KyungHee Univ.

ATmega128 USART UART : Universal Asynchronous Receiver and Transmitter Asynchronous: 두 장치간에 clock 을 공유 하지 않는다. Synchronous: clock 을 공유 한다. USART : UART 의 기능과 Synchronous Communication을 포함 하고 있다. Baud rate : 매 초간 전달(수신, 송신)되는 Symbol의 수 Data rate : 매 초간 전달(수신, 송신)되는 Data 수 Data rate = Baud rate / Frame Bits(Data Bits + Start,Stop, Parity Bits) KyungHee Univ.

ATmega128 USART USART0 : Port E 사용 USART1 : Port D 사용 PE0: Receive Pin PE1: Transmit Pin PE2: External Clock USART1 : Port D 사용 PD2: Receive Pin PD3: Transmit Pin PD5: External Clock KyungHee Univ.

USART Programming Interface UDRn: 8-bit Data Register UBRRnH and UBRRnL: Baud Rate Registers ( n은 0 또는 1) 2개의 8-bit registers UCSRnA, UCSRnB, UCSRnC: Control and Status Registers KyungHee Univ.

USART Data Registers UDRn(Usart 0,1 I/O Data Register) UDRn은 TXBn(송신버퍼)/RXBn(수신버퍼) 레지스터로 구성되고, 같은 I/O 주소를 갖는다. 송신할 때는 TXBn에 데이터를 Write 하고, 수신할 때는 RXBn의 테이터를 Read 한다. KyungHee Univ.

Baud Rate Registers USART internal clock 은 the UBRR register에 의하여 설정 된다. 12 bits Baud Rate Rg UBRR의 값은 UBRR = (System Clock / 16XBaud Rate) – 1 주의 : UBBRnH Write 후 UBBRnL를 나중에 Write 하여야 한다. KyungHee Univ.

UBRR register 값과 baud rates 예 KyungHee Univ.

UCSRnA(USART Control and Status Register A) Bit 7 – RXCn(USART Receive Complete) Bit 6 – TXCn(USART Transmit Complete) Bit 5 – UDREn(USART Data Register Empty) Transmit Buffer (UDRn)의 상태를 표시 한다. Bit 4 – FEn(USART Frame Error) Bit 3 – DORn(USART Data Overrun Error) Bit 2 – UPEn(USART Parity Error) Bit 1 – U2Xn(Double the USART Transmission Speed) U2Xn = 1 : 비동기 모드에서 클럭의 분주비를 16에서 8로 낮추어 전송속도를 2배 높이는 기능. Bit 0 – MPCMn(USART Multi-Processer Communication Mode) KyungHee Univ.

UCSRnB(USART Control and Status Register B) Bit 7 – RXCIEn(USART RX Complete Interrupt Enable) Bit 6 – TXCIEn(USART TX Complete Interrupt Enable) Bit 5 – UDRIEn(USART Data Register Empty Interrupt Enable) Bit 4 – RXENn(USART Receiver Enable) Bit 3 – TXENn(USART Transmitter Enable) Bit 2 – UCSZn2(USART Character Size) UCSTnC 의 UCSZn1:0 와 함께 사용 함. Bit 1 – RXB8n(USART Receive Data Bit 8) Bit 0 – TXB8n(USART Transmit Data Bit 8) KyungHee Univ.

UCSRnC(USART Control and Register C) Bit 6 – USMSELn(USART Mode Select) USMSELn = 1 : 동기전송모드 USMSELn = 0 : 비동기전송모드 Bit 5, 4 – UPMn1, UPMn0(USART Parity Mode) fdevopen UPMn0 Parity Mode Disabled 1 (Reserved) Enabled, Even Parity Enabled, OddParity KyungHee Univ.

UCSRnC(USART Control and Register C) Bit 3 – USBSn(USART Stop Bit Select) USBSn = 0 : 1 Stop bits USBSn = 1 : 2 Stop bits Bit 2, 1 – 다음 페이지 참고요 Bit 0 – UCPOLn(USART Clock Polarity) 동기 전동 모드에서만 사용. UCPOLn = 1 : 송신데이터는 XCKn Clock Falling Edge에서, 출력 수신데이터는 XCKn Clock Rising Edge 에서 검출 UCPOLn = 0 : 송신데이터는 XCKn Clock Rising Edge 에서, 출력 수신데이터는 XCKn Clock Falling Edge에서 검출 KyungHee Univ.

UCSRnC(USART Control and Register C) Character Size : UCSZn2(UCSRnB: Bit2 ), UCSZn1, UCSZn0의 설정에 따라 5-9Bits 로 결정 된다. UCSZn2 UCSZn1 UCSZn0 Character Size 5-Bit 1 6-Bit 7-Bit 8-Bit Reserved 9-Bit KyungHee Univ.

ATmega128 USART 프로그램 예 cho_uart_basic_i_o 참고 요 KyungHee Univ.