Data Transactions from UART to SPI Slave Devices through UART-SPI Controller for an SOC

Similar documents
Serial Communications

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

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

Serial Communications

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

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

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

Design and Verification of Nine port Network Router

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

Serial port interface for microcontroller embedded into integrated power meter

USER GUIDE EDBG. Description

Using Xbee in Serial Communication

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

MicroMag3 3-Axis Magnetic Sensor Module

SafeSPI - Serial Peripheral Interface for Automotive Safety

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

Embedded Systems Design Course Applying the mbed microcontroller

M25P05-A. 512-Kbit, serial flash memory, 50 MHz SPI bus interface. Features

FPGA INTEGRATION MANUAL SATURN-SIL 2 MODULES. Dictionary Code. Edition 01. Revision 00. Number of pages 18

Application Note 83 Fundamentals of RS 232 Serial Communications

Embedded Ethernet Interface Using Arm Processor

Single channel data transceiver module WIZ2-434

A DIY Hardware Packet Sniffer

The Programming Interface

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

a8251 Features General Description Programmable Communications Interface

DECT Module UM-9802 Datasheet

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

Display Message on Notice Board using GSM

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

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

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

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

DS1621 Digital Thermometer and Thermostat

7a. System-on-chip design and prototyping platforms

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

DS1621 Digital Thermometer and Thermostat

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

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

Location-Aware and Safer Cards: Enhancing RFID Security and Privacy

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

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

VLSI Based Vehicle Security and Accident Information System

2.0 Command and Data Handling Subsystem

Chapter 13. PIC Family Microcontroller

9/14/ :38

Measurement and Analysis Introduction of ISO7816 (Smart Card)

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

PART B QUESTIONS AND ANSWERS UNIT I

Implementing MOD bus and CAN bus Protocol Conversion Interface

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

ET-BASE AVR ATmega64/128

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

Switch Fabric Implementation Using Shared Memory

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

Microprocessor & Assembly Language

System on Chip Platform Based on OpenCores for Telecommunication Applications

DS Wire Digital Thermometer and Thermostat

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

Part Number Description Packages available

Real-Time Vehicle Data Logging System Using GPS And GSM

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P.

Design and Implementation of an On-Chip timing based Permutation Network for Multiprocessor system on Chip

International Journal of Advancements in Research & Technology, Volume 2, Issue3, March ISSN

In-Vehicle Networking

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

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

INDUSTRIAL CONTROL TECHNOLOGY. A Handbook for Engineers and Researchers. Peng Zhang. Beijing Normal University, People's Republic of China

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

The Secrets of RS-485 Half-duplex Communication

Microtronics technologies Mobile:

All Programmable Logic. Hans-Joachim Gelke Institute of Embedded Systems. Zürcher Fachhochschule

Intelligent Home Automation and Security System

Atmel Norway XMEGA Introduction

Software User Guide UG-461

Bus Data Acquisition and Remote Monitoring System Using Gsm & Can

Manchester Encoder-Decoder for Xilinx CPLDs

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

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Serial Communications (Chapter 10) RS232, SPI, I2C

Using Altera MAX Series as Microcontroller I/O Expanders

Agenda. Michele Taliercio, Il circuito Integrato, Novembre 2001

Serial Communications / Protocol in AirTest Products

Lab Experiment 1: The LPC 2148 Education Board

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

Introduction to Digital System Design

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

Android Controlled Based Interface

Open Architecture Design for GPS Applications Yves Théroux, BAE Systems Canada

What is a System on a Chip?

Architectural Level Power Consumption of Network on Chip. Presenter: YUAN Zheng

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Intelligent Fleet Management System Using Active RFID

Implementing a Digital Answering Machine with a High-Speed 8-Bit Microcontroller

How To Fix A 3 Bit Error In Data From A Data Point To A Bit Code (Data Point) With A Power Source (Data Source) And A Power Cell (Power Source)

NIOS II Based Embedded Web Server Development for Networking Applications

MICROPROCESSOR AND MICROCOMPUTER BASICS

Transcription:

