DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK–

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

ECT 357 Ch 18 UART. Today’s Quote: Be careful that your marriage doesn’t become a duel instead of a duet. Be careful that your marriage doesn’t become.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Input/Output Organization Asynchronous Bus
The 8085 Microprocessor Architecture
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Serial I/O - Programmable Communication Interface
Serial Interfaces, Part Deux -I 2 C and SPI December 4, 2002 Presented by Eugene Ho.
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
Serial Peripheral Interface (SPI)
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Unit-5 CO-MPI autonomous
Chapter 10 Input/Output Interface Circuits and LSI Peripheral Devices
INPUT-OUTPUT ORGANIZATION
Interfaces A practical approach. Lesson 2 I2C and SPI
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
Computer Architecture Lecture 08 Fasih ur Rehman.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
4.0 rtos implementation part II
The 8051 Microcontroller and Embedded Systems
Input/Output mechanisms
7/23 Inter-chip Serial Communication: SPI and I 2 C Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
The 8253 Programmable Interval Timer
MICROPROCESSOR INPUT/OUTPUT
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
Universal Asynchronous Receiver/Transmitter (UART)
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
(More) Interfacing concepts. Introduction Overview of I/O operations Programmed I/O – Standard I/O – Memory Mapped I/O Device synchronization Readings:
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.
MODES OF Details of Pins Pin 1GND –Connected Ground Pins 2-16 AD14-AD0–acts as both input/output. Outputs address at the first part of the cycle.
Universal Asynchronous Receiver/Transmitter (UART)
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
Essentials of Communication This simple model requires many guarantees. Sender Receiver Communication Link Data.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Unit 1 Lecture 4.
Serial Peripheral Interface SPI I2C (i-squared cee)
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
The World Leader in High Performance Signal Processing Solutions SD/SDIO Introduction Cliff Cai.
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 9 Serial Buses – SPI, I2C.
BIRLA VISHVAKARMA MAHAVIDYALAY SUBJECT: SPI PROTOCOL & MAX7221 DISPLAY INTERFACING SUBMITTED BY: KISHAN AVASTHI( ) MANSI CHANDEGARA( )
Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.
8251 USART.
Serial mode of data transfer
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Chapter 11: Inter-Integrated Circuit (I2C) Interface
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
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
Pulse Width Modulation (PWM)
Computer Organization and Design
Interfacing Memory Interfacing.
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Presentation transcript:

DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK– SPI, SCI, SI and SDIO Port/devices for Serial Data Communication

Microcontroller internal devices for SPI or SCI or SI Synchronous Peripheral Interface (SPI) Port, for example, in 68HC11 and 68HC12 microcontrollers Asynchronous UART Serial Connect Interface (SCI), for example, SCI port in 68HC11/12 Asynchronous UART mode Serial Interface (SI), for example, SI in 8051

SPI: Synchronous Serial Peripheral Interface

SPI: Synchronous Peripheral Interface Full-duplex Synchronous communication. The SPI is a synchronous serial interface in which data in an 8-bit (1 byte) can be shifted in and/or out one bit at a time. It can be used to communicate with a serial peripheral device or with another microcontroller (68HC12) with an SPI interface. The Serial Peripheral Interface (SPI) circuit is a synchronous serial data link that provides communication with external devices in Master or Slave Mode.

SPI Cont.… The Serial Peripheral Interface is essentially a shift register that serially transmits data bits to other SPIs. During a data transfer, one SPI system acts as the "master" which controls the data flow, while the other devices act as "slaves" which have data shifted into and out by the master. SCLK, MOSI and MISO signals for serial clock from master, output from master and input to master, respectively. Device selection as master or slave can be done by a signal to hardware input SS. (Slave select when 0) pin

Operation of SPI protocol A slave device is selected when the master asserts its NSS/SS signal. If multiple slave devices exist, the master generates a separate slave select signal for each slave. The SPI system consists of two data lines and two control lines: Master Out Slave In (MOSI): This data line supplies the output data from the master shifted into the input(s) of the slave(s). Master In Slave Out (MISO): This data line supplies the output data from a slave to the input of the master. There may be no more than one slave transmitting data during any particular transfer. Serial Clock (SPCK/SCLK): This control line is driven by the master and regulates the flow of the data bits. The master may transmit data at a variety of baud rates; the SPCK/SCLK line cycles once for each bit that is transmitted. Slave Select (NSS/SS): This control line allows slaves to be turned on and off by hardware.

