PARALLEL COMMUNICATIONS

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

Lecture 25 March 23, 2012 Introduction to Serial Communications

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

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

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

EE 308 Spring Using the 9S12 SPI

< W3150A+ / W5100 Application Note for SPI >

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

Introduction to I2C & SPI. Chapter 22

SPI (Serial & Peripheral Interface)

Lecture 14 Serial Peripheral Interface

SPI Universal Serial Communication Interface SPI Mode

Serial Peripheral Interface (SPI)

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

Real Time Embedded Systems. Lecture 1 January 17, 2012

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

Understanding SPI with Precision Data Converters

Serial Communication. Simplex Half-Duplex Duplex

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

Raspberry Pi - I/O Interfaces

Communication. Chirag Sangani

LAB4. Program the on chip SPI module

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

Dallas Semiconductor DS1307 Real Time Clock. The DS 1307 is a real-time clock with 56 bytes of NV (nonvolatile)

From Datasheets to Digital Logic. synthesizing an FPGA SPI slave from the gates

Review for Exam 3. Write 0x05 to ATD0CTL4 to set at fastest conversion speed and 10-bit conversions

ArduCAM-M-2MP Camera Shield

Interfacing Techniques in Embedded Systems

Serial Communications

Level Shifter. for. Hardware User s Manual.

Microcontrollers and Interfacing

Serial versus Parallel Data Transfers

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

Review for Exam III. Analog/Digital Converters. The MC9S12 has two 10-bit successive approximation A/D converters - can be used in 8-bit mode

DIGITAL COMMUNICATION SWAPNIL UPADHYAY

Synchronous = SPI (3 options)

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

Part 1 Using Serial EEPROMs

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Serial Communication. Simplex Half-Duplex Duplex

Lecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT

Serial Communications

Serial Communication Through an Asynchronous FIFO Buffer

SPI Xpress. Data sheet

DS1306. Serial Alarm Real Time Clock (RTC)

Figure 1: Byte 1 Byte 2 MISO <--- OVF EOM P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P

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

SPI: Serial Peripheral Interface

RTC Interface 89C51 DS M. Krishna Kumar MAM/M7/LU17/V1/ Vcc VCC 5 SDA P1.0 6 SCL P KHz 3 BAT 3.

Growing Together Globally Serial Communication Design In Embedded System

Design Development and Implementation of SPI

HC12 Built-In Hardware

The Serial Peripheral Interface

1.3inch OLED User Manual

AN10428 UART-SPI Gateway for Philips SPI slave bridges

DS1305 Serial Alarm Real Time Clock (RTC)

Application Note. Interfacing the CS5521/22/23/24/28 to the 68HC05. Figure 1. 3-Wire and 4-Wire Interfaces

Design with Microprocessors

DS1305. Serial Alarm Real Time Clock (RTC) FEATURES PIN ASSIGNMENT ORDERING INFORMATION

18-349: Introduction to Embedded Real-Time Systems

or between microcontrollers)

COOKING WITH TEAM 279

Keyboards. The PS/2 Protocol

ECE 471 Embedded Systems Lecture 20

Universität Dortmund. IO and Peripheral Interfaces

SPI Storm Studio. Getting Started Guide. Revision Sep Byte Paradigm

EE 308 Spring Lab on IIC Bus

App Note Application Note: Addressing Multiple FPAAs Using a SPI Interface

By: Haron Abdel-Raziq

Application Note. Interfacing the CS5525/6/9 to the 68HC05. By Keith Coffey MOSI (PD3) SDO MISO (PD2) SCLK. Figure 1. 3-Wire and 4-Wire Interfaces

PSIM Tutorial. How to Use SPI in F2833x Target. February Powersim Inc.

Getting Started with ESPI Interface Using the Z8 Encore! XP F1680

spi 1 Fri Oct 13 13:04:

SPI Storm. Data sheet

EECS 373 Design of Microprocessor-Based Systems

Stand Alone 512 channels DIN-DMX Interface

AN510 Using SPI protocol with pressure sensor modules

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

DS1305EN. Serial Alarm Real-Time Clock

