SlideShare a Scribd company logo
1 of 32
Download to read offline
Maths is not everything

Embedded Systems
4 - Hardware Architecture

CPU
Input/Output mechanisms
Memory
Buses and Aux I/O
Input/Output interfaces
RMR©2012

Power Management
Maths is not everything

UART

RMR©2012
Asynchronous Transmission
Máquina B

Máquina A

Tx A
Rx A

Bit Time

Rx B
Tx B

65H

Least Significant Bit
Start Bit

Maths is not everything

RMR©2012

3

‘e’

Stop Bits
Most Significant Bit
DB9 pinout of a DTE

DTE vs DCE
Pinout of a DCE?
Common ground?
Noise effects?

Maths is not everything

RMR©2012
RS-232 transmission example

Maths is not everything

RMR©2012

How do peers agree on timing?
Maths is not everything

SPI

RMR©2012
Serial Peripheral Interface

What is it?
Basic SPI
Capabilities
Protocol
Maths is not everything

RMR©2012

Pros and Cons
Uses

Serial Peripheral Interface
What is SPI?

Serial bus protocol
Fast, easy to use, and simple
Very widely used
Not “standardized”

Maths is not everything

RMR©2012
SPI Basics

A 4-wire communications bus
Typically communicate across short
distances
Supports
Single master
Multiple slaves

Synchronized
Maths is not everything

RMR©2012

Communications are “clocked”
SPI Capabilities

Always full-duplex
Communicates in both directions simultaneously
Transmitted (or received) data may not be meaningful

Multiple Mbit/s transmission speeds
0-50 MHz clock speeds not uncommon

Transfer data in 4 to 16 bit characters
Maths is not everything

RMR©2012

Supports multiple slaves
SPI bus wiring

Bus wires
Master-Out, Slave-In (MOSI)
Master-In, Slave-Out (MISO)
System Clock (SCLK)
Slave Select/Chip Select (SS1#, …, SS#n or CS1, …,
CSn)

Master asserts slave/chip select line
Maths is not everything

RMR©2012

Master generates clock signal
Shift registers shift data in and out
SPI signal functions

MOSI – carries data out of master to slave
MISO – carries data out of slave to master
Both MOSI and MISO are active during every
transmission

Maths is not everything

RMR©2012

SS# (or CS) – unique line to select each
slave chip
SCLK – produced by master to synchronize
transfers
SPI uses a “shift register” model of communications

Master shifts out data to Slave, and shifts in data from Slave

Maths is not everything

RMR©2012
Two bus configuration models

Maths is not everything

RMR©2012

Master and multiple independent
slaves

Master and multiple daisy-chained
slaves
SPI clocking: there is no “standard way”
Four clocking “modes”
Two phases
Two polarities

Master and selected slave must be in the same mode
During transfers with slaves A and B, Master must
Configure clock to Slave A’s clock mode
Select Slave A
Do transfer
Deselect Slave A
Configure clock to Slave B’s clock mode
Maths is not everything

Select Slave B
Do transfer

RMR©2012

Deselect Slave B

Master reconfigures clock mode on-the-fly!
SPI timing diagram

Maths is not everything

RMR©2012

Timing Diagram – Showing Clock polarities and phases
SPI example: decode what’s happening

Maths is not everything

RMR©2012
SPI tradeoffs: the pros and cons

Pros
Fast for point-to-point connections
Easily allows streaming/constant data inflow
No addressing in protocol, so it’s simple to implement
Broadly supported

Cons
Slave select/chip select makes multiple slaves more complex
No acknowledgement (can’t tell if clocking in garbage)
No inherent arbitration
Maths is not everything

RMR©2012

18

No flow control (must know slave speed)
Maths is not everything

I2C

RMR©2012
I2C bus

Inter-Integrated Circuit
Two wire serial bus specification
Designed for low-cost, medium data rate
applications.
Several microcontrollers come with built-in
I2C controllers.
Invented by Philips in the early 1980s
Maths is not everything

RMR©2012

20

The division is now NXP
Was a patented protocol, but patent has now expired
I2C bus architecture
I2C
Standardizes
peripheral classes
SCK, SDA
Philips/NXP

Maths is not everything

RMR©2012
I2C details

