Raspberry Pi - I/O Interfaces

Similar documents
ECE 1160/2160 Embedded Systems Design. Midterm Review. Wei Gao. ECE 1160/2160 Embedded Systems Design

Interfacing Techniques in Embedded Systems

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

Introduction to I2C & SPI. Chapter 22

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

or between microcontrollers)

Raspberry Pi. Hans-Petter Halvorsen, M.Sc.

CprE 488 Embedded Systems Design. Lecture 4 Interfacing Technologies

Growing Together Globally Serial Communication Design In Embedded System

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Universität Dortmund. IO and Peripheral Interfaces

Serial Buses in Industrial and Automotive Applications

More on IO: The Universal Serial Bus (USB)

EE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave.

Serial Communication. Simplex Half-Duplex Duplex

Lecture 25 March 23, 2012 Introduction to Serial Communications

Lecture 14 Serial Peripheral Interface

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4

Arduino Uno R3 INTRODUCTION

Design Development and Implementation of SPI

Understanding SPI with Precision Data Converters

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Microcontrollers and Interfacing

Prototyping Module Datasheet

FPGA Implementation Of SPI To I2C Bridge

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

AT90SO72 Summary Datasheet

The Cubesat Internal bus: The I2C

Digital Storage Oscilloscope

Real Time Embedded Systems. Lecture 1 January 17, 2012

ECE 471 Embedded Systems Lecture 20

By: Haron Abdel-Raziq

PARALLEL COMMUNICATIONS

ICS Humla CTF. Copyright 2017 Payatu 1

Module Introduction. PURPOSE: The intent of this module, is to explain several of the important features of Freescale s i.mx1 applications processor.

spi 1 Fri Oct 13 13:04:

Team 2228 CougarTech 1. Training L2. Software Environment

Serial Communications

AT90SO36 Summary Datasheet

SILICON MICROSTRUCTURES

I2C a learn.sparkfun.com tutorial

EDBG. Description. Programmers and Debuggers USER GUIDE

Module 3.C. Serial Peripheral Interface (SPI) Tim Rogers 2017

Nano RK And Zigduino. wnfa ta course hikaru4

18-349: Introduction to Embedded Real-Time Systems

Serial Communication. Simplex Half-Duplex Duplex

Multicommunication Type Identifying Debugging Probe

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

AN10428 UART-SPI Gateway for Philips SPI slave bridges

BroadR-Reach click PID: MIKROE Weight: 26 g

Microcontroller interfaces

Basics of UART Communication

< W3150A+ / W5100 Application Note for SPI >

PAN502x Capacitive Touch Controller Datasheet

EECS 373 Design of Microprocessor-Based Systems

I2C a learn.sparkfun.com tutorial

Digital Circuits Part 2 - Communication

USB-to-I2C. Ultra Hardware User s Manual.

DESIGNING OF INTER INTEGRATED CIRCUIT USING VERILOG

VALLIAMMAI ENGINEERING COLLEGE

Embedded Workshop 10/28/15 Rusty Cain

SPI Universal Serial Communication Interface SPI Mode

EECS 373 Design of Microprocessor-Based Systems

Mbed Microcontroller SPI. Spring, 2018 Prof. Jungkeun Park

C8051F700 Serial Peripheral Interface (SPI) Overview

RL78 Serial interfaces

How to create your own peripheral modules for use with the ARC EMSK and embarc

USER GUIDE EDBG. Description

Serial Peripheral Interface (SPI)

Understand the design and operation of the SCI and the I 2 C, IrDA and Smart Card interfaces

Part 1 Using Serial EEPROMs

Serial Communications

Chapter 11: Input/Output Organisation. Lesson 17: Standard I/O buses USB (Universal Serial Bus) and IEEE1394 FireWire Buses

Serial Communication

Deterministic high-speed serial bus controller

HCTL Open Int. J. of Technology Innovations and Research HCTL Open IJTIR, Volume 4, July 2013 e-issn: ISBN (Print):

For reference only Refer to the latest documents for details

UNIT IV SERIAL COMMUNICATIONS

OUTLINE. SPI Theory SPI Implementation STM32F0 SPI Resources System Overview Registers SPI Application Initialization Interface Examples

UART TO SPI SPECIFICATION

Health monitoring of an power amplifier using an ethernet controller

3.2inch SPI Module MSP3218 User Manual

Real-Time Embedded Systems. CpE-450 Spring 06

GT24C02. 2-Wire. 2Kb Serial EEPROM (Smart Card application)