Operation of SPI protocol Figure 1: Master/slave serial peripheral interface.

Operation of SPI protocol Shift Register: loaded by SPI data and by data from SSPBUF Figure 1: Master/slave serial peripheral interface.

Operation of SPI protocol Serial Buffer: Data is put here at the end of an SPI transfer, and data placed here for sending is loaded into the SSPSR for the next transfer. Figure 1: Master/slave serial peripheral interface.

Operation of SPI protocol Control/ SPI CLOCK: SCK transmits the SPI clock from the Master to the Slave. SS controls if the slave is connected or idle. Figure 1: Master/slave serial peripheral interface.

Operation of SPI protocol In the master SPI, the bits are sent out of the MOSI pin and received in the MISO pin. The bits to be shifted out are stored in the SPI data register, SP0DR, and are sent out most significant bit (bit 7) first. When bit 7 of the master is shifted out through MOSI pin, a bit from bit 7 of the slave is being shifted into bit 0 of the master via the MISO pin. After 8 clock pulses or shifts, this bit will eventually end up in bit 7 of the master.

Operation of SPI protocol In the 68HC12 the least significant bit can be sent out first by setting the LSBF bit to 1 in the SPI Control Register. The clock, which controls how fast the bits are shifted out and into SP0DR, is the signal SCLK at PS6. The frequency of this clock can be controlled by the SPI baud rate register, SP0BR. The SS pin must be low to select a slave. This signal can come from any pin on the master, including its SS pin when it is configured as an output.

The SPI Registers An SPI transmission is always initiated by the master, and the peripheral device is called the slave. The master initiates a transfer by storing a byte in the SPI data register (SP0DR for 68HC12, SPDR for 68HC11). SP0CR1 : SPI Control Register 1 SP0CR2 : SPI Control Register 2 SP0BR : SPI Baud Rate Register SP0SR : SPI Status Register SP0DR : SPI Data Register

SPI Registers Addresses

Table 2: 68HC12 SPI Clock Rate Selection

Data and control lines of the SPI and the basic connection:

SPI Protocol Signals An SPI protocol specifies 4 signal wires. Master Out Slave In (MOSI) - MOSI signal is generated by Master, recipient is the Slave. Master In Slave Out (MISO) - Slaves generate MISO signals and recipient is the Master. Serial Clock (SCLK or SCK) - SCLK signal is generated by the Master to synchronize data transfers     between the master and the slave. Slave Select (SS) from master to Chip Select (CS) of slave - SS signal is generated by Master to     select individual slave/peripheral devices. The SS/CS is an active low signal.

SPI SLAVE INTERNAL STRUCTURE

A full duplex data transmission can occur during each clock cycle.

Different types of configurations: Suppose a master-microcontroller needs to talk to multiple SP Peripherals. There are 2 ways to set things up: Cascaded slaves or daisy-chained slaves Independent slaves or parallel configuration

Cascaded slaves or daisy-chained slaves

Independent slaves or parallel configuration

Examples 68HC11/12 uses synchronous serial communication (SPI Protocol) 68HC12 provides SPI communication device operation at 4Mbps. 68HC11 provides SPI communication device operation at 2Mbps.

Advantages of SPI Full duplex communication Higher throughput than I²C protocol  Not limited to 8-bit words in the case of bit-transferring  Arbitrary choice of message size, contents, and purpose  Simple hardware interfacing  Typically lower power requirements than I²C due to less circuitry. No arbitration or associated failure modes.  Slaves use the master's clock, and don't need precision oscillators.  Transceivers are not needed.  At most one "unique" bus signal per device (CS); all others are shared

Disadvantages of SPI Requires more pins on IC packages than I²C. No in-band addressing. Out-of-band chip select signals are required on shared busses. No hardware flow control Multi-master busses are rare and awkward, and are usually limited to a single slave.  Only handles short distances compared to RS-232 & CAN.

SCI: Serial Connect Interface Port

SCI: Serial Connect Interface Port UART asynchronous mode port Full-duplex mode SCI programmable for transmission and for reception This interface uses three dedicated pins: transmit data (TXD), receive data (RXD), and SCI serial clock (SCLK). It supports industry-standard asynchronous bit rates and protocols as well as high-speed (up to 5 Mbps for a 40-MHz clock) synchronous data transmission. The SCI consists of separate transmit and receive sections whose operations can be asynchronous with respect to each other.

