Unit D. Serial Interfaces. Serial vs. Parallel. Serial Interfaces. Serial Communications

Similar documents
EE 308: Microcontrollers

Serial Input/Output. Lecturer: Sri Parameswaran Notes by: Annie Guo

EECE494: Computer Bus and SoC Interfacing. Serial Communication: RS-232. Dr. Charles Kim Electrical and Computer Engineering Howard University

APPLICATION BULLETIN. SERIAL BACKGROUNDER (Serial 101) AB23-1. ICS ICS ELECTRONICS division of Systems West Inc. INTRODUCTION CHAPTER 2 - DATA FORMAT

TCSS 372 Laboratory Project 2 RS 232 Serial I/O Interface

Lecture #3 RS232 & 485 protocols

A Beginners Guide to AVR

Roland Kammerer. 13. October 2010

USING RS-232 to RS-485 CONVERTERS (With RS-232, RS-422 and RS-485 devices)

Serial Communications RS232, RS485, RS422

ATmega 16. Dariusz Chaberski

SMARTALPHA RF TRANSCEIVER

CDR-915 Data Radio Module INTEGRATOR S GUIDE

Local Asynchronous Communication. By S.Senthilmurugan Asst.Professor/ICE SRM University. Chennai.

Stensat Transmitter Module

EEL 4744C: Microprocessor Applications. Lecture 9. Part 2. M68HC12 Serial I/O. Dr. Tao Li 1

Applications. Operating Modes. Description. Part Number Description Package. Many to one. One to one Broadcast One to many

Catalog

Asynchronous Serial Communications The MC9S12 Serial Communications Interface (SCI) Asynchronous Data Transfer

Fanuc Serial (RS232) Communications Information

EE 109 Midterm Review

Lesson 3: Arduino. Goals

Mate Serial Communications Guide This guide is only relevant to Mate Code Revs. of 4.00 and greater

Electronics / Water analogy. Resistor. Inductance. Capacitor. Water Electronics Energy - Energy Pressure - Voltage Flow - Current Volume - Charge

Electronics Design Laboratory Lecture #9. ECEN 2270 Electronics Design Laboratory

Home Automation, Inc. Omnistat2. RC-1000 and RC-2000 Communicating Thermostat. Serial Protocol Description

G3P-R232. User Manual. Release. 2.06

TRXQ1 RXQ1 FM NARROW BAND TRANSCEIVERS. RXQ1 Version. Applications. TRXQ1 Version

Serial Communication AS5132 Rotary Magnetic Position Sensor

Lesson UART. Clock Systems and Timing UART (Universal Asynchronous Receiver-Transmitter) Queues Lab Assignment: UART

Microcontrollers. Serial Communication Interface. EECE 218 Microcontrollers 1

Design and Development of Smart. Harmonic Analyzer

TIP551. Optically Isolated 4 Channel 16 Bit D/A. Version 1.1. User Manual. Issue December 2009

The "FISH" Quad Hand Sensor

Multi-Channel RS-232 Serial RF Transceiver

ROM/UDF CPU I/O I/O I/O RAM

SV613 USB Interface Wireless Module SV613

Arduino Arduino RF Shield. Zulu 2km Radio Link.

Chapter 9: Serial Communication Interface SCI. The HCS12 Microcontroller. Han-Way Huang. September 2009

Catalog

Arduino Lesson 1. Blink. Created by Simon Monk

Instructor: Dr. Phillip Jones

COMP467. Local Asynchronous Communication. Goals. Data is usually sent over a single channel one bit at a time.

WWVB Receiver/Decoder With Serial BCD or ASCII Interface DESCRIPTION FEATURES APPLICATIONS

A Low-Cost Li-Fi Communication Setup

2F. No.25, Industry E. 9 th Rd., Science-Based Industrial Park, Hsinchu, Taiwan Application Note of OGM220, AN001 V1.8

Semiconductor MSM82C51A-2RS/GS/JS UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER

Part Number Weblink for the part Description Unit Price. Hardware interfacing to the Freescale 9S12C32 MCU on board the CSM-12C32 module

Channels that are not occupied by temperature sensors, can take over alternative functions:

AT-XTR-7020A-4. Multi-Channel Micro Embedded Transceiver Module. Features. Typical Applications

Review for Final Exam

Programmable communications interface (PCI)