Two-wire serial protocol with addressing
capability
Speeds up to 3.4 Mbps
What limits I2C to such small speeds?
Multi-master architecture
Open collector bus driver
Pull-up resistors
Maths is not everything

RMR©2012

22

Multi-master, Multi-slave
Uses bus arbitration
I2C physical layer
Two lines

Open collector design

SDA (serial data)

Simple interfacing for multi-voltage

SCL (serial clock)

Supports bus arbitration

master 1

master 2

data line

SDA

clock line

SCL
slave 1

+

SDL
+
Maths is not everything

SCL
RMR©2012

23

slave 2
I2C signaling

Sender pulls down bus for 0.
Sender listens to bus---if it tried to send
a 1 and heard a 0, someone else is
simultaneously transmitting.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

Transmissions occur in 8-bit bytes.
I2C clock

Not a “traditional” clock
Normally is kept “high” using a pull-up
Pulsed by the master during data
transmission
Master could be either the transmitter or receiver

Slave device can hold clock low if needs
more time
Allows for flow control
Maths is not everything

RMR©2012

25
I2C transaction

Transmitter/receiver differs from
master/slave
Master initiates transactions
Slave responds

Transmitter sets data on SDL line, slave
acks
Maths is not everything

RMR©2012

26

For a read, slave is transmitter
For a write, master is transmitter
I2C bus transactions: start and stop conditions
Master pulls SDA low while SCL is high
Normal SDA changes only happen when SCL is
low

Master pulls SDA high while SCL is high
Maths is not everything

Also used to abort transactions

RMR©2012

34
I2C address transmission

Data is always sampled on the rising clock
edge
Address is 7 bits
An 8-th bit indicated read or write
High for read
Low for write

Addresses assigned by Philips/NXP
Maths is not everything

For a fee
Was covered by patent

RMR©2012

28
I2C data transmission
Transmitted just like address (8 bits)
For a write, master transmits, slave acknowledges
For a read, slave transmits, master acknowledges
Transmission continues
Subsequent bytes sent
Continue until master creates stop condition

Maths is not everything

RMR©2012

29
I2C bus arbitration

Sender listens while sending address.

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

When sender hears a conflict, if its
address is higher, it stops signaling.
Low-priority senders relinquish control
early enough in clock cycle to allow bit to
be transmitted reliably.
I2C transmissions

multi-byte write
S

adrs

0

data

data

1

data

P

0

data

S

P

read from slave
S

adrs

write, then read

Maths is not everything

RMR©2012

© 2008 Wayne Wolf

S

adrs

adrs

1

data

P
I2C bus transactions: data transfer

Maths is not everything

RMR©2012

More Related Content

What's hot

MPLS WC 2014 Segment Routing TI-LFA Fast ReRoute
MPLS WC 2014  Segment Routing TI-LFA Fast ReRouteMPLS WC 2014  Segment Routing TI-LFA Fast ReRoute
MPLS WC 2014 Segment Routing TI-LFA Fast ReRouteBruno Decraene
 
Multifunction Gateways - QEI LLC
Multifunction Gateways - QEI LLCMultifunction Gateways - QEI LLC
Multifunction Gateways - QEI LLCLeePearce18
 
SDN Traffic Engineering, A Natural Evolution
SDN Traffic Engineering, A Natural EvolutionSDN Traffic Engineering, A Natural Evolution
SDN Traffic Engineering, A Natural EvolutionAPNIC
 
Harland simon baby overview
Harland simon baby overviewHarland simon baby overview
Harland simon baby overviewDeclan Begley
 
IEC 61131-3 PLC Programming Languages: Beyond Ladder Logic
IEC 61131-3 PLC Programming Languages:  Beyond Ladder LogicIEC 61131-3 PLC Programming Languages:  Beyond Ladder Logic
IEC 61131-3 PLC Programming Languages: Beyond Ladder LogicDrives & Systems
 
Fpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loopFpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loopIAEME Publication
 

What's hot (12)

Uc 2(vii)
Uc 2(vii)Uc 2(vii)
Uc 2(vii)
 
MPLS WC 2014 Segment Routing TI-LFA Fast ReRoute
MPLS WC 2014  Segment Routing TI-LFA Fast ReRouteMPLS WC 2014  Segment Routing TI-LFA Fast ReRoute
MPLS WC 2014 Segment Routing TI-LFA Fast ReRoute
 
