Serial Communication. Simplex Half-Duplex Duplex

Similar documents
Serial Communication. Simplex Half-Duplex Duplex

Serial Communication. Spring, 2018 Prof. Jungkeun Park

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

Real-Time Embedded Systems. CpE-450 Spring 06

Universität Dortmund. IO and Peripheral Interfaces

Amarjeet Singh. January 30, 2012

Sender Receiver Sender

Serial Communication Prof. James L. Frankel Harvard University. Version of 2:30 PM 6-Oct-2015 Copyright 2015 James L. Frankel. All rights reserved.

Serial Communications

Interfacing Techniques in Embedded Systems

Serial Communications

Raspberry Pi - I/O Interfaces

Communication. Chirag Sangani

Growing Together Globally Serial Communication Design In Embedded System

Concepts of Serial Communication

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

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

PARALLEL COMMUNICATIONS

An SPI interface for the 65(C)02 family of microprocessors

For reference only Refer to the latest documents for details

More on IO: The Universal Serial Bus (USB)

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

EECS 373 Design of Microprocessor-Based Systems

Basics of UART Communication

Design with Microprocessors

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

Serial Peripheral Interface Bus SPI

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems

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

Digital Storage Oscilloscope

or between microcontrollers)

PCI Express 4-Port Industrial Serial I/O Cards

Hierarchy of I/O Control Devices

ZigBee Compliant Platform 2.4G RF Low Power Transceiver Module for IEEE Standard. DATA SHEET Version B

Microcontrollers and Interfacing

Serial Communications

Features: Analog to Digital: 12 bit resolution TTL outputs, RS-232 tolerant inputs 4.096V reference (1mV/count) 115K max speed

Understanding SPI with Precision Data Converters

UART TO SPI SPECIFICATION

18-349: Introduction to Embedded Real-Time Systems

Dariusz Makowski Department of Microelectronics and Computer Science tel

DIGITAL COMMUNICATION SWAPNIL UPADHYAY

User Guide. Date Apr BlueEva+C11/G2. Stollmann. E + V GmbH. User Guide

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

Lecture 25 March 23, 2012 Introduction to Serial Communications

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

Serial Interfaces Part 1. ECE 153B Sensor & Peripheral Interface Design Winter 2016

TKT-3500 Microcontroller systems

Intelop. *As new IP blocks become available, please contact the factory for the latest updated info.

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

Introduction to I2C & SPI. Chapter 22

WM1030 Rev Introduction. Ultra low power DASH7 Modem. Applications. Description. 868 / 915 MHz. Features. WIZZILAB Technical datasheet 1/10

Addressing scheme to address a specific devices on a multi device bus Enable unaddressed devices to automatically ignore all frames

Serial Buses in Industrial and Automotive Applications

Serial Interfacing. Asynchronous Frame

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

Learn how to communicate

System Specification Version 3.31 MMCA Technical Committee

SH1030 Rev Introduction. Ultra low power DASH7 Arduino Shield Modem. Applications. Description. 868 MHz. Features

To be familiar with the USART (RS-232) protocol. To be familiar with one type of internal storage system in PIC (EEPROM).

USER GUIDE EDBG. Description

AT90SO36 Summary Datasheet

INTRODUCTION TO FLEXIO

1.6inch SPI Module user manual

More on the 9S12 SPI Using the Dallas Semiconductor DS1302 Real Time Clock with the 9S12 SPI

An SPI Temperature Sensor Interface with the Z8 Encore! SPI Bus

19.1. Unit 19. Serial Communications

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Communication Module No: CS/ES/11 Quadrant 1 e-text

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

The Wireless Connectivity Expert

Bluetooth V4.1 BLE RS-232 Serial Adapter Model: BLE-232B Bluetooth V4.2 BLE RS-232 Serial Adapter Model: BLE-232C

The SPI supports data bus widths of 32 bits.

BT-22 Product Specification

Serial I/O. 4: Serial I/O. CET360 Microprocessor Engineering. J. Sumey

Product Specification

SPI (Serial & Peripheral Interface)

HDLC-ETH. Serial Ethernet Converter. Rev. Dec 20, Datasheet. Website:

MCS-51 Serial Port A T 8 9 C 5 2 1

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of

Serial Peripheral Interface (SPI)