Read section 8 of this document for detailed instructions on how to use this interface spec with LibUSB For OSX

EMBEDDED SYSTEMS WITH ROBOTICS AND SENSORS USING ERLANG

SPI (Serial & Peripheral Interface)

EECS 373 Design of Microprocessor-Based Systems

DESIGN AND VERIFICATION OF LOW SPEED PERIPHERAL SUBSYSTEM SUPPORTING PROTOCOLS LIKE SPI, I 2 C AND UART

The 9S12 Serial Peripheral Inteface (SPI) Huang Section 10.2 through 10.6 SPI Block User Guide

Microcontroller basics

HZX N03 Bluetooth 4.0 Low Energy Module Datasheet

Serial Communications

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

Serial Peripheral Interface (SPI)

Ken Foust Intel. A Developer s Guide to MIPI I3C SM for Sensors and Beyond

An Introduction to Embedded System

Transcription:

ECE 1160/2160 Embedded Systems Design Raspberry Pi - I/O Interfaces Wei Gao ECE 1160/2160 Embedded Systems Design 1

I/O Interfaces Parallel I/O and Serial I/O Parallel I/O: multiple input/output simultaneously Data Bus, Address Bus, Intel 8255, printer Serial I/O: transferring data between CPU and peripherals one bit at a time, sequentially Ethernet, USB, Inter-integrated Circuit, Serial Peripheral Interface ECE 1160/2160 Embedded Systems Design 2

I/O Interfaces Parallel v.s. Serial Parallel Wider bandwidth More wires indicate more overhead Simple I/O operation Serial 1-bit transfer per time unit Less wires indicate less overhead Complex I/O protocol ECE 1160/2160 Embedded Systems Design 3

I/O Interfaces Serial over Parallel Parallel interfaces have less reliability Interference and noise corrupt data Capacitance and mutual inductance affects bandwidth Serial Less mutual interference between wires Higher clock frequency increases transmission rate ECE 1160/2160 Embedded Systems Design 4

Inter-integrated Circuit (I2C) Inter-integrated Circuit (I 2 C or I2C) Two-wire interface Simple master/slave relationships No strict baud requirement and a master generates a bus clock Each device is software-addressable by a unique address Philips semiconductors (now NXP) ECE 1160/2160 Embedded Systems Design 5

Inter-integrated Circuit (I2C) I 2 C connection example ECE 1160/2160 Embedded Systems Design 6

Inter-integrated Circuit (I2C) I 2 C Terminology Master: sends out signals (clock signal and communication signal) to slaves Slave: listens to the bus and waits to be addressed by master Multi-master: I2C allows connections of multiple masters Arbitration: decides which master to use wire ECE 1160/2160 Embedded Systems Design 7

Inter-integrated Circuit (I2C) I 2 C Bus Signal Serial Clock Line (SCL): synchronize all data transfer over I2C bus Serial Data Line (SDL): convey data among masters and slaves ECE 1160/2160 Embedded Systems Design 8

Inter-integrated Circuit (I2C) Serial Data Transfer One bit data transferred per each clock pulse SDA signal can only change when the SCL signal is low Data should be stable when clock is high ECE 1160/2160 Embedded Systems Design 9

Inter-integrated Circuit (I2C) Start and Stop condition Both initiated by master SCL has to be high in both case SDA High to low: START Low to high: STOP ECE 1160/2160 Embedded Systems Design 10

Inter-integrated Circuit (I2C) Data Transfer Data is transferred in sequence of 8 bits Acknowledgement (ACK) bit follows 8-bit data transfer 9 clock pulses are for each 8-bit data ECE 1160/2160 Embedded Systems Design 11

Inter-integrated Circuit (I2C) Device Addressing 7-bit addresses Remaining 1 bit is for Read/Write command 1 is for Read 0 is for Write Located at LSB Each slave device has an unique address ECE 1160/2160 Embedded Systems Design 12

Inter-integrated Circuit (I2C) Communication with 7-bit I2C Address Initiating communication Addressing slave device Transferring data Ending communication ECE 1160/2160 Embedded Systems Design 13

Inter-integrated Circuit (I2C) Smart phone Automotive Instrument Robotics Aerospace ECE 1160/2160 Embedded Systems Design 14

Serial Peripheral Interface (SPI) Serial Peripheral Interface (SPI) Serial protocol Peripheral connections in embedded system Microcontroller EEPROMs Quick communication over short distance Motorola ECE 1160/2160 Embedded Systems Design 15

