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



Similar documents
Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

Part 1. MAX BIT DAC with an Arduino Board. MIDI to Voltage Converter Part1

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

Serial Communications

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

A DIY Hardware Packet Sniffer

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Serial Communications

USER GUIDE EDBG. Description

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

Using Altera MAX Series as Microcontroller I/O Expanders

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

SPI I2C LIN Ethernet. u Today: Wired embedded networks. u Next lecture: CAN bus u Then: wireless embedded network

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

MicroMag3 3-Axis Magnetic Sensor Module

LOCAL INTERCONNECT NETWORK (LIN)

Lizy Kurian John Electrical and Computer Engineering Department, The University of Texas as Austin

Arduino DUE + DAC MCP4922 (SPI)

Chapter 13. PIC Family Microcontroller

Chapter 02: Computer Organization. Lesson 04: Functional units and components in a computer organization Part 3 Bus Structures

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

SafeSPI - Serial Peripheral Interface for Automotive Safety

Application Note 83 Fundamentals of RS 232 Serial Communications

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

Vinco Development Module. Datasheet

FR FAMILY MB91460 SPI - DAISY CHAIN COMMUNICATION 32-BIT MICROCONTROLLER APPLICATION NOTE. Fujitsu Microelectronics Europe Application Note

Embedded Systems Design Course Applying the mbed microcontroller

Application of Wireless Sensor Network and GSM Technology: A Remote Home Security System

DS1307ZN. 64 x 8 Serial Real-Time Clock

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Data Cables. Schmitt TTL LABORATORY ELECTRONICS II

Microcontrollers in Practice

Web Site: Forums: forums.parallax.com Sales: Technical:

Atmel Norway XMEGA Introduction

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

The Programming Interface

Computer Organization and Components

Application Note 120 Communicating Through the 1-Wire Master

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

DS1621 Digital Thermometer and Thermostat

Decimal Number (base 10) Binary Number (base 2)

DS1621 Digital Thermometer and Thermostat

8051 Serial Port. Crystal TXD. I/O Device RXD. Embedded Systems Peripherals

Bluetooth to serial HC-06 wireless module

I 2 S bus specification

RTS5401. USB 3.0 Super-Speed HUB Controller DATASHEET. Doc Rev th Apr i Rev 0.90

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Internal Oscillator. I 2 C Interface. SPI Interface. Controller. Internal Registers Port Controller. Eight I/O Pins. Figure 1.

QorIQ espi Controller Register Setting Considerations and Programming Examples

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Future Technology Devices International Ltd. FT311D

EvB 5.1 v5 User s Guide

The Bus (PCI and PCI-Express)

Wireless Security Camera

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

ET-BASE AVR ATmega64/128

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

DS Wire Digital Thermometer and Thermostat

Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol

Am186ER/Am188ER AMD Continues 16-bit Innovation

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Design and Functional Verification of A SPI Master Slave Core Using System Verilog

Serial Communications (Chapter 10) RS232, SPI, I2C

DeviceMaster UP Modbus Controller to Controller Communication

Embedded Ethernet Interface Using Arm Processor

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

DAC Digital To Analog Converter

The modular concept of the MPA-3 system is designed to enable easy accommodation to a huge variety of experimental requirements.

Computer Systems Structure Input/Output

8051 MICROCONTROLLER COURSE

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

PART B QUESTIONS AND ANSWERS UNIT I

DS2155 T1/E1/J1 Single-Chip Transceiver

Programming Audio Applications in the i.mx21 MC9328MX21

Manual Serial PCI Cards

Arbitration and Switching Between Bus Masters

Microtronics technologies Mobile:

Solutions for Increasing the Number of PC Parallel Port Control and Selecting Lines

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

Institute of Machine Learning and Robotic Lab. University of Stuttgart Universitätsstraße 38 D Stuttgart. Diploma Thesis Nr.

The Answer to the 14 Most Frequently Asked Modbus Questions

RL78/G12 APPLICATION NOTE. Serial Array Unit (CSI Master Communication) Introduction. Target Device. R01AN1369EJ0100 Rev Mar.

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

US-SPI New generation of High performances Ultrasonic device

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

1-Mbit (128K 8) Quad SPI nvsram with Real Time Clock

Chapter 2 Logic Gates and Introduction to Computer Architecture

LatticeECP2/M S-Series Configuration Encryption Usage Guide

Transcription:

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide 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 Need 9 wires to transmit 8 bits of data How can receiver tell when it should read the data? 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:

Need 10 wires to transmit 8 bits of data 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. 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. 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 h = 0x68 = %01101000 Can t tell how many ones or zeros there are

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 (Serial Peripheral Interface (SPI) on the HCS12) Asynchronous Serial Data Transfers (Serial Communication Interface (SCI) on the HCS12) Synchronous Serial 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 h = 0x68 = B"01101000" Need 3 wires to transmit 1 bit at a time 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 transferred from the sending computer to the receiving computer. SYNCHRONOUS SERIAL COMMUNICATIONS h = 0x68 = B"01101000" Need 3 wires to transmit 1 bit at a time 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 clock used 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 transferred to the slave, and the data in the Slave shift register has been transferred to the Master. 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. Need to have: Slave select (SS), Serial clock (SCK), Master out/slave in (MOSI), Master in/slave out (MISO).

SYNCHRONOUS SERIAL COMMUNICATIONS With select lines, one master can communicate with more than one slave 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 CONVERTER 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 (i.e. 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 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 SPI WITH A REAL TIME CLOCK When used as a master in bidirectional mode, the Master Out Slave In pin becomes the Master In Master Out Pin. 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.