SCI Features Three-Pin Interface: TXD – Transmit Data RXD – Receive Data SCLK – Serial Clock(Optional for Synchronous Communication) 781.25 Kbps NRZ Asynchronous Communications Interface (50-MHz System Clock) 6.25 Mbps Synchronous Serial Mode (50-MHz System Clock) Multidrop Mode for Multiprocessor Systems: Two Wakeup Modes: Idle Line and Address Bit Wired-OR Mode On-Chip or External Baud Rate Generation/Interrupt Timer Four Interrupt Priority Levels Fast or Long Interrupts

SCI Full duplex signals

SCI Bit format The SCI configuration allows for a number of options for data transmission and reception. In the simplest configuration, ten bits are involved : a start bit (logical 0), the 8 data bits, and a stop bit (logical 1). An example transmission waveform, such as what you might see if you hooked up a logic analyzer to the TX pin, is shown above. Note that the data bits are sent lsb (bit 0) first, and msb (bit 7) last. Thus, the middle 8 bits in the pulse train below are sent in the order "10110100" in a time domain signal, corresponding to an actual data byte of 0x2D (%0010 1101), which is an ASCII minus " - " sign.

SCI Bit format cont.…. The data rate out of/into the SCI is determined by the baud rate, and is an essential value to consider in any SCI setup. For our Dragon 12 running with a PLL controlled clock at 24 MHz, the baud rate is determined by the following formula: where BR is the content of the SCI1BDH/L Baud Rate Registers at addresses $00D0 and $00D1. For example, for a baud rate of 9600 (baud period ~ 100 usec) , we want a BR of about 156 = 9CH, so we write 00H to SCI1BDH and 9CH to SCI1BDL. Note that the baud rate is the same for transmission and reception for a given SCI port; we can't set one baud rate for transmission, and another for reception on a given port. SCI BAUD rate = 24,000,000/(16 x BR)

Serial Transmission Rules The basic mechanics of serial transmission are simple: We load a data register with 8 bits of data; Once the data register is full, the data is transferred to a shift register automatically by the hardware; The data in the shift register are padded with a start/stop bit, and then shifted out on the TX pin a bit at a time at the set baud rate. For serial reception, the basic mechanics are reversed: We wait for the shift register connected to the RX pin to fill with serial data; Once the RX shift register is filled, the data is immediately transferred to the data register (the transfer is automatically done by the hardware); We then read the data register to see what data was received.

68HC11 SCI signals at Port PD

SI: Serial Interface Port

Serial Interface (SI) Port UART 10T or 11T mode asynchronous port interface. Functions as USRT (universal synchronous receiver and transmitter) also. SI is therefore synchronous-asynchronous serial communication port called USART (universal synchronous-asynchronous receiver and transmitter) port. SI is an internal serial IO device in 8051.

SI Half-duplex signals Mode 0

SI Full duplex signals Mode 1, 2 or 3

SI Control bits programming Mode 0− Half- duplex synchronous mode of operation, called. When a 12 MHz crystal is at 8051, and is attached to the processor, the clock bits are at the intervals of 1 μs. Mode 1 or 2 or 3− Full- duplex asynchronous serial communication.

SDIO: Secure Digital Input Output

Secure Digital Association (SD) SD− an association of over 700 companies started from 3 companies in 1999 Created a new flash memory card format, called SD format for IOs. SDIO card has become popular feature in handheld mobile devices, PDAs, digital cameras and embedded systems. SD card size− just 0.14 cm × 2.4 cm × 3.2 cm. Allowed to stick out of the handheld device open slot, which can be at the top in order to facilitate insertion of the SD card

SDIO card host controller A processing element functions used SDIO host controller to process the IOs. Controller may include SPI controller to support SPI mode for the IOs and also supports the needed protocol functionality internally

SD Memory Card System Concept 1. Read-Write Property • Read/Write (RW) cards • Read Only Memory (ROM) cards. 2. Supply Voltage • High Voltage SD Memory Cards: 2.7-3.6 V. • Dual Voltage SD Memory Cards –Dual Voltage SD Memory Cards that can operate within the voltage range of Low Voltage Range (T.B.D) and 2.7-3.6 V. 3. Card Capacity • Standard Capacity SD Memory Cards: up to and including 2 G bytes • High Capacity SD Memory Cards: up to and including 32 GB(specification 2.00). • 2 types of High Capacity SD Memory Card are specified. Type A (Single State Card) has single High Capacity memory area Type B (Dual State Card) has both High Capacity memory area and Standard Capacity memory area. In Type B card, only one memory area can be used at any given time.

