The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.

Slides:



Advertisements
Similar presentations
EUSART Serial Communication.
Advertisements

INPUT-OUTPUT ORGANIZATION
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
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.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Serial I/O - Programmable Communication Interface
Hierarchy of I/O Control Devices
Starting with serial Chapter Ten 10.1, 10.2,
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Chapter 6 Serial Communications Objectives Introduce the RS232 standard and position it within the crowded field of serial communications standards. Configure.
Embedded Systems UNIT 3. Pin Details of 8051 Pins 1-8: Port 1 Each of these pins can be configured as an input or an output. Pin 9: The positive voltage.
Lecture 10 Serial Communication.
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
INPUT-OUTPUT ORGANIZATION
Microcontroller 8051.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
The 8051 Microcontroller and Embedded Systems
SC200x Peripherals Broadband Entertainment Division DTV Source Applications July 2001.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Chapter 4 TIMER OPERATION
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.
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire conductors)
Serial Communication Lec note 9.
1. Registers Used in Timer/Counter  TH0, TL0, TH1, TL1  TMOD (Timer mode register)  TCON (Timer control register) 2.
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.
MCS51 - lecture 4. Lecture 3 1/27 Serial ports MCS51 Standard SIO Some extensions and modifications.
Universal Asynchronous Receiver/Transmitter (UART)
8051 Micro controller. Architecture of 8051 Features of 8051.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
8051SERIAL PORT PROGRAMMING
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
8251 USART.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
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.
Chapter 6 Serial Communications
Serial mode of data transfer
Source: Serial Port Source:
SERIAL PORT PROGRAMMING
Interrupt Source: under
Introduction to Micro Controllers & Embedded System Design Interrupt
Introduction to Micro Controllers & Embedded System Design I/O Processing and Serial Port Operation Department of Electrical & Computer Engineering Missouri.
Source: Serial Port Source:
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
UART Protocol Chapter 11 Sepehr Naimi
NS Training Hardware.
Interrupt Source: under
Interrupt Source: under
AVR – ATmega103(ATMEL) Architecture & Summary
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.
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
Prof Afonso Ferreira Miguel
Source: Serial Port Source:
PIC Serial Port Interfacing
8051SERIAL PORT PROGRAMMING
PIC Serial Port Interfacing
Presentation transcript:

The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION

2/21 The essential function : parallel to serial conversion for output data and serial to parallel conversion for input data Full duplex Receive buffer The serial port buffer (SBUF) is really 2 buffers Writing to SBUF loads data to be transmitted, write-only register Reading SBUF accesses received data, read-only register SCON – serial port control register, control bits and status bits Baud rate can be fixed or variable

3/21

4/21

5/21 Mode of operation of serial port is set by writing to the SCON at address 99H

6/21 8-bit Shift Register (Mode 0) The RXD line for input and output data The TXD line serves as the clock

7/21 Reception: reception enable bit REN=1 and receive interrupt bit RI=0

8/21 8-bit Shift register (mode 0) Possible application is to expand the output capability of the 8051

9/21 8-bit UART with Variable Baud Rate (Mode 1) Universal Asynchronous Receiver/Transmitter Receives and transmits serial data with each data character preceded by a start bit (low) and followed by a stop bit (high) For a receive operation, the stop bit goes into RB8 in SCON

10/21 8-bit UART (Mode 1) Clocking and synchronizing the serial port shift registers in mod 1, 2, 3 is established by a 4-bit divide ‑ by-16 counter, the output of which is the baud rate clock

11/21 8-bit UART (Mode1) Transmission is initiated by writing ti SBUF but does not actually start until the next rollover of the divide-by-16 counter supplying the serial port baud rate Reception is initiated by a 1 to 0 transition on RXD The receiver includes “false start bit detection”

12/21 Eleven bits are transmitted or received: a start bit,8 data bits, a programmable ninth data bit, and a stop bit 9-bit UART with Fixed Baud Rate (Mode 2)

13/21 9-bit UART with Variable Baud Rate (Mode 3) Modes 1,2 and 3 are very similar The differences lie in the baud rates (fixed in the 2, variable in modes 1 and 3) and in the number of data bits( 8 in mode 1, 9 in modes 2 and 3)

14/21 Initialization and accessing serial port registers Receiver Enable : REN in SCON must be set by software to enable the reception of characters The ninth data bit : The ninth bit transmitted in modes 2 and 3 must be loaded into TB8 by software, received bit is placed in RB8 Interrupt Flags : the receive and transmit interrupt flags (R1 and T1) in SCON, set by hardware, must be cleared by software

15/21 Multiprocessor Communication Modes 2 and 3 have a special provision When the master want to send some data to slaves, it first sends out an address byte of target slaves The trick is not to use the ninth data bit after a link has been established

16/21 Serial Port Baud Rates The baud rate is fixed in modes 0 and 3 In mode 0 it is always the on-chip oscillator freq. divided by 12 By default following a system reset, the mode 2 baud rate is the osci. freq. divided by 64 Baud rates in modes 1 and 3 are determined by the timer 1 overflow rate

17/21 Using timer 1 as the Baud Rate Clock The baud rate is the timer 1 overflow rate divided by 32 The formula for modes 1 and 3 Baud rate=timer 1 overflow +32

18/21

19/21

20/21

21/21