Advance in Electronic and Electric Engineering. ISSN 2231-1297, Volume 3, Number 4 (2013), pp. 413-420 Research India Publications http://www.ripublication.com/aeee.htm Data Transactions from UART to SPI Slave Devices through UART-SPI Controller for an SOC 1 Mr. P. Rajendra Prasad and 2 Mr. S.P. Venu Madhava Rao 1 Sreenidhi Institute of Science and Technology, Hyderabad, A.P., India. 2 Sreenidhi Institute of Science and Technology, Hyderabad, A.P., India. Abstract This paper details the design and usage for the universal asynchronous receiver/transmitter to serial peripheral interface.the UART-to-SPI interface can be used to communicate to SPI slave devices from a PC with a UART port. SPI is a full duplex, serial bus commonly used in the embedded world because of its simple hardware interface requirements and protocol flexibility. SPI devices are normally smaller in size (low I/O count) when compared to parallel interface devices. This design example is implemented on an ASIC device, but can easily be implemented in any of low-power field programmable gate arrays (FPGAs) to optimize system power, size,or performance requirements. Keywords: SOC, UART, SPI, power optimization. 1. Introduction A UART is usually an individual (or part of an) integrated circuit used for serial communications over a computer or peripheral device serial port. UARTs are now commonly included in microcontrollers. A dual UART or DUART combines two UARTs into a single chip. Many modern ICs now come with a UART that can also communicate synchronously; these devices are called USARTs (universal synchronous/asynchronous receiver/transmitter. An UART is a device allowing the transmission and reception of information, in a serial and asynchronous way. Universal Asynchronous Receiver and Transmitter are used asynchronous serial data communication between remote embedded systems. The UART can be used to control the process of breaking parallel data from the PC down into serial data that can be transmitted. It consists of one receiver module and transmitter module. UART has

414 Mr. P. Rajendra Prasad & Mr. S.P. Venu Madhava Rao been an important input/output tool for decades and is still widely used. UARTs are used for communication between two devices [1]. SPI stands for Serial Peripheral Interface. It is a synchronous protocol that allows a master device to initiate communication with slave devices. SPI is a full duplex, serial bus commonly used because of its simple hardware interface requirements and protocol flexibility. SPI consists of two blocks. The SPI master and the SPI slave, the SPI Master which is being used in this design implements the master functionality of the SPI protocol. SPI protocol specifies four signal wires MISO - master out slave in, MISO - master in slave out, SCLK - serial clock and SS - slave select [2].The SPI Master block generates the control signals to interface to external slave devices using the serial data out port (MOSI), serial data in port (MISO), output clock (SCLK) and slave select (SS) [8].The SS signal mustbe used if more than one slave exists in the system. UART-to-SPI interfacing block which is middle block joins the UART and SPI master. It helps the interconnection between these two interfaces. The main advantage is, the UART- SPI interface [7] can fit in any application where an SPI device has to be used without any difficulties. As the UART-SPI interface can be used to communicate to SPI slave devices from a PC with UART port it can be used for typical applications like interfacing of EEPROM, flash memories and sensors [6]. 2. System-On-Chip Moore s law not only states that their will be increase in density of transistors as technology advances. It also inflict new demands and challenges, Complexity of systems also varies at the high rate of speed. As technology advances still the old architecture proposed 20 years back cannot be adopted, new architectures has to be followed. As per the Moore s law revolution, in the mid-eighties was the way to embed more and more electronic devices in the same silicon die; it was the era of System on Chip [8]. The main challenge was the way to interconnect all these devices effectively towork efficiently. Because of this need we use Bus interconnect structure for VLSI sub system. An embedded system usually has an embedded user interface as a form of software and consists many components inside, not only the hardware but also the software that constitutes the system is important. Such a complicated and complex entity can be handled only with computer-aided design tools, automatic synthesis of the physical layouts, and software engineering knowledge. In addition, the system functions to achieve a specific goal, as a whole, are usually described in algorithms that should satisfy user requirements in time.