EE 314 Spring 2003 Microprocessor Systems

Lab 7 Remotely Operated Vehicle v2.0

PERIPHERAL INTERFACING Rev. 1.0

BV4112. Serial Micro stepping Motor Controller. Product specification. Dec V0.a. ByVac Page 1 of 18

Voltage regulator TAPCON 240

Training Schedule. Robotic System Design using Arduino Platform

Asynchronous Serial Interfacing (UART)

USB Port Medium Power Wireless Module SV653

RF Wireless Serial Device Server

M7 Series Modems for SCADA Applications

Interfacing Sensors & Modules to Microcontrollers

MD04-24Volt 20Amp H Bridge Motor Drive

ECE 4510/5530 Microcontroller Applications Week 6 Lab 5

Shenzhen ATC Technology CO.,LTD ATC. A-1 Serial Remote I/O Module. User Manual. V1.13 Edit:2018/01/

Quick-Start Guide. M7 Series DATA RADIO MODEM

USER'S MANUAL. Model : K

Concept of Serial Communication

EECS 192: Mechatronics Design Lab

Voltage regulator TAPCON 260

DASL 120 Introduction to Microcontrollers

Ocean Controls KT-5221 Modbus IO Module

PRODUCT INFORMATION B&B ELECTRONICS. Port-Powered RS-232 Fiber Optic Modem with Handshake Support. Model 9PFLST. Description. RS-232 Connections

EE 308 Lab Spring 2009

TIP500. Optically Isolated 16 Channel 12 Bit ADC. Version 1.1. User Manual. Issue January 2010

SECTION 6 SERIAL AUDIO INTERFACE

Select the single most appropriate response for each question.

13. OP-03 RS-232C SERIAL INTERFACE

WIEG4PRT-A Four port Wiegand to RS232 Converter.

Micro Fox PicCon Manual

Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett

MSP430 Teaching Materials

Catalog

IP-OPTODA16CH4. 4 Channels of Optically Isolated 16-Bit D/A Conversion. User Manual. SBS Technologies, Inc. Subject to change without notice.

ST600 TRANSMITTER OPERATING INSTRUCTIONS

Kongsberg Mesotech Ltd.

WIE232-A Dual Wiegand to RS232 Converter.

King Fahd University of Petroleum & Minerals Computer Engineering Dept

SC16C550B. 1. General description. 2. Features. 5 V, 3.3 V and 2.5 V UART with 16-byte FIFOs

3V TRANSCEIVER 2.4GHz BAND

For Direct computer control see the Data Out connector description. For Radio control see the Data In connector description.

Understanding the Arduino to LabVIEW Interface

CALIFORNIA SOFTWARE LABS

PART 4 DIGITAL METHODS. Chapter 13 Digital Fundamentals. Parallel Data Transfer. Fig Parallel data handshaking

Back to. Communication Products Group. Technical Notes. Local/Remote Control, 9300 Series

RF ISM Transparent Transceiver Module V4.0

Quick Start. Precis-BX305. Precise GNSS RTK Board.

GP4 PC Servo Control Kit 2003 by AWC

RTM Baud Radio Data Modem

Transcription:

D.1 Serial Interfaces D.2 Unit D Embedded systems often use a serial interface to communicate with other devices. Serial implies that it sends or receives one bit at a time. Serial Communications Serial Interfaces D.3 Serial vs. Parallel D.4 Different from a parallel interface that sends/receives multiple bits at a time. Example: The LCDs used it the labs used a 4-bit parallel interface to transfer commands and data. Serial interfaces Pros: less hardware cheaper, good for consumer products Cons: slower Parallel interfaces Pros: faster Cons: requires more wiring and larger connectors more $$. Example: PATA vs. SATA disk interface PATA (Parallel ATA) uses 40 conductors SATA (Serial ATA) uses 7 conductors

