Chapter 8 Serial and Parallel Port Interfacing Valvano’s Intro. To Embedded Systems.

Slides:



Advertisements
Similar presentations
EUSART Serial Communication.
Advertisements

INPUT-OUTPUT ORGANIZATION
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Serial I/O - Programmable Communication Interface
SPI Serial Peripheral Interface. SPI Serial Peripheral Interface is communication between two devices, one bit at a time sequential one bit at time over.
Lecture 8: Serial Interfaces
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
Local Asynchronous Communication and RS-232. Goals Explain how electric current can be used to transmit bits over short distances Present a popular mechanism.
Photolithography Machine Control System Ben Conrad and Mark Edwards Projects in Computer Engineering II December 9, 2003.
Serial Input/Output Interface Outline –Serial I/O –Asynchronous serial I/O –6850 ACIA –68681 DUART –Synchronous serial I/OInterface Standards –68000 Serial.
Coordinate Based Tracking System
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.
1 ECE 263 Embedded System Design Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System.
Input/Output and Communication
Harrison Jones Alexis Noel William Allen SERIAL COMMUNICATION INTERFACE (SCI)
Module 2: Hardware and Terminology
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.
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
INPUT-OUTPUT ORGANIZATION
Embedded Systems Design
Serial Communication Interface (SCI) Kevin Stuart Matt Betts March 27, 2007 ME 6405, Sp 07.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
Ch. 9 Interrupt Programming and Real-Time Sysstems From Valvano’s Introduction to Embedded Systems.
Input/Output mechanisms
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
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.
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
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
Other Chapters From the text by Valvano: Introduction to Embedded Systems: Interfacing to the Freescale 9S12.
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.
Universal Asynchronous Receiver/Transmitter (UART)
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
Embedded Systems February 10, Serial Interface - SPI  Serial Peripheral Interface  Synchronous communications  Clock supplied by the Master.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.
8251 USART.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes.
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.
Chapter 6 Input/Output Organization
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
E3165 DIGITAL ELECTRONIC SYSTEM
UART Serial Port Programming
Asynchronous Serial Communications
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.
Serial Communication 19th Han Seung Uk.
Presentation transcript:

Chapter 8 Serial and Parallel Port Interfacing Valvano’s Intro. To Embedded Systems