Data Transactions from UART to SPI Slave Devices through UART-SPI 415 3. UART Design The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications subsystem of a computer. The UART takes bytes of data and transmits the individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits into complete bytes. Serial transmission is commonly used with modems and for non-networked communication between computers, terminals and other devices.after the Start Bit, the individual bits of the word of data are sent, with the Least Significant Bit (LSB) being sent first. Each bit in the transmission is transmitted forfive to eight data bits, least-significant-bit first, an optional "parity" bit, and then one, one and a half, or two "stop" bits. The start bit is the opposite polarity of the data-line's idle state. The stop bit is the data-line's idle state, and provides a delay before the next character can start. (This is called asynchronous start-stop transmission). In mechanical teletypes, the "stop" bit was often stretched to two bit times to give the mechanism more time to finish printing a character. A stretched "stop" bit also helps resynchronization.as part of this interface, the UART also [3]: Converts the bytes it receives from the system along parallel circuits into a single serial bit stream for outbound transmission On inbound transmission, converts the serial bit stream into the bytes that the system handles Adds a parity bit (if it's been selected) on outbound transmissions and checks the parity of incoming bytes (if selected) and discards the parity bit Wait until the incoming signal becomes ' 0 ' (the start bit) and then start the sampling tick center. When the center reaches 7, the incoming signal reaches the middle position of the start bit. Clear the center and restart. 4. SPI Design The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial link used to connect microcontrollers to sensors, memory, and peripherals. It's a simple "de facto" standard, not complicated enough to acquire a standardization body. SPI uses a master/slave configuration. The three signal wires hold a clock (SCK, often on the order of 10 MHz), and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In, Slave Out" (MISO) signals. (Othernames are also used.) There are four clocking modes through which data is exchanged; mode-0 and mode-3 are most commonly used. Each clock cycle shifts data out anddata in; the clock doesn't cycle except when there is a data bit to shift. Not all data bits are used though; not every protocol uses those full duplex capabilities.

416 Mr. P. Rajendra Prasad & Mr. S.P. Venu Madhava Rao Figure 2: Communication b/w a master and a slave device. SPI consists of one master device and one or more slave devices. If more than one slave device are connected to the master then Slave Select (SS) signal is used which is active low. To begin a communication, the bus master first configures the clock, using a frequency less than or equal to the maximum frequency the slave device supports. Such frequencies are commonly in the range of 1 100 MHz. The master then transmits the logic 0 for the desired chip over chip select line. A logic 0 is transmitted because the chip select line is active low, meaning its off state is a logic 1; on is asserted with a logic 0. If a waiting period is required (such as for analog-to-digital conversion), then the master must wait for at least that period of time before starting to issue clock cycles. During each SPI clock cycle, a full duplex data transmission occurs: The master sends a bit on the MOSI line; the slave reads it from that same line The slave sends a bit on the MISO line; the master reads it from that same line Not all transmissions require all four of these operations to be meaningful but they do happen. Transmissions normally involve two shift registers of some given word size, such as eight bits, one in the master and one in the slave; they are connected in a ring. Data is usually shifted out with the most significant bit first, while shifting a new least significant bit into the same register. After that register has been shifted out, the master and slave have exchanged register values. Then each device takes that value and does something with it, such as writing it to memory. If there is more data toexchange, the shift registers are loaded with new data and the process repeats. Transmissions may involve any number of clock cycles. When there is no more data to be transmitted, the master stops toggling its clock. Normally, it then deselects the slave Every slave on the bus that hasn't been activated using its chip select line must disregard the input clock and MOSI signals, and must not drive MISO. The master must select only one slave at a time. At CPOL=0 the base value of the clock is zero For CPHA=0, data is captured on the clock's rising edge (low high transition) and data is propagated on a falling edge (high low clock transition). For CPHA=1, data is captured on the clock's falling edge and data is propagated on a rising edge. At CPOL=1 the base value of the clock is one (inversion of CPOL=0)

Data Transactions from UART to SPI Slave Devices through UART-SPI 417 For CPHA=0, data is captured on clock's falling edge and data is propagated on a rising edge. For CPHA=1, data is captured on clock's rising edge and data is propagated on a falling edge. That is, CPHA=0 means sample on the leading (first) clock edge, while CPHA=1 means sample on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling. Note that with CPHA= =0, the dataa must be stable for a half cycle before the first clock cycle. For all CPOL and CPHA modes, the initial clock value must be stable before the chip select line goes active.the MOSI and MISO signals are usually stable (at their reception points) for the half cycle until the next clock transition. SPI master and slave devices may well sample data at different points in that half cycle.this adds more flexibility to the communication channel between the master and slave. 5. UART- SPI Interfacing This design consists of three blocks: the UART block interface,uart-spi controller block and SPI master interface. The UART block used in this design is coreuart. This block handles the data at the UART end. The UART-SPI controller block which is used internally stitches the coreuart and SPI master. SPI master block generates control signals to interfacee external devices. This interface communicates to the slave devices using the serial data out port (MOSI), serial data in port (MISO), output clock (SCLK), and slave select ports(ss_n [7:0]).There are three internal registers in the design: control register, transmit register, and receive register.. Figure 3: UART-SPI interface. During write operation rxd receives the input then DATA_OUT to controllerr and receive ready(rxrdy).controller generates address (ADDR),data, write (WR),chip select (CS) and user chip select(user_cs) and gives to SPI master which then

418 Mr. P. Rajendra Prasad & Mr. S.P. Venu Madhava Rao generates serial clock and MOSI. At the same time, data from eeprom has given to slave interface is forward the data to the spi master, spi master will take the data from spi slave through miso pin after completion of 8-bits it will set the tx_rx_done pin. On activating the tx_rx_done pin interface will send the RD, addr values and it will take the data from the spi master. Next it will check whether the uart transmitter is free or not by checking the TXRDY pin. If transmitter is free then interfacee will send the data to the transmitter. Transmitter will transmit the data and set the TXRDY pin. Otherwise it will wait until transmitter is free. The control register sets the different control bits, the transmit register sendss the TX data to the SPI bus, and the receive register receives the Rx data from the SPI bus[4]. After every reset, data received from the external UART go to the control register. The control bit positions are given in Table 1. Table 1: Control bit positions. When UART-to-SPI communicates in the design only corresponding slave will be selected.because only one slave device should be transmitting data during a particular dataa transfer. Slave devices that are not selected do not interfere with SPI bus activities during that period [5] Other slave devices will ignore the clock signal and keep MISO in high impedance state, unless the slave select pin is enabled.the SPI_OR_MEM value sets the operation mode. When SPI_OR_MEM is set to 1, the slave select signal SS Nx will be asserted Low for a 1-byte (8 bit) transaction only; when SPI_OR_MEM is set to 0, the SPI slave device will be treated as SPI memory, SS_Nx will be asserted low for multiple bytes of data.[3]. The slave select will be Low for the command byte, address bytes, and data bytes [8]. When SPI_OR_MEM is set to 1 then the following commands seen in table takes place. Table 2: Commands.

Data Transactions from UART to SPI Slave Devices through UART-SPI 419 6. Simulation Results A data transaction from UART to SPI slave devices through UART-SPI controller for an SOC has beensynthesized using the Xilinx 13.2 and the simulation results are shown in figure and figure respectively. Figure 4: Simulation results. Figure 5: Simulation results.

420 Mr. P. Rajendra Prasad & Mr. S.P. Venu Madhava Rao Table 3: Device utilization summary. 7. Conclusion and Future Scope Data transactions from UART to SPI slave devices through UART-SPI controller for an SOC are very effective in many applications. The communication in the SOC architecture makes easy as they have been connected with a bus. In future as of more applications will add into the subsystem the routing architecture plays a vital role in the system and it can be implemented in NOC. References [1] Design and simulation of UART serial communication module based on VHDL - Fang Yi-Yuan, Chen Xue, IEEE Explore, may 2011. [2] Design and test of general purpose SPI master/slave IPs on OPB Bus- systems signals and devices, 7fu international multi conference, 2010. [3] A.K Oudjida et ai, Master-Slave wrapper communication protocol: A casestudy, Proceedings of the 1'1 IEEE International Computer Systems and Information Technology Conference ICSIT'05, PP 461-467, 19-21 July 2006 [4] REN Yu-fei,ZHANGXiang,CHENGNai-ping (Department of Optical and Electrical,Academy of Equipment Command &Tech, Beijing 101416, China); Design and Realization of Two-way Transmission SPI Interface; Telecommunication Engineering; 2009. [5] Zhang Rui;A Method to Realize DSP Communicating with Other Device by SPI Interface Protocol [J]; International Electronic Elements; 2003-08. [6] A micro- FT- UART for safety critical SOC based Applications, www.doi.ieeecomputersociety.org. [7] www.xilinx.comlsupport/documentationlipdocumentationlxpspi.pdf [8] www.actel.comldocuments/uart_to_spcan.pdf