Lecture # 13.

Slides:



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

Lecture # 12. PIC Printer Interface Printer IRQ7 INT ACK Printer Interface.
DATA COMMUNICATIONS Some organisations concerned with standards: EIA - Electroonic Industries Association (RS standards including RS-232) IEEE - Institute.
1 Homework Reading –Tokheim, Section 13-6 Continue mp1 –Questions? Labs –Continue labs with your assigned section.
Sem 6 – Chap 2 All You Need to Know about Modems.
Chapter 2 Data Communication Concepts Code Transmission Signal Modulation Service.
Spring EE 316 Computer Engineering Junior Lab Serial Ports.
COMP3221: Microprocessors and Embedded Systems
EET Advanced Digital Chapter 21 Serial Ports.
RS-232 Port Lecture L9.3. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
1 The 9-Pin Connector Pin abbreviations (numbers in parentheses are the 25D pin numbers): 1. CD (8) 2. RD (Rx) (3) 3. TD (Tx) (2) 4. DTR (20) 5. SG (Ground)
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.
RS422, RS485, RS423, RS449 and V.35 Data Communications (E&T2760): RS422, RS485, RS423, RS449 and V.35.
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
Transmission Modes Serial Transmission  One bit is transmitted on a circuit at a time  Usually there is one transmit circuit and one receive circuit.
Serial Communication Lab 12 Module M21.1. Asynchronous Serial I/O ASCII code 54H = (“T”) sent with odd parity.
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),
Lecture Set 9 MCS-51 Serial Port.
Line Coding, Modem, RS232 interfacing sequences.
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 Communications
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)
Interfaces and Synchronization Martin Weiss. EIA 232D Interface Standard u Synonymous with ITU V.24 u Asynchronous interface u Up to 19.2kbps u 50 foot.
1 Transmission of Digital Data : Interface and Modems.
1 Asynchronous voice band modem for IP data protocols overview features.
Digital Interfaces An interface links two devices Interface Standards define: – mechanical specifications - how many wires & connector type –electrical.
8051SERIAL PORT PROGRAMMING
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
Lecture 15. Modem Controller Register 4310 DTR 0 = Polling Operator 1 = Interrupts Enabled RTS 1 =Self Test 0 =Normal.
NARNARAYAN SHASTRI INSTITUTE OF TECHNOLOGY Prepared by: Wasu Ichcha kaur H Bhalani Nidhi M Dhakate Megha D MICROCONTROLLER.
Lecture # 14. RS – 232C Standard Standard for physical dimensions of the connectors. PC (DTE) Modem RS – 232C Cable Connected via serial port (DCE)
Jeremy Sandoval University of Washington May 14, 2013
Chapter 6 Serial Communications
Serial mode of data transfer
UART Serial Port Programming
RS-232 Communications.
Homework Reading Labs Tokheim, Section 13-6 S and S Extracts
Homework Reading Continue mp1 Labs Tokheim, Section 13-6 Questions?
CS-401 Computer Architecture & Assembly Language Programming
Homework Reading (linked from my web page) Machine Projects Labs
8254 – SOFTWARE PROGRAMMABLE TIMER
SERIAL PORT PROGRAMMING
Chapter 6 Transmission of Digital Data Interfaces and Modems
RS-232 Communications.
UART and UART Driver B. Ramamurthy.
DATA COMMUNICATION Lecture-21.
Serial Communication: RS-232 (IEEE Standard)
Local Asynchronous Communication (RS-232)
UART Serial Port Programming
UART and UART Driver B. Ramamurthy.
UART Serial Port Programming
Serial Communication Interface: Using 8251
Serial Communication Interface
Преглед Начин функционисања Имплементације
NS Training Hardware.
Communication 1.CD : Carrier Detect 2.RXD : NC 3.TXD : NC
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.
Chapter 6 Transmission of Digital Data Interfaces and Modems
Lecture 17.
PIC Serial Port Interfacing
8051SERIAL PORT PROGRAMMING
PIC Serial Port Interfacing
Presentation transcript:

Lecture # 13