QEI LLC
QEI LLCQEI LLC
QEI LLC
 
Multifunction Gateways - QEI LLC
Multifunction Gateways - QEI LLCMultifunction Gateways - QEI LLC
Multifunction Gateways - QEI LLC
 
A2 d laser
A2 d laserA2 d laser
A2 d laser
 
Signal Processing in FPGA's
Signal Processing in FPGA'sSignal Processing in FPGA's
Signal Processing in FPGA's
 
SDN Traffic Engineering, A Natural Evolution
SDN Traffic Engineering, A Natural EvolutionSDN Traffic Engineering, A Natural Evolution
SDN Traffic Engineering, A Natural Evolution
 
INDEXING OR POSITIONING
INDEXING OR POSITIONINGINDEXING OR POSITIONING
INDEXING OR POSITIONING
 
Electronicdevices2
Electronicdevices2Electronicdevices2
Electronicdevices2
 
Harland simon baby overview
Harland simon baby overviewHarland simon baby overview
Harland simon baby overview
 
IEC 61131-3 PLC Programming Languages: Beyond Ladder Logic
IEC 61131-3 PLC Programming Languages:  Beyond Ladder LogicIEC 61131-3 PLC Programming Languages:  Beyond Ladder Logic
IEC 61131-3 PLC Programming Languages: Beyond Ladder Logic
 
Fpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loopFpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loop
 

Similar to S emb t8-arch_itfio

Part-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentPart-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentFastBit Embedded Brain Academy
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolAnkur Soni
 
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
PROGRAMMABLE PERIPHERAL INTERFCAE.pptPROGRAMMABLE PERIPHERAL INTERFCAE.ppt
PROGRAMMABLE PERIPHERAL INTERFCAE.pptkarthik R
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemsRaghunath reddy
 
20ME702– MECHATRONICS -UNIT-3.ppt
20ME702– MECHATRONICS -UNIT-3.ppt20ME702– MECHATRONICS -UNIT-3.ppt
20ME702– MECHATRONICS -UNIT-3.pptMohanumar S
 
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS Mohanumar S
 
This Document gives a complete understanding of the I3C protocol which is int...
This Document gives a complete understanding of the I3C protocol which is int...This Document gives a complete understanding of the I3C protocol which is int...
This Document gives a complete understanding of the I3C protocol which is int...rohitvasanad
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfVikasMahor3
 
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE ravis205084
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsMohamed Abdallah
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerAmandeep Alag
 
An Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLAn Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLIJMER
 
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptCHANDRA KUMAR S
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral InterfaceAnurag Tomar
 
Varsha patil AISSMS IOIT Pune mca te pu book
Varsha patil AISSMS IOIT Pune mca te pu bookVarsha patil AISSMS IOIT Pune mca te pu book
Varsha patil AISSMS IOIT Pune mca te pu bookVarsha Patil
 
ADDA_Lecture_P1.ppt
ADDA_Lecture_P1.pptADDA_Lecture_P1.ppt
ADDA_Lecture_P1.pptssuserf2cc17
 

Similar to S emb t8-arch_itfio (20)

Part-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentPart-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver development
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
PROGRAMMABLE PERIPHERAL INTERFCAE.pptPROGRAMMABLE PERIPHERAL INTERFCAE.ppt
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
 
20ME702– MECHATRONICS -UNIT-3.ppt
20ME702– MECHATRONICS -UNIT-3.ppt20ME702– MECHATRONICS -UNIT-3.ppt
20ME702– MECHATRONICS -UNIT-3.ppt
 
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
 
S emb t5-arch_io
S emb t5-arch_ioS emb t5-arch_io
S emb t5-arch_io
 
S emb t4-arch_cpu
S emb t4-arch_cpuS emb t4-arch_cpu
S emb t4-arch_cpu
 
This Document gives a complete understanding of the I3C protocol which is int...
This Document gives a complete understanding of the I3C protocol which is int...This Document gives a complete understanding of the I3C protocol which is int...
This Document gives a complete understanding of the I3C protocol which is int...
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdf
 
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication Protocols
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontroller
 
An Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLAn Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDL
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
Varsha patil AISSMS IOIT Pune mca te pu book
Varsha patil AISSMS IOIT Pune mca te pu bookVarsha patil AISSMS IOIT Pune mca te pu book
Varsha patil AISSMS IOIT Pune mca te pu book
 
ADDA_Lecture_P1.ppt
ADDA_Lecture_P1.pptADDA_Lecture_P1.ppt
ADDA_Lecture_P1.ppt
 

More from João Moreira

More from João Moreira (11)

Bolt mld1717 11100975
Bolt mld1717 11100975Bolt mld1717 11100975
Bolt mld1717 11100975
 
S emb t12-os
S emb t12-osS emb t12-os
S emb t12-os
 
S emb t11-processes
S emb t11-processesS emb t11-processes
S emb t11-processes
 
S emb t10-development
S emb t10-developmentS emb t10-development
S emb t10-development
 
S emb t9-arch_power (1)
S emb t9-arch_power (1)S emb t9-arch_power (1)
S emb t9-arch_power (1)
 
S emb t9-arch_power
S emb t9-arch_powerS emb t9-arch_power
S emb t9-arch_power
 
S emb t7-arch_bus
S emb t7-arch_busS emb t7-arch_bus
S emb t7-arch_bus
 
S emb t6-arch_mem
S emb t6-arch_memS emb t6-arch_mem
S emb t6-arch_mem
 
S emb t2-definition
S emb t2-definitionS emb t2-definition
S emb t2-definition
 
S emb t1-introduction
S emb t1-introductionS emb t1-introduction
S emb t1-introduction
 
S emb t13-freertos
S emb t13-freertosS emb t13-freertos
S emb t13-freertos
 

Recently uploaded

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