ISDN OEM1. DesignGuide V1.2

HZX N03 Bluetooth 4.0 Low Energy Module Datasheet

Electronics Single wire communication

ECE251: Thursday November 8

Part 1 Using Serial EEPROMs

+ (5~27 VDC) GND. Bluetooth V4.1 BLE RS-232 Serial Adapter. Model: BLE-232B. 1. Package content: BLE RS-232 adapter

ECE Microcontrollers. Serial Peripheral Interface (SPI) & NRF24 Radio

Fig.12.5 Serial Data Line during Serial Communication

Data Communications & Computer Networks. Digital Data Communications Techniques

Innovati s Bluetooth 100M Universal Wireless Bluetooth Module

EDBG. Description. Programmers and Debuggers USER GUIDE

TSS463C. VAN Data Link Controller with Serial Interface. Features. Description

Product Specification

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 9: Serial Peripheral Interface (SPI)

Chapter 11: Input/Output Organisation. Lesson 05: Asynchronous RS232C Serial Port data transfer

+ (5~27 VDC) GND. Bluetooth V4.2 BLE RS-232 Serial Adapter. Model: BLE-232D-E. 1. Package content: BLE RS-232 adapter

1 The Attractions of Soft Modems

SPI Controller. Features of the SPI Controller. SPI Block Diagram and System Integration

Transcription:

1.5. I/O 135

Serial Communication Simplex Half-Duplex Duplex 136

Serial Communication Master-Slave Master Master-Multi-Slave Master Slave Slave Slave (Multi-)Master Multi-Slave Master Slave Slave Slave 137

Serial Communication Synchronous Master Slave Asynchronous Master Slave 138

Some Bus Types Wires (+Gnd) Directionality Synchrony Distance typ. RS-232 2/4 7 full duplex asynchronous +synchronous Speed typ. 10 m 115kbps / 1Mbps Remarks Point-to-Point Interference prone RS-485 2/4 half/full duplex asynchronous 1000 m Mbps Differential Signalling SPI [aka SSP, Microwire] I 2 C [SMBus] 4 full duplex synchronous few cm 10 Mbps Master-Multi-Slave with Slave select 2 half duplex synchronous few m 100kbps- 3Mbps 1-Wire 1 half duplex time-slot based, synchronous USB 2.0 2 + Vcc USB 3.0 2/ 6 +DGnd + Vcc tens of m 15kbps/ 125kbps half-duplex asynchronous few m 12Mbits/ 480 MBits full-duplex asynchronous few m 5/10 GBits Addressed Multi-Master Master-Multi-Slave Parasitic power isochronous/ bulk/ interrupt transfers 139

SPI SCLK Master shift register MOSI MISO SS shift register Slave SS SCLK: Serial bit-rate Clock MOSI: Master data Output, Slave data Input MISO: Master data Input, Slave data Output SS: Slave Select shift register Slave 140

SPI Four wire serial bus invented / named by Motorola Serial connection between two or more devices (microprocessors, D/A converters) Configurations 1 Master, 1 Slave (single slave mode) 1 Master, N Slaves (multiple slave mode) Synchronous bidirectional data transfer Data transfer initiated by Master Bandwidth some KBits/s up to several MBits/s Simple implementation in software Used in a variety of devices, such as memory (flash, EEPROM), LCD displays and in all MMC / SD cards 141

Communication sampling SCLK SS MOSI Bit[7] Bit[6] Bit[5] Bit[1] Bit[0] End of transfer data state MISO undefined Bit[7] Bit[6] Bit[5] Bit[1] Bit[0] undefined MSB 8 bits LSB 142

Polarity SCLK Polarity = 0 Polarity = 1 Bit[7] Bit[6] Bit[5] Bit[1] Bit[0] End of transfer data state 143

Phase Phase = 0 SCLK Phase = 1 Bit[7] Bit[6] Bit[5] Bit[1] Bit[0] End of transfer data state 144

SPI Data Transfer Master configures the clock Master selects slave (SS), followed by waiting period (if required by slave) Full duplex data transmission in each cycle Master sends bit over MOSI line, slave reads bit Slave sends bit over MISO line, master reads bit Two shift registers, one in slave, one in master for transfer When no data is to be transmitted any more, master stops toggling the clock No acknowledgement mechanism No device interrupts 145