Serial Peripheral Interface (SPI) Basic Model Serial Click (SCLK or SCK): clock pulse that synchronizes data transmission generated by master Master In Slave Out (MISO): slave line for sending data to master Master Out Slave In (MOSI): master line for sending data to peripherals. Slave Select(SS): pin on which device the master could use to enable/disable specific devices ECE 1160/2160 Embedded Systems Design 16

Serial Peripheral Interface (SPI) Multiple Slaves Model One master Full duplex communication ECE 1160/2160 Embedded Systems Design 17

Serial Peripheral Interface (SPI) Bus Standard Clock Priority (CPOL): designate default value (high/low) of SCK signal Clock Phase (CPHA): determine which edge of clock data is sampled(rising/falling) CPOP = 0 and CPHA = 0 indicates that the data is sampled at rising edge. ECE 1160/2160 Embedded Systems Design 18

Serial Peripheral Interface (SPI) Bus timing ECE 1160/2160 Embedded Systems Design 19

Serial Peripheral Interface Write/Read Transaction Write Transaction lower SS# to select slave device sending instruction bytes and data bytes via MOSI ECE 1160/2160 Embedded Systems Design 20

Serial Peripheral Interface Write/Read Transaction Read Transaction lower SS# to select slave device sending instruction byte via MOSI and receiving data byte by MISO ECE 1160/2160 Embedded Systems Design 21

SPI v.s. I2C Which one? I2C require two wires while SPI may need more SPI support full-duplex communication while I2C is slower I2C is more power-consuming than SPI I2C has ACK to verify data transfer while SPI is not I2C may have multiple master but SPI only has one master ECE 1160/2160 Embedded Systems Design 22

SPI v.s. I2C SPI I2C high speed and low consumption application faster large number of peripheral requirement and multiple masters flexible But both are robust protocols for embedded applications ECE 1160/2160 Embedded Systems Design 23

Universal Serial Bus (USB) Universal Serial Bus (USB) USB: cable, connector and communication protocols for connection, communication and power supply between computer and devices. ECE 1160/2160 Embedded Systems Design 24

Universal Serial Bus (USB) USB Evolvement ECE 1160/2160 Embedded Systems Design 25

Universal Serial Bus (USB) Master-Slave connection Master: deciding what happen Hardware Detecting USB connection Providing electrical power Controlling data transfer Software Handling connectivity Configuring USB devices Running device driver Managing power and bandwidth Slave: listening ECE 1160/2160 Embedded Systems Design 26

Universal Serial Bus (USB) Complex Protocol Data Transmission consists of three packets Token packet: header that defines transaction type, direction, device address and endpoint Data packet: transmission of data Handshake packet: acknowledgement of final status for transaction ECE 1160/2160 Embedded Systems Design 27

Universal Serial Bus (USB) 4 Data Transfer Type Control transfer: exchange configuration, command information between device and host Isochronous transfer: used by time-sensitive application such as speaker, video camera Bulk transfer: used by scanners and printers that receive data in one big packet and time is not crucial Interrupt transfer: used by peripherals which need immediate attention from host ECE 1160/2160 Embedded Systems Design 28

General Purpose Input/Output General Purpose Input/Output (GPIO) physical pins on board, not a bus input/output behavior controlled by user at run time no predefined purpose on pins ECE 1160/2160 Embedded Systems Design 29

General Purpose Input/Output Pin Operation pin could be configured input/output pin could be disabled/enabled two modes(high/low) Configured as output to light LED Configured as input to get motion of push button ECE 1160/2160 Embedded Systems Design 30

General Purpose Input/Output Protocols on Pi s GPIO I2C SPI GPIO 2 & 3: SDA and SCL GPIO 7 & 8: SS GPIO 9, 10 & 11: MISO, MOSI, SCK UART GPIO 14 & 15: TXD and RXD Other GPIO pin power, ground and normal pin with Input/output configuration ECE 1160/2160 Embedded Systems Design 31

Lab 2 Lab 2 is due 10/16 and 10/18 Everyone checks out one Raspberry Pi from the TA 5% in final grade You will work on it on your own No collaboration is allowed! Need to let the TA check you off Practicing with I/O over Raspberry Pi Using the pre-installed Python libraries to operate SenseHAT Interrupts over Linux OS http://www.pitt.edu/~weigao/ece1160/fall2017/lab2.htm ECE 1160/2160 Embedded Systems Design 32

Sense HAT LED Matrix Accelerometer Gyroscope Magnetometer Temperature Humidity Pressure Joystick ECE 1160/2160 Embedded Systems Design 33