Asynchronous & Synchronous Serial Communications Interface. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

Technical Documentation

Microcontroller interfaces

EECS 452 Lab 7: SPI, I2S on C5515 and DE2 70

Level Translator For SPI and I²C Bus Signals

Interfacing the HI7190 to a Microcontroller

LCD H C 1 2 GP2D PP4 MISO MOSI DIN DOUT SCK PP5 SCK D0 D1 D2 D3 D4 D5 D6 D7 DIN. Maximum SCK = 500 khz SCK D0 D1 D2 D3 D4 D5 D6 D7 DOUT

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

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

DS1305EN. Serial Alarm Real-Time Clock

EE 308: Microcontrollers

Real-Time Embedded Systems. CpE-450 Spring 06

SPI 3-Wire Master (VHDL)

UART TO SPI SPECIFICATION

BLE 1.4 SPI Driver Design Version 1.x (Draft)

Serial Peripheral Interface (SPI) Last updated 8/7/18

GPIO32 EXPANDER BOARD

Microcontroller basics

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

Introduction to the MC9S12 Hardware Subsystems

EECS 373 Design of Microprocessor-Based Systems

Transcription:

Parallel Data Transfer Suppose you need to transfer data from one HCS12 to another. How can you do this? You could connect PORTA of the sending computer (set up as an output port) to PORTA of the receiving computer (set up as an input port). The sending computer puts the data on its PORTA, one byte at a time. The receiving computer reads the data on its PORTA. For example, want to sent the five bytes corresponding to the five characters hello : PARALLEL COMMUNICATIONS Port A Port A 0x68 0x65 0x6c 0x6f h e l o Need 9 wires to transmit 8 bits of data How can receiver tell when it should read the data? 1

Parallel Data Transfer The sending computer needs to tell the receiving computer when to read the data. It can do this with another line used as a clock line. On the rising edge of the clock line, the receiving computer should read the data: PARALLEL COMMUNICATIONS Port A clk Port A clk 0x68 0x65 0x6c 0x6f h e l l o Need 10 wires to transmit 8 bits of data 2

Parallel Data Transfer How can the sending computer know that the receiving computer has received the data? Can use a method called handshaking. The sending computer uses a Data Valid line to tell the receiving computer that the data on the data lines is valid. The receiving computer uses a Data Received line to tell the sending computer that it has read the current data byte. PARALLEL COMMUNICATIONS Port A DV Port A DR NEW DATA DV DR Use two lines Handshake sender knows when receiver is ready for new data. Need 11 wires to transmit 8 bits of data In the above figure, the sending computer puts the data on the data lines and brings DV low to indicate new data is available. When the receiving computer sees the new data is available it reads the data on the data lines, then brings DR low to say that it has read the data. When the sending computer sees DR go low, it brings DV high. When the receiving computer sees DV go high, it brings DR high. Both computers are now ready for the next data transfer. 3

Serial Data Transfer Using parallel data transfer you can use 10 wires to transfer one byte at a time from one computer to another. Using 18 wires, you can transfer two bytes (16 bits) at a time. Parallel data transfer is a very fast way to transfer data between two computers. There are two problems with parallel data transfer: It takes a lot of wires between the computers. It uses lots of I/O pins on the computers. Serial data transfer is a slower transfer mechanism, but it uses fewer wires and fewer I/O pins. Serial data transfer sends one bit at a time between two computers: SERIAL COMMUNICATIONS serial out serial in 0 1 0 1 0 h = 0x68 = B"01101000" Can t tell how many ones or zeros there are 4

Synchronous Serial Data Transfer To use serial data transfer, you need to have a way for the receiving computer to know when the data bit is valid. There are two ways to do this: Synchronous Serial Data Transfers (SPI on the HCS12) Asynchronous Serial Data Transfers (SCI on the HCS12) Synchronous Seraial Data Transfer uses a clock line between the two computers for the sending computer to tell the receiving computer when each data bit is valid: SYNCHRONOUS SERIAL COMMUNICATIONS serial out clk serial in clk 0 1 1 0 1 0 0 0 h = 0x68 = B"01101000" Need 3 wires to transmit 1 bit at a time 5