Programming SPI 1. Bit-Banging Master GPIO Pins 146

Programming SPI 1. Bit-Banging FOR i := 7 TO 0 BY -1 DO IF ODD(ASH(data,-i)) THEN Platform.WriteBits(Platform.GPSET0, MOSI); ELSE Platform.WriteBits(Platform.GPCLR0, MOSI); END; Kernel.MicroWait(HalfClock); Platform.WriteBits(Platform.GPSET0, CLOCK); Kernel.MicroWait(HalfClock); Platform.WriteBits(Platform.GPCLR0, CLOCK); END; 147

Programming SPI 2. Using a Controller Master SPI Controller 148

Programming SPI 2. Using a Controller (* start transition *) Platform.SetBits(Platform.SPI_CS, {TA}); REPEAT UNTIL TXD IN Platform.ReadBits(Platform.SPI_CS); Platform.WriteWord(Platform.SPI_FIFO, data); junk := Platform.ReadWord(Platform.SPI_FIFO); REPEAT UNTIL DONE IN Platform.ReadBits(Platform.SPI_CS); (* transfer inactive *) Platform.ClearBits(Platform.SPI_CS, {TA}); 149

BCM 2835 Registers CS -- Control and Status Chip Select FIFO Status Transfer Progress Interrupts Polarity & Phase FIFO Register Data Write: TX Fifo Read: RX Fifo CLK Clock Divider Other DMA Control Special Mode Control 150

MAX7219 8-Digit LED Display Driver Max7219 Specification, p.5 151

MAX7219 8-Digit LED Display Driver Max7219 Specification, p.6 152

MMC and SD Cards Low cost memory system for persistent data on solid state mass storage (for example flash memory cards) Separate bus system 1 master, N slaves (cards) typically 1 master for one card Serial & synchronous transfer of commands and data Sequential read/ write Block read/ write Power Supply Bus Master Multi Media Card Bus Card (I/O) Card (ROM) Card (Flash) 153

GPIO Pins SD Card Pins MMC System Interaction Command and Response Channel Clock for synchronous transfer Host (BCM 2835) CLK SD Card CPU Core EMMC Controller CMD DAT SD Card Interface Controller Memory Bidirectional Data Channels 154

Power On Detection SD Card DAT2 DAT3 CMD OCR[31:0] CID[127:0] RCA[15:0] DSR[15:0] CSD[127:0] SCR[63:0] SSR[511:0] CSR[31:0] V DD CLK Card Interface Controller reset DAT0 DAT1 Memory Core Interface reset Memory Core SD Physical Layer Spec. P. 12 155

SD Mode vs SPI Mode Dat2 Dat3 VDD CMD CLK GND Dat0 Dat1 CS DI VDD CLK GND DO (Micro) SPI-MODE SD Card Header 156

Block Read/ Write Operation Read from host to card from card to host data from card to host stop command stops data transfer CMD command response command response DAT[0-7] data block crc data block crc data block crc block read operation multiple block read data stop operation Write from host to card from card to host data from host to card busy from card to host stop command stops data transfer CMD command response command response DAT[0-7] data block crc busy data block crc busy block write operation data stop operation multiple block write SD Physical Layer Spec. P. 6ff 157

RS232 Terminal [DTE] Data Set [DCE] (Modem) UART TxD RxD GND UART + RTS/RTR CTS if Hardware Flow Control 158

RS232 Signalling Sampling in the middle of bit intervals Time [+3v, +15 v] 0 v [-3v,-15 v] (idle) LSB MSB (idle) start bit starts the local clock 8 data bits (+parity, if applicable) 1-2 stop bit(s) 159

UART Universal Asynchronous Receiver/ Transmitter Serial transmission of individual bits in byte packets (lowest significant bit first) Configurable source: Wikipedia Number of data bits per byte: 5, 6, 7, 8 Parity: odd, even, none Number of stop bits: 1, 1.5, 2 Transfer rate in bps (bits per second): 75, 110, 300,..., 115200 160

Implementation Send in out 2. 1. IRQ Port Sender FIFO Sender Line Application Receive in out Sender buffer Receiver buffer UART Driver IRQ 1. 2. Receiver FIFO Port Trigger level reached UART Receiver Line Hardware 161