Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 4 Communication Prepared by KI Chi Keung [chikeung.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

INPUT-OUTPUT ORGANIZATION
I/O Interfaces.
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
Chapter 7 Data Link Layer
Local Asynchronous Communication and RS-232. Goals Explain how electric current can be used to transmit bits over short distances Present a popular mechanism.
PH4705 ET4305 Interface Standards A number of standard digital data interfaces are used in measurement systems to connect instruments and computers for.
1 Physical Layer: Data Encoding & Transmission. 2 Network Interface Card (NIC) LL in part, PL in total are implemented in NIC –Ethernet card, card,
CSCI 4550/8556 Computer Networks Comer, Chapter 5: Local Asynchronous Communication (RS-232)
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Input/Output and Communication
TDC 461 Basic Communications Systems 8 May, 2001.
 The Open Systems Interconnection model (OSI model) is a product of the Open Systems Interconnection effort at the International Organization for Standardization.
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.
Local Asynchronous Communication
Local Asynchronous Communications. Bit-wise data transmission Data transmission requires: Encoding bits as energy Transmitting energy through medium Decoding.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
INPUT-OUTPUT ORGANIZATION
Embedded Systems Design
Network Hardware for Expanding Network. Expanding Networks When do we need expansion:  Network cable is full of data movements  Printing tasks needs.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
Chapter 2 Basic Communication Theory Basic Communications Theory w Understand the basic transmission theory, and figure out the maximum data rate. w.
Data Communications and Networks
Lecture 2 Computer Communications and Networks Boriana Koleva Room: C54 Phone:
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
Chapter 7 Low-Level Protocols
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Introduction Slide 1 A Communications Model Source: generates.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
Universal Asynchronous Receiver/Transmitter (UART)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Chapter 5: Local Asynchronous Communication 1. Bit-wise data transmission 2. Asynchronous communication 3. Sending bits with electric current 4. Standard.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Universal Asynchronous Receiver/Transmitter (UART)
The Principle of Electronic Data Serial and Parallel Data Communication Transmission Rate Bandwidth Bit Rate Parity bits.
Communications How to get something to almost talk to something else Raffi Krikorian MAS December 2003.
INTRANETS MR ROSS UNIT 3 IT APPLICATIONS. DEFINITION An intranet is an internal, secured environment that has a similar look and feel to the Internet,
BASIC NETWORK PROTOCOLS AND THEIR FUNCTIONS Created by: Ghadeer H. Abosaeed June 23,2012.
1 Transmission of Digital Data : Interface and Modems.
Modems How They Work. Modem A device used by a PC to communicate over a phone line or cable A device used by a PC to communicate over a phone line or.
FUNDAMENTALS OF NETWORKING
Unit 1 Lecture 4.
Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 1 Hello! Microcontroller. Prepared by KI Chi Keung.
1 Chapter Overview Modems The Internet and Web Browsers.
Physical Layer Issues and Methods Outline Physical Layer Ethernet Technology Physical Layer Encoding Final Exam Review - ??
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.
Serial Communications
Networking Using the OSI Model.
Network Hardware for Expanding Network
MODEMS (Converts analog signals to digital and vice-versa)
Input/Output and Communication
Operating Systems (CS 340 D)
Computer buses Adam Hoover connecting stuff together
Introduction to electronic communication systems
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Data Transmission and Computer Communications ECE: 412
Local Asynchronous Communication (RS-232)
Lecture 4 Continuation of transmission basics Chapter 3, pages 75-96
THE IEEE MAC SUB-LAYER – chapter 14
Asynchronous Serial Communications
Lecture 8: Modems (Converts analog signals to digital and vice-versa) 1nd semester By: Adal ALashban.
Chapter 9 Transmission Modes
Serial Communication 19th Han Seung Uk.
1.2.1 Data transmission.
Serial Communications
Open System Interconnect (OSI).
Presentation transcript:

Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 4 Communication Prepared by KI Chi Keung [chikeung @ ust.hk] WONG Long Sing (Sam) [sam @ hellosam.net]

Robocon 2007, HKUST Today ’ s Timeline 1.Communication Process 2.Layers of Communication 3.Implementation 4.RS232 / UART in-depth

Robocon 2007, HKUST Communication Process How communication can be done?

Robocon 2007, HKUST Parallel Communication At least, consist of a Data bus and a clock line Data line is mapped bit by bit. A Natural expansion of CPU/MCU design. Example –LCD –Parallel Port –(Parallel) ATA –Floppy –SDRAM (Synchronous Dynamic Random Access Memory) –PCI Bus

Robocon 2007, HKUST Parallel Communication Timing Diagram Data Clock Synchronization Data Stable Data

Robocon 2007, HKUST Serial Communication Only need one data line only No explicit clock. Either embedded or synchronized from time to time Example –UART –PS/2 Keyboard, Playstation Controller –USB –Ethernet –PCI Express Bus

Robocon 2007, HKUST Serial Communication Timing Diagram Data SynchronizationBus Idle Data Transmitted at agreed rate

Robocon 2007, HKUST Comparison Serial bus is more complex and harder to implement in nature CMSSCSRE Parallel bus require synchronization to slowest data line Electrical parallel bus suffers from crosstalk Parallel bus occupies more real estate

Robocon 2007, HKUST Layers of Communication Communication, or data exchange, is a complicated process. It is usually taught and understood in layers. OSI model describes 7 Layers We will focus on 3 of the 7 layers which do us good –Physical Layer (Layer 1) –Data Link Layer (Layer 2) –Application Layer (Layer 7)

Robocon 2007, HKUST Layers of Communication A layer can rely on the functionality of immediate bottom layer to facility data exchange A layer is only responsible to service the immediate upper layer If everything is well defined –application can communication with application almost without any knowledge of any bottom layer –Layers can be interchanged

Robocon 2007, HKUST Layers of Communication Application Layer (7) –Human, Computer Application (Web, FTP, …) Many other layers (6..3) –Human Language –TCP / UDP / IP / Part of USB / Part of I2C… Data Link Layer (2) –Human Speaking usual practice –Ethernet’s Carrier sense multiple access with collision avoidance (CSMA-CA) / detection (CSMA-CD) Physical Layer (1) –Wired (Telephone, Modem, LAN) –Wireless (Cell phone, Wifi) –Sound wave (Talking, Voice Playback and Recognition)

Robocon 2007, HKUST Physical Layer Describe the physical property of the communication channel. –Media Copper / Optical Fiber / Ultrasound / IR –Meaning of Voltage / Brightness –Modulation Base band / FM / AM / UHF / TDMA / OFDM –Serial or Parallel –Connectors

Robocon 2007, HKUST Physical Layer Human voiced communication –Media Air –Meaning of Voltage / Brightness Loudness –Modulation Longitudinal sound wave –Serial or Parallel Serial –“Connector” Ear and mouth

Robocon 2007, HKUST Physical Layer Serial Port / RS-232 –Media Copper Wire –Meaning of Voltage / Brightness -5V to -12V for 1 (Space), +5V to +12V for 0 (Mark) –Modulation Base band –Serial or Parallel Serial –“Connector” Commonly seen as DB 9 Male / Female

Robocon 2007, HKUST Data link Layer How the data link is established, understood and maintain –Master (Transmitter) / Slave (Receiver) relationship Or multi-hops? –Bus sharing / arbitration Shared? Who has higher priority? CSMA/CD, CSMA/CA –Clock rate / Order –Acknowledgement / Error detection / Error correction

Robocon 2007, HKUST Data link Layer Human voiced communication –Master (Transmitter) / Slave (Receiver) relationship Single master, many slaves –Bus sharing / arbitration Generally speaking, only one person talking each time. Also, the one who speaks louder win. Also handled by upper layer (in-band or out- of-band) –Clock rate / Order “Reasonable” speaking speed, could be adjusted by urgency, required attention Order? That really depends. –Acknowledgement / Error detection / Error correction Not defined in this layer

Robocon 2007, HKUST Data link Layer RS232 / UART –Master (Transmitter) / Slave (Receiver) relationship Single master, many slaves –Bus sharing / arbitration For each data link, the master will always be master. No sharing and arbitration is needed. –Clock rate / Order Agreed Baud rate. Commonly seen from 9600 to Transmit LSB first, then MSB –Acknowledgement / Error detection / Error correction Start / Stop bit for time frame checking. Optional parity bit for error detection. Others are not defined in this layer.

Robocon 2007, HKUST Application Layer Implement what you want! It’s application dependent. It may implement some functions not implemented by lower layer.

Robocon 2007, HKUST Application Layer Human voiced communication –Protocol is application dependent Boss ordering employees Conference with project partners Chitchat with friends –Acknowledgement, Error checking, Error Correction In-band - “Would you repeat that please?”, “Did you mean XXX?” Out-of-band - Waving the head, body gestures Undefined - As in teaching. I never know if you can receive what I am talking about or not.

Robocon 2007, HKUST Application Layer RS232 / UART –Protocol is application dependent Binary? Text? –Acknowledgement, Error checking, Error Correction In-band - Dedicate special characters as control character. e.g. ASCII, XON/XOFF. Out-of-band - Use GPIO lines as control line Undefined - Simple ignore it! e.g. Data transmission occurs in continuous fashion frequently anyway, like temperature monitoring. (Or think video streaming from the Internet / webcam)

Robocon 2007, HKUST Implementation – Physical Layer If the definition is to use the basic 0-5V, GPIO capable, then you probably don’t need extra hardware. –Exception: when you want to have electrical separation with a noisy hostile circuit Otherwise you need transceiver –Like phone-receiver for voiced communication –Laser and Diode for optical fiber

Robocon 2007, HKUST Implementation – Data Link Layer Either use specialized hardware interfacing module –Provided by microcontroller –Or an external hardware, usually an IC with transceiver embedded. Think of USB controller chip Or software defined (code it in application) –In fact everything not fall onto physical layer can be implemented by application code, given your CPU processing power is fast enough. If you go extreme, see GNU Radio project, which demodulate (No tuner, just Fourier transform!) the HDTV signal with CPU. –Using software defined communication technique on serial communication is called Bit-Banging

Robocon 2007, HKUST Implementation – Application Layer Show me your code!

Robocon 2007, HKUST RS232 / UART in-depth Physical Layer - Transceiver –MAX232 by Maxim IC (Unrelated to Maxim's Catering) Data link –Handled by the UART module on ATMega128 Application –By using the registers and optionally interrupt

Robocon 2007, HKUST RS232 / UART in-depth Cable and Connector – Use your USB-to- COM cable Voltage conversion is taken care by MAX232 UART voltage is 5V (1, Space, Idle) and 0V (0, Mark, Engaged) RS232 voltage is ~-8V (1, Space, Idle) and ~+8V (0, Mark, Engaged)

Robocon 2007, HKUST RS232 / UART in-depth Required setting –Baud rate –Data size And read the specification for more!

Robocon 2007, HKUST RS232 / UART in-depth Task 1 –Send some character to your computer Task 2 –Store a line echo back to the computer