C:\>debug -o 378 0A -i 379 D0 -o 378 19 -i 379 48 Sending byte 9A C:\>debug -i 379 D7 -o 378 0A -i 379 4F -o 378 19 C:\>debug -o 378 0A -i 379 D0 -o 378 19 -i 379 48

0A=00001010 , Data line 4=0 (sent) D7=11010111 , BUSY=1 (recieved) 11010111 >> 3 = 00011010 00011010 & 00001111 = 00001010 = 0A , Data line 4 =0 (send for verification) D0 = 11010000 , BUSY=1 (received & verified)

09=00001001 , Data line 4 =0 Set Data line 4 to 1 00001001 | 00010000 = 00011001 = 19 ,(Sent to 378H) (Sent) 4FH=01001111 , BUSY=0 (Received) 01001111 << 1 = 1001111

Joining both nibbles Low Nibble 00011010 & 00001111 = 00001010 Hi Nibble 10011111 & 11110000 = 10010000 Whole byte 00001010 | 10010000 = 10011010 = 9A

int i= 0; char Buf[1024]; while (1) { ch = Buf [i]; if ((inport((*lpt) + 1)& 0x80) == 0) ch = ch & 0xEF; while((inport((*lpt) + 1) &0x80) == 0); } else ch = ch >> 4; ch = ch | 0x10; outport (*lpt, ch); i++; while((inport((*lpt) + 1) &0x80) == 80);

int i; while (1) { if ((inport(*lpt + 1)& 0x80) == 0x80) { x = inport ((*lpt) + 1); x = x >> 3; x = x & 0x0F; outport((*lpt), x); while((inport(*lpt + 1) &0x80) == 0x80); } else { y = inport ((*lpt) + 1); y = y << 1; temp = y; y = y | x;

temp = temp >> 4; \\ Move to Low Nibble temp = temp | 0x10;\\ Set D4 bit i++; outport (*lpt, temp);\\ Send for verification Buf [i] = y; while((inport((*lpt) + 1) &0x80) == 0); }

Serial Communication Advantages Disadvantages

Types Of Serial Communication Synchronous Asynchronous

Synchronous Communication Timing signal is used to identify start and end of a bit. LSB MSB 1 1 0 1 0 1 1 0 0 1 1 0 1 0 1 1

Synchronous Communication Sampling may be edge triggered. Special line may be required for timing signal (requires another line). Or the timing signal may be encoded within the original signal (requires double the bandwidth).

Asynchronous Communication Does not use make use of timing signal. Each byte (word) needs to encapsulated in start and end bit.

Serial Communication using a UART Parity bit Start bit of next byte 0 1 2 3 4 5 6 7 8 1 5 – 8 bit 1, 1.5, 2 Stop bit Start bit 1.5 Stop bit

Sampling Rate Bit rate = 9600 A bit is sampled after = 1/9600 -- But start and end bits of a particular Byte cannot be recognized. -- So 1.5 stop bit (high) is used to encapsulate a byte. A start bit (low) at the start of Byte is used to identify the start of a Byte.

Sampling Rate -- Bit rate and other settings should be the same at both ends i.e. Data bits per Byte. (5 – 8 ) Parity check Parity Even/Odd No. of stop bits.

Sampling Rate A = 41H = 0100 0001 B Parity = Odd Data = 8 Stop bit =1 1/1300 sec Data bits Stop bit Start bit Odd parity A = 41H = 0100 0001 B Parity = Odd Data = 8 Stop bit =1 Data rate = 300 bits/sec

PC (DTE) RS – 232C Standard Modem Standard for physical dimensions of the connectors. RS – 232C Cable PC (DTE) (DCE) Modem Connected via serial port

RS – 232C Connectors and Signals DB25 (25 pin connector) 13 25 12 24 11 23 10 22 RI 9 21 CD 8 DTR 20 GND 7 19 DSR 6 18 CTS 5 17 RTS 4 18 RD 3 19 T X D 2 20 1 25 pin connector on PC

DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION ) RI CD DTE DCE DTR PC MODEM DSR RTS CTS RxD TxD DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION ) CTS (CAN BE USED FOR FLOW CONTROL )