8.1 General Intro. To Interfacing Three Components –Mechanical Design of the Physical Components (Selection of the parts.) –Analog and Digital electronics used to connect the physical devices. –Low-Level Software (transforms the mechanical and electrical devices into objects that perform the desired tasks.

9S12 Interfacing 9s12 is built using CMOS –Involves consideration of voltage, current, and capacitance.

Digital Output IOH—largest current a port pin can source when the output is high. VOH—smallest voltage a port pin can be if the output is high. VDD—the power into the microcontroller Output High Voltage is between VDD and VOH.

Digital Output (cont.) IOL—the largest current a port pin can sink when the output is low. VOL—the largest voltage a port pin can be if the output is low and the current is less than IOL (the output low voltage will be between 0 and VOL.

Digital Inputs IIH – the current the input will require when the input is high. VIH—the voltage above which the input is considered high. IIL—the current the input will require when the input is low. VIL – voltage below which the input will be considered low.

Capacitance Capacitance loading occurs with each input and with long cables. –Input— C=6pF –Time constant CxR where R is the resistance in the interface circuit. –Example: V(t) = 5 – 5 exp(-t/RC) Output of one circuit is attached to the input of another. If output goes from 0 to +5volts, the voltage is perceived as V(t)

Device Driver A collection of software functions that allow higher level software to utilize an I/O device. Glossary definition( page 517): A collection of software routines that perform I/O functions.

8.2 Serial Communications Interface, SCI Protocol is same as a UART. Old, but still in use on modern microcontrollers discusses the RS232 Protocol discusses the transmission of an asynchronous character discusses the reception of an asynchronous character.

S12 SCI Details The C32 has one SCI port and the DP512 has two ports. SCIDRL—SCI Data Register Low byte –Transmit Data Register (Figure 8.3) –Receive Data Register ( Figure 8.4) –SCIBD—(SCI0BD,SCI1BD)—baud rate register.

SCI Baud Rate SCI Baud Rate Control Register –M—mode bit selects 8-bit (0) or 9-bit(1) data frames. –A frame always has a start bit and 1 or 2 stop bits. –Baud rate—total number of bits/second –SCI Baud Rate= Mclk/16*BR BR is in bits 12:0 of the SCIBD Mclk is the module clock—typically the same as E clock.

Table 8.4 (pg.290) SCICR2 –TE(bit 3) --transmit enable. –RE(bit 2) –receive enable. –TIE(bit 7) –transmit interrupt enable. –TCIE(bit 6) – transmit complete interrupt enable. –RIE(bit 5)—receiver interrupt enable. –ILIE (bit 4)—idle line interrupt enable –RWU(bit 1)—recever wakeup control bit. –SBK(bit 0)– send break bit

Table 8.4 (cont.) SCICR1 –Loops (bit 7) –enables loop mode. –RSRC (bit 5)—receiver source (when loops=1) –M (bit 4)—mode bit. –WAKE (bit 3)-wake on idle line or msb –ILT (bit 2) – idle line type (for the receiver) –PE (bit 1)– parity enable. –PT (bit 0)—parity type (0 for even parity)

Table 8.4 SCISR1—SCI status register 1. –TDRE—(bit 7) –transmit data register empty. –TC—(bit 6)—transmit complete flag. –RDRF—(bit 5)—Receive Data Register Full –IDLE—(bit 4)—idle line detected –OR—(bit 3)—overrun error –NF—(bit 2) –noise flag (set if 3 samples are not the same for a received bit.) –FE—(bit 1)—frame error (set when no stop bit is detected.) –PF—(bit 0)—parity flag; (set when parity violation is found and PE bit is set.)

Table 8.4 SCISR2—SCI status register 2 –Contains two mode control bits and one status bit. BRK13 (Bit 2)—Break Transmit Character Length TXDIR (Bit 1)—Transmitter Pin Data Direction RAF (BIT 0)—Receiver Active Flag

Busy-Waiting Same as gadfly or polling. Software continuously checks the hardware status, waiting for it to be ready. Figure 8.6(page 293)—Flow Charts.

8.3 Serial (Synchronous) Peripheral Interface Faster than SCI for interconnecting boards and a PC.

8.3.1 SPI Fundamentals SPI used to attach additional I/O devices (such as A/D’s and D/AC’s). SPI implements a synchronous protocol. –Same clock is used.

8.3.1 SPI (cont.) Freescale SPI—4 I/O lines –Slave Select --NOT–optional negative logic control signal. –SClk—50% duty cycle clock generated by the master. –MISO—master in, slave out data line. –MOSI—master out, slave in data line.

SPI (cont.) –Transmitting device uses one edge of the clock for changing data, and the receiving device uses the other edge. Controlled by CPOL(BIT 3) and CPHA(BIT 2) of the SPICR1 See Figures 8.7 and 8.8 on page 295. Pages has more details.

bit DAC Interface Example 8.2 Design an 8-bit DAC with range of 0 to +5.

8.4 Scanned Keyboards Switches are placed in a row/column matrix. Fig (pg. 301) illustrates a matrix keyboard. Computer drives one row at a time. Columns are read to determine which key is pressed.

8.5 Parallel Port LCD Interface with the HD44780 Controller The HD44780 Controller is an industry standard for interfacing to a Liquid Crystal Display. ASCII characters can be written to the HD44780 controller. The ASCII character will be mapped onto the display as a 5 by 8 bit pixel image.

8.6 Binary Actuators Relays, solenoids, and DC motors have electrical interfaces that are similar.

8.7 Pulse-Width Modulation PWM can be used to deliver power in a variable manner. The Duty Cycle can vary –Duty = (H)/(H+L) (the fraction of the time that the signal is high. –Where H is the time that the signal is high. –And L is the time that the signal is low. –Figure 8.21 illustrates the wave forms.

8.8 Stepper Motors Evaluation of a motor: –Maximum speed (RPM) –Torque –Efficiency of translating electrical power into mechanical power

Stepper Motors (cont.) Stepper Motors—control the rotational position. Used in applications where precise positioning is more important than speed, torque, or efficiency.