S emb t8-arch_itfio

  • 1. Maths is not everything Embedded Systems 4 - Hardware Architecture CPU Input/Output mechanisms Memory Buses and Aux I/O Input/Output interfaces RMR©2012 Power Management
  • 2. Maths is not everything UART RMR©2012
  • 3. Asynchronous Transmission Máquina B Máquina A Tx A Rx A Bit Time Rx B Tx B 65H Least Significant Bit Start Bit Maths is not everything RMR©2012 3 ‘e’ Stop Bits Most Significant Bit
  • 4. DB9 pinout of a DTE DTE vs DCE Pinout of a DCE? Common ground? Noise effects? Maths is not everything RMR©2012
  • 5. RS-232 transmission example Maths is not everything RMR©2012 How do peers agree on timing?
  • 6. Maths is not everything SPI RMR©2012
  • 7. Serial Peripheral Interface What is it? Basic SPI Capabilities Protocol Maths is not everything RMR©2012 Pros and Cons Uses Serial Peripheral Interface
  • 8. What is SPI? Serial bus protocol Fast, easy to use, and simple Very widely used Not “standardized” Maths is not everything RMR©2012
  • 9. SPI Basics A 4-wire communications bus Typically communicate across short distances Supports Single master Multiple slaves Synchronized Maths is not everything RMR©2012 Communications are “clocked”
  • 10. SPI Capabilities Always full-duplex Communicates in both directions simultaneously Transmitted (or received) data may not be meaningful Multiple Mbit/s transmission speeds 0-50 MHz clock speeds not uncommon Transfer data in 4 to 16 bit characters Maths is not everything RMR©2012 Supports multiple slaves
  • 11. SPI bus wiring Bus wires Master-Out, Slave-In (MOSI) Master-In, Slave-Out (MISO) System Clock (SCLK) Slave Select/Chip Select (SS1#, …, SS#n or CS1, …, CSn) Master asserts slave/chip select line Maths is not everything RMR©2012 Master generates clock signal Shift registers shift data in and out
  • 12. SPI signal functions MOSI – carries data out of master to slave MISO – carries data out of slave to master Both MOSI and MISO are active during every transmission Maths is not everything RMR©2012 SS# (or CS) – unique line to select each slave chip SCLK – produced by master to synchronize transfers
  • 13. SPI uses a “shift register” model of communications Master shifts out data to Slave, and shifts in data from Slave Maths is not everything RMR©2012
  • 14. Two bus configuration models Maths is not everything RMR©2012 Master and multiple independent slaves Master and multiple daisy-chained slaves
  • 15. SPI clocking: there is no “standard way” Four clocking “modes” Two phases Two polarities Master and selected slave must be in the same mode During transfers with slaves A and B, Master must Configure clock to Slave A’s clock mode Select Slave A Do transfer Deselect Slave A Configure clock to Slave B’s clock mode Maths is not everything Select Slave B Do transfer RMR©2012 Deselect Slave B Master reconfigures clock mode on-the-fly!
  • 16. SPI timing diagram Maths is not everything RMR©2012 Timing Diagram – Showing Clock polarities and phases
  • 17. SPI example: decode what’s happening Maths is not everything RMR©2012
  • 18. SPI tradeoffs: the pros and cons Pros Fast for point-to-point connections Easily allows streaming/constant data inflow No addressing in protocol, so it’s simple to implement Broadly supported Cons Slave select/chip select makes multiple slaves more complex No acknowledgement (can’t tell if clocking in garbage) No inherent arbitration Maths is not everything RMR©2012 18 No flow control (must know slave speed)
  • 19. Maths is not everything I2C RMR©2012
  • 20. I2C bus Inter-Integrated Circuit Two wire serial bus specification Designed for low-cost, medium data rate applications. Several microcontrollers come with built-in I2C controllers. Invented by Philips in the early 1980s Maths is not everything RMR©2012 20 The division is now NXP Was a patented protocol, but patent has now expired
  • 21. I2C bus architecture I2C Standardizes peripheral classes SCK, SDA Philips/NXP Maths is not everything RMR©2012
  • 22. I2C details Two-wire serial protocol with addressing capability Speeds up to 3.4 Mbps What limits I2C to such small speeds? Multi-master architecture Open collector bus driver Pull-up resistors Maths is not everything RMR©2012 22 Multi-master, Multi-slave Uses bus arbitration
  • 23. I2C physical layer Two lines Open collector design SDA (serial data) Simple interfacing for multi-voltage SCL (serial clock) Supports bus arbitration master 1 master 2 data line SDA clock line SCL slave 1 + SDL + Maths is not everything SCL RMR©2012 23 slave 2
  • 24. I2C signaling Sender pulls down bus for 0. Sender listens to bus---if it tried to send a 1 and heard a 0, someone else is simultaneously transmitting. Maths is not everything RMR©2012 © 2008 Wayne Wolf Transmissions occur in 8-bit bytes.
  • 25. I2C clock Not a “traditional” clock Normally is kept “high” using a pull-up Pulsed by the master during data transmission Master could be either the transmitter or receiver Slave device can hold clock low if needs more time Allows for flow control Maths is not everything RMR©2012 25
  • 26. I2C transaction Transmitter/receiver differs from master/slave Master initiates transactions Slave responds Transmitter sets data on SDL line, slave acks Maths is not everything RMR©2012 26 For a read, slave is transmitter For a write, master is transmitter
  • 27. I2C bus transactions: start and stop conditions Master pulls SDA low while SCL is high Normal SDA changes only happen when SCL is low Master pulls SDA high while SCL is high Maths is not everything Also used to abort transactions RMR©2012 34
  • 28. I2C address transmission Data is always sampled on the rising clock edge Address is 7 bits An 8-th bit indicated read or write High for read Low for write Addresses assigned by Philips/NXP Maths is not everything For a fee Was covered by patent RMR©2012 28
  • 29. I2C data transmission Transmitted just like address (8 bits) For a write, master transmits, slave acknowledges For a read, slave transmits, master acknowledges Transmission continues Subsequent bytes sent Continue until master creates stop condition Maths is not everything RMR©2012 29
  • 30. I2C bus arbitration Sender listens while sending address. Maths is not everything RMR©2012 © 2008 Wayne Wolf When sender hears a conflict, if its address is higher, it stops signaling. Low-priority senders relinquish control early enough in clock cycle to allow bit to be transmitted reliably.
  • 31. I2C transmissions multi-byte write S adrs 0 data data 1 data P 0 data S P read from slave S adrs write, then read Maths is not everything RMR©2012 © 2008 Wayne Wolf S adrs adrs 1 data P
  • 32. I2C bus transactions: data transfer Maths is not everything RMR©2012