Synchronous Serial Data Transfer In synchronous serial data transfer, the sending computer puts the data byte it wants to send into an internal shift register. The sending computer uses a clock to shift the 8 data bits out of the shift register onto an external data pin. The receiving computer puts the data from the sending computer on the input of an internal shift register. The receiving computer uses the clock from the sending computer to shift the data into its shift register. After 8 clock ticks, the data has been transfered from the sending computer to the recieving computer. SYNCHRONOUS SERIAL COMMUNICATIONS shift register shift register clk clk 0 1 1 0 1 0 0 0 h = 0x68 = B"01101000" Need 3 wires to transmit 1 bit at a time 6

The HCS12 Serial Peripheral Interface (SPI) The HCS12 has a Synchronous Serial Interface On the HCS12 it is called the Serial Peripheral Interface (SPI) If an HCS12 generates the clock used for the synchronous data transfer it is operating in Master Mode. If an HCS12 uses and external clockused for the synchronous data transfer it is operating in Slave Mode. If two HCS12 s talk to each other using their SPI s one must be set up as the Master and the other as the Slave. The output of the Master SPI shift register is connected to the input of the Slave SPI shift register over the Master Out Slave In (MOSI) line. The input of the Master SPI shift register is connected to the output of the Slave SPI shift register over the Master In Slave Out (MISO) line. After 8 clock ticks, the data originally in the Master shift register has been transfered to the slave, and the data in the Slave shift register has been transfered to the Master. 7

Synchronous Serial Communications Master Slave SP0DR MOSI SP0DR MISO Clk Clock SS V 11010110 MOSI V 10100101 T MISO T V Clock T 8

Use of Slave Select with the HCS12 SPI A master HCS12 can talk with more than one slave HCS12 s A slave HCS12 uses its Slave Select (SS) line to determine if it is the one the master is talking with There can only be one master HCS12, because the master HCS12 is the device which generates the serial clock signal. Synchronous Serial Communications Master Slave 1 Slave 2 MOSI MISO Clock SS SS With select lines, one master can communicate with more than one slave 9

Using the HCS12 SPI with other devices The HCS12 can communicate with many types of devices using its SPI For example, consider a D/A (Digital-to-Analog) Converter The D/A converter has three digital lines connected to the HCS12: Serial Data Serial Clock Chip Select The HCS12 can send a digital number to the D/A converter. The D/A converter will convert this digital number to a voltage. SPI Communication with a D/A Converter Master D/A Chip MOSI SDATA Clock SCLK Vout SS CS 10

Using the HCS12 SPI with other devices Another type of device the HCS12 can talk to is a Real Time Clock (RTC) An RTC keeps track of the time (year, month, day, hour, minute, second) An RTC can be programmed to generate an alarm (interrupt) at a particular time (07:00), or can generate a periodic interrupt at a regular interval (once a second, once an hour, etc.) The HCS12 initially tells the RTC what the correct time is. The RTC keeps track of time from then on. SPI Communication with a Real Time Clock Master MOSI MISO Clock RTC Chip Din Dout SCLK Batt INT SS Int CS 11

Using the HCS12 SPI with other devices An interface with even fewer wires can be implemented by using one data line in bidirectional mode. In bidirectional mode, a single data line functions both as serial data in and serial data out. In lab, we will connect our 9S12 to a Dallas Semiconductor DS1302 Real Time Clock, which uses a three-wire serial interface with a bidirectional data line. The MOSI line on the 9S12 becomes a MOMI (Master Out Master In) line. When the 9S12 wants to write data to the DS1302, it makes MIMO an output. When the 9S12 wants to read data from the DS1302, it makes MIMO an input. Bidirectional (3 Wire) SPI Communication with a Real Time Clock Master RTC Chip MIMO Clock Data SCLK Batt SS CS When used as a master in bidirectional mode, the Master Out Slave In pin becomes the Master Out Master In Pin 12

In a system, an HCS12 can communicate with many different devices over its SPI interface. It uses the same data and clock lines, and selects different devices by using GPIO lines as slave selects. 13