Pick Your Serial Interface Embedded systems can use a variety of serial interfaces. Numerous manufacturers have developed interface "standards" Choosing which to use depends on several factors. What interface is available on the device you need to talk to Speed Distance between devices Cost of wiring and connectors Complexity of software Reliability Common Serial Interfaces RS-232, I2C, (Q)SPI, USB, SATA, PCIe, Thunderbolt D.5 Before USB became common, PCs had COM ports that were RS-232 serial ports. To add an RS-232 port to a newer system, use a USB to serial adapter. Uses a minimum of three wires Transmit Receive Ground [Optional] handshake signals that are often not used. D.6 D.7 D.8 One-to-one topology Despite its age, RS-232 is still heavily used Full duplex (if both devices are capable of it) Longer distances Specs say 50 feet, but can often be much longer (>1000 ft) with proper cables and data rates. Uses bipolar voltages to signal 1 s and 0 s Industrial devices Data logging devices Headless servers, for use during installation Anything that needs a simple interface, often for configuration 3 to 15 Volts = 1 +3 to +15 Volts = 0 Very simple interface to implement in both hardware and software.

D.9 D.10 An asynchronous interface I 2 C and SPI are synchronous interfaces since there is clock signal RS-232 only sends data, no clock signal accompanying the data In order to correctly receive the data, the receiver must derive clocking information by examining the data To correctly receive the data, the transmitter and receiver have to agree on how the data will be sent Must agree on data rate Data rates given in bits/second or baud rate Use any rate, as long as TX and RX devices agree on the rate In most cases, standard rates are used: 300, 2400, 9600, 28800, 57600, 115200, etc. Many devices will specify that they can only communicate at one rate Must agree on the format of the data How many data bits sent for each character? Which comes first, the MSB or the LSB? What other bits are sent along with the data? D.11 D.12 To send a byte, the transmitter sends Start bit (a zero) Data bits, LSB first, MSB last Parity bits (optional) Stop bits (a one, 1 or 2 of them) Example: to send an M Parity bit sent after the MSB to help detect errors Even parity Transmitter adds a 0 or 1 so the number of ones sent is even Receiver checks that an even number of ones was received Odd parity ASCII code = 0x4D = 01001101 Transmitter adds a 0 or 1 so the number of ones sent is odd Receiver checks that an odd number of ones was received Transmitter and receiver better agree: odd or even If parity at received end is incorrect, a flag is set

AVR USART0 Module D.13 AVR USART0 Module D.14 Supports both asynchronous and synchronous modes Bad News: lots of registers and bits Data lengths of 5, 6, 7, 8 or 9 bits, plus parity Interrupt generation on both transmit and receive Uses same pins as PORTD, bit 0 and 1 If TX or RX enabled, can t use that pin for I/O D0 = PD0 D1 = PD1 D2 = PD2 D3 = PD3 D4 = PD4 AVR USART0 Module D.15 RX and TX by polling D.16 Good News: Can ignore most bits or leave as zero First step, find the value to go in UBRR0 for the desired baud rate. Use compiler directives to calculate the value UDR0 received and transmitted data register #define FOSC 16000000 // Clock frequency #define BAUD 9600 // Baud rate used #define MYUBRR (FOSC/16/BAUD-1) // Value for UBRR0 Actually two registers at the same address Write to it stores data to be transmitted Read from it gets data that has been received Store it in the UBRR0 register UBRR0 = MYUBRR; // Set baud rate

RX and TX by polling D.17 RX and TX by polling D.18 Second steps Enable the receiver and/or transmitter Set the values in UCSR0C for the desired communications settings Most of the bits in UCSR0C can be left as zeros UCSR0B = (1 << TXEN0 1 << RXEN0); // Enable RX and TX UCSR0C = (3 << UCSZ00); // Async., no parity, // 1 stop bit, 8 data bits Routines for RX and TX Receiver: checks RXC0 bit to find out when new data has come in. Transmitter: checks UDRE0 bit to find out when transmitter is empty. char rx_char() { // Wait for receive complete flag to go high while (!(UCSR0A & (1 << RXC0)) ) {} return UDR0; } The receiver and transmitter are now ready to go and waiting for data. void tx_char(char ch) { // Wait for transmitter data register empty while ((UCSR0A & (1<<UDRE0)) == 0) {} UDR0 = ch; } D.19 D.20 Tri-State Gates Tri-State Gates Problem: How can you use the serial I/O lines of the Arduino, which are also used for programming it? Solution: Use a Tri-State gate to isolate the transmitter's data from the until programming is over. Pxx 74LS125 Arduino RX Transmitter Arduino RX TX Transmitter USB Two active devices, both trying to output a signal, collide here. USB Output of gate is floating until program makes Pxx a zero. Arduino Uno Arduino Uno