4. Speed Class 5. Bus Topology Four Speed Classes are defined and indicate minimum performance of the cards • Class 0 - These class cards do not specify performance. It includes all the legacy cards prior to specification 2.00, regardless of its performance • Class 2 - Are more than or equal to 2 MB/sec performance. • Class 4 - Are more than or equal to 4 MB/sec performance. • Class 6 - Are more than or equal to 6 MB/sec performance. 5. Bus Topology The SD bus includes the following 9 signals: CLK : Host to card clock signal CMD : Bidirectional Command/Response signal DAT 0 - DAT 3 : 4 Bidirectional data signals. VDD , VSS1 , VSS2 : Power and ground signals.

6. Bus Protocol Communication over the SD bus is based on command and data bit streams that are initiated by a start bit and terminated by a stop bit. • Command: a command is a token that starts an operation. A command is sent from the host either to a single card (addressed command) or to all connected cards (broadcast command). A command is transferred serially on the CMD line. • Response: a response is a token that is sent from an addressed card, or (synchronously) from all connected cards, to the host as an answer to a previously received command. A response is transferred serially on the CMD line. • Data: data can be transferred from the card to the host or vice versa. Data is transferred via the data lines.

SDIO Signals Description

Figure-3: Command Token Format Figure-4: Response Token Format

Figure-5: “no response” and “no data” Operations Figure-6: (Multiple) Block Read Operation

Figure-7: (Multiple) Block Write Operation

Figure-8: Data Packet Format - Usual Data Data packet format for the SD card: Usual data (8-bit width): The usual data (8-bit width) are sent in LSB (Least Significant Byte) first, MSB (Most Significant Byte) last sequence. But in the individual byte, it is MSB (Most Significant Bit)first, LSB (Least Significant Bit) last. Figure-8: Data Packet Format - Usual Data

SDIO Hardware Design

DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK– Parallel port at devices

Parallel Port 8-bit IOs Short distances, generally within a circuit board or IC or nearby external devices

Parallel Port in the device Advantage− Number of 8 bits over the wires in parallel. High data transfer rate Disadvantage− More number of wires Capacitive effect in parallel wires reduces the length up to which communication in parallel can take place. High capacitance results in delay for the bits at the other end undergoing transition from 0 to 1 or 1 to 0. High capacitance can also result in noise and cross talk (induced signals) between the wires.

Parallel Port Interfacing IO device interfacing-circuit with the processor and system buses and connections to external peripherals/systems Parallel port inputs I0 to I7 may be from a keypad controller. Parallel port outputs O0 to O7 may be output bits to LCD display output controller. 𝐁𝐫 𝐢 and 𝐁𝐫 𝐨 buffers may be provided at bidirectional I/O port. 𝑩𝒓 𝒊 => Input Buffer Register 𝑩𝒓 𝒐 => Output Buffer Register

Parallel port interfacings for keypad, LCD display and modem

Parallel IO port handshaking and Interfacing

Handshaking signals to and from an external peripheral device for input at port Device makes a strobe request to port, STROBE after it is ready to send the byte and System I/O port sends the acknowledgement, PORT READY. System I/O port receives data in buffer and then issues an interrupt signal, INT to processor to enable an ISR execution

Handshaking signals to and from an external peripheral device for Output at port Device sends the message ACKNOWLEDGE when and the I/O device port ends the BUFFER FULL signal to inform that the is buffer full. The processor is sent the INTERRUPT REQUEST message, when the transmitting-buffer is empty (available for next write)

Port Interrupt to processor When receiving-buffer is full (available for next read) When transmitting-buffer is empty (available for next write)

Bidirectional Port Handshaking signals STROBE PORT READY BUFFER-FULL ACKNOWLEDGE INTERRUPT REQUEST

SELF STUDY TOPICS Parallel Port Interfacing with Switches and LEDS.(SELF STUDY TOPICS) Parallel Port Interfacing with Matrix Keyboard. (SELF STUDY TOPICS) Parallel Port Interfacing with Stepper Motor Parallel Port Interfacing with LCD Controller.