Controller IP for a Low Cost FPGA Based USB Device Core

Similar documents
Universal Serial Bus Host Interface on an FPGA

SERIAL BUS COMMUNICATION PROTOCOLS USB

Design and Implementation of Hamming Code on FPGA using Verilog

Chapter 11: Input/Output Organisation. Lesson 17: Standard I/O buses USB (Universal Serial Bus) and IEEE1394 FireWire Buses

STUDY, DESIGN AND SIMULATION OF FPGA BASED USB 2.0 DEVICE CONTROLLER

DESIGN AND IMPLEMENTATION OF SDR SDRAM CONTROLLER IN VHDL. Shruti Hathwalia* 1, Meenakshi Yadav 2

USB Framework, IP Core and related software Tropea S.E., Melo R.A.

FPGA-BASED DATA ACQUISITION SYSTEM WITH RS 232 INTERFACE

4 Multiplexer. Y Fig Keyboard Scan Matrix

SPART. SPART Design. A Special Purpose Asynchronous Receiver/Transmitter. The objectives of this miniproject are to:

Design of AHB Arbiter with Effective Arbitration Logic for DMA Controller in AMBA Bus

FPGA based Design of Low Power Reconfigurable Router for Network on Chip (NoC)

ISSN: [Bilani* et al.,7(2): February, 2018] Impact Factor: 5.164

THE INTERNATIONAL JOURNAL OF SCIENCE & TECHNOLEDGE

DESIGN AND IMPLEMENTATION OF 32-BIT CONTROLLER FOR INTERACTIVE INTERFACING WITH RECONFIGURABLE COMPUTING SYSTEMS

Functional Verification of xhci (extensible host controller Interface) for USB 3.1 Using HDL

System Verification of Hardware Optimization Based on Edge Detection

Keywords: Soft Core Processor, Arithmetic and Logical Unit, Back End Implementation and Front End Implementation.

EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board. (FPGA Interfacing) Teacher: Dr.

Signals and Encoding

OPB Universal Serial Bus 2.0 Device (v1.00a)

Course 10: Interfaces Agenda

HCTL Open Int. J. of Technology Innovations and Research HCTL Open IJTIR, Volume 4, July 2013 e-issn: ISBN (Print):

FPGA Implementation of ALU Based Address Generation for Memory

Full-Speed USB 1.1 Function Controller

ISSN Vol.05, Issue.12, December-2017, Pages:

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

Hardware Design with VHDL PLDs IV ECE 443

DESIGN AND IMPLEMENTATION OF I2C SINGLE MASTER ON FPGA USING VERILOG

Computer Organization

Design and Simulation of UART for Serial Communication

Implementation and Analysis of an Error Detection and Correction System on FPGA

FPGA for Software Engineers

Computer Organization

Implementation of Pipelined Architecture Based on the DCT and Quantization For JPEG Image Compression

HIGH-PERFORMANCE RECONFIGURABLE FIR FILTER USING PIPELINE TECHNIQUE

Index Terms- Field Programmable Gate Array, Content Addressable memory, Intrusion Detection system.

Hardware Description of Multi-Directional Fast Sobel Edge Detection Processor by VHDL for Implementing on FPGA

Performance Evaluation & Design Methodologies for Automated CRC Checking for 32 bit address Using HDLC Block

A Synthesizable RTL Design of Asynchronous FIFO Interfaced with SRAM

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Design of Convolution Encoder and Reconfigurable Viterbi Decoder

Matrix Manipulation Using High Computing Field Programmable Gate Arrays

FPGA Implementation of High Speed AES Algorithm for Improving The System Computing Speed

VHDL-MODELING OF A GAS LASER S GAS DISCHARGE CIRCUIT Nataliya Golian, Vera Golian, Olga Kalynychenko

FPGA Implementation of A Pipelined MIPS Soft Core Processor

Implementation of Ethernet, Aurora and their Integrated module for High Speed Serial Data Transmission using Xilinx EDK on Virtex-5 FPGA

INTRODUCTION OF MICROPROCESSOR& INTERFACING DEVICES Introduction to Microprocessor Evolutions of Microprocessor

32 bit Arithmetic Logical Unit (ALU) using VHDL

An Efficient Designing of I2C Bus Controller Using Verilog

DESIGN AND IMPLEMENTATION OF FPGA BASED MULTIPURPOSE REAL-TIME CONTROLLER FOR HYBRID STEPPER MOTOR

FPGA Interfacing of HD44780 Based LCD Using Delayed Finite State Machine (FSM)

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

FPGA Implementation and Validation of the Asynchronous Array of simple Processors

SHA3 Core Specification. Author: Homer Hsing

High Speed Fault Injection Tool (FITO) Implemented With VHDL on FPGA For Testing Fault Tolerant Designs

FPGA BASED ADAPTIVE RESOURCE EFFICIENT ERROR CONTROL METHODOLOGY FOR NETWORK ON CHIP

Laboratory Finite State Machines and Serial Communication

Summary. Introduction. Application Note: Virtex, Virtex-E, Spartan-IIE, Spartan-3, Virtex-II, Virtex-II Pro. XAPP152 (v2.1) September 17, 2003

DESIGNING OF INTER INTEGRATED CIRCUIT USING VERILOG

Chapter 1 Overview of Digital Systems Design

Microprocessors LCD Parallel Port USB Port

Logic Built In Self-Test Verification Statergy For SerDes PHY

AL8253 Core Application Note

Field Programmable Gate Array (FPGA)

10GBase-R PCS/PMA Controller Core

Simulation & Synthesis of FPGA Based & Resource Efficient Matrix Coprocessor Architecture

Reconfigurable PLL for Digital System

PIONEER RESEARCH & DEVELOPMENT GROUP

SPART - A Special Purpose Asynchronous Receiver/Transmitter

Implementation of High Speed Distributed Data Acquisition System

Interfacing a PS/2 Keyboard

An FPGA Project for use in a Digital Logic Course

August Issue Page 96 of 107 ISSN

Design of a Pipelined 32 Bit MIPS Processor with Floating Point Unit

Performance Evolution of DDR3 SDRAM Controller for Communication Networks

Design & Implementation of AHB Interface for SOC Application

SPART. SPART Design. A Special Purpose Asynchronous Receiver/Transmitter. The objectives of this miniproject are to:

PINE TRAINING ACADEMY

Circuit Design and Simulation with VHDL 2nd edition Volnei A. Pedroni MIT Press, 2010 Book web:

Implementation of Field Programmable Gate Array (FPGA) for decision making in portable automatic testing systems for IC s library & digital circuits

Virtex-5 GTP Aurora v2.8

Design Development and Implementation of SPI

Design and Verification of Serial Peripheral Interface 1 Ananthula Srinivas, 2 M.Kiran Kumar, 3 Jugal Kishore Bhandari

The Design of MCU's Communication Interface

High Speed SPI Slave Implementation in FPGA using Verilog HDL

PERFORMANCE ANALYSIS OF HIGH EFFICIENCY LOW DENSITY PARITY-CHECK CODE DECODER FOR LOW POWER APPLICATIONS

Prototyping of On-chip I2C Module for FPGA Spartan 3A series using Verilog

Physics 623. FPGA I Construction of a Synchronous Counter Aug. 4, 2008

Design of AMBA Based AHB2APB Bridge

The Xilinx XC6200 chip, the software tools and the board development tools

DE2 Board & Quartus II Software

FPGA DESIGN OF AN EFFICIENT AND LOW-COST SMART PHONE INTERRUPT CONTROLLER

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

DEVELOPMENT OF USER FRIENDLY DATA ACQUISITION AND ACTUATION SYSTEM ON EMBEDDED PLATFORM

A Low Power DDR SDRAM Controller Design P.Anup, R.Ramana Reddy

Block Diagram. mast_sel. mast_inst. mast_data. mast_val mast_rdy. clk. slv_sel. slv_inst. slv_data. slv_val slv_rdy. rfifo_depth_log2.

16 BIT IMPLEMENTATION OF ASYNCHRONOUS TWOS COMPLEMENT ARRAY MULTIPLIER USING MODIFIED BAUGH-WOOLEY ALGORITHM AND ARCHITECTURE.

PS2 VGA Peripheral Based Arithmetic Application Using Micro Blaze Processor

The Cubesat Internal bus: The I2C

Transcription:

National Conference on Emerging Trends in VLSI, Embedded and Communication Systems-2013 17 Controller IP for a Low Cost FPGA Based USB Device Core N.V. Indrasena and Anitta Thomas Abstract--- In this paper controller for a low cost FPGA based USB device core is described. During the last years, the well known USB standard became the basic communication module for digital systems, replacing the previous and traditional series and parallel communication interfaces. It provides many advantages. USB characteristics include low cost, easiness of use and simple construction. USB standard must be considered as something to be used in any kind of device requiring data communication with other systems or devices. FPGA become more powerful in terms of available reconfigurable hardware resources. A low cost USB device core mainly consists of two parts; the USB controller and the real world interface. Though the USB IP is designed be synthesizable onto an FPGA, it can easily be used to generate the hardware for an ASIC. This paper mainly concentrates on the USB controller. The USB controller IP is capable of carrying out low speed (1.5Mbps) USB transactions. T Keywords --- USB, FPGA, CRC, Endpoint, Transceiver I. INTRODUCTION HE well known USB standard became the basic communication module for digital systems, replacing the previous and traditional series and parallel communication interfaces. It provides many advantages. USB characteristics include low cost, easiness of use and simple construction. USB standard must be considered as something to be used in any kind of device requiring data communication with other systems or devices. The benefits of USB are autoconfiguration, low cost, expandability, hot-plugging and outstanding performance. It also provides power to the bus, enabling many peripherals to operate without the added need for an AC power adapter. USB is now the most used interface to connect devices like mouse, keyboards, PDAs, game-pads, joysticks, scanners, digital cameras, printers, personal media players and flash drives to personal computers. The developments in the electronics industry are aimed to make devices as small as possible and to get them to market quickly. So the designers focus on FPGAs rather than the traditional PCBs. Older connections like RS232 ports can only be connected to one device at a time. The USB standard was developed to overcome the shortcomings of older interfaces to peripheral devices for PCs. USB allows multiple devices to be attached to a single port enabling greater system flexibility. The standard makes interfacing to the PC extremely easy for the end user. This paper aims to develop a controller IP for low cost FPGA based USB device core. The USB controller is responsible for the correct transmission and reception of data through USB interface. It consists of a transmitter and a receiver. USB controller has error checking features built into it. It uses CRC logic for error checking [7]. The controller designed here is having 16 endpoints. It is possible to connect up to 127 devices. The USB controller IP is capable of carrying out low speed (1.5Mbps) USB transactions. Though the USB IP is designed be synthesizable onto an FPGA, it can easily be used to generate the hardware for an ASIC. II. USB DEVICE CORE The FPGA based USB device core mainly consists of a USB controller and a real world interface [1]. Fig 1 shows the schematics of the USB device core. The USB controller is responsible for the correct transmission and reception of data through USB interface. It consists of a transmitter and a receiver. USB controller has error checking features built into it. It uses CRC logic for error checking. The real world interface is used to connect the USB core to external world (say PC). This can be achieved using a Pico Blaze microcontroller which will be in charge of handling the upper level protocol and interfacing with the outside world. There are numerous commercial USB controller IPs and ICs available. The majority of USB controllers available are in the form of ICs. Controller IP has many advantages compared to controller ICs. Controller IP occupies less space on the FPGA or ASIC. It is easy to modify. The main goal of the paper was to develop a USB device controller IP in VHDL that is synthesizable on an FPGA. The simulation tool used here is ModelsimSE6.5. The development board used to test the IP contains a Xilinx SPARTAN XC3S50 FPGA. The low speed USB 1.1 standard was implemented. The data transfer rate of low speed USB is 1.5Mbps. N.V. Indrasena, Department of ECE, Viswajyothi College of Engineering & Technology, Vazhakulam, Kerala, India, Pin 686 670. E- mail:indrasena123@gmail.com Anitta Thomas, Department of ECE, Viswajyothi College of Engineering & Technology, Vazhakulam, Kerala, India, Pin 686 670. E- mail:anittathomas@rediffmail.com

National Conference on Emerging Trends in VLSI, Embedded and Communication Systems-2013 18 III. Fig 1: USB Core Schematics USB CONTROLLER - ARCHITECTURE The USB device controller IP provides an interface that can be used by a USB device to communicate with the USB host controller. Device designers who want to develop ASICs or FPGAs with USB capabilities do not have to use a separate chip if the controller is in the form of IP. The USB controller IP provides a series of endpoints that are used by the USB device to communicate through the controller. The USB Controller places no restrictions on the number of endpoints that it can handle. The number of endpoints is only limited by the device s driver and the device specific logic. Fig2 shows a general block diagram of how the controller is used [2]. The device specific logic can be an FPGA, microcontroller or any other device that is able to generate and read digital signals. The USB controller transmits data to and from endpoints for device specific logic. The device specific logic must let the controller know when it is ready to send data. The device driver will probe the USB controller regularly to see if valid data is in a specific endpoint. If there is data in the requested endpoint the USB controller will send its contents. The USB controller IP can be broken into three subsystems. The three major components of the system under design are the transmitter, receiver and controller. Transmitter and receiver form the data path of the USB controller. The controller is essentially a Mealy state machine. It keeps track of the different sections of a USB transaction. The first state of the USB controller is the start state. The next three states of the controller are used to receive the token packet from the host. The following four states break up the data packet or construct a data packet depending on whether the transaction is IN, OUT or SETUP. The final two states are used to either send or receive a token depending on the type of transaction. Fig 3 shows the block diagram of transmitter. The transmitter must undertake several tasks. It converts data from parallel to serial. This data will then have to be bit stuffed. The USB protocol requires a zero to be stuffed after every six consecutive ones. This is required so that there is a transition at least every six bits of the transmitter output. The stuffed binary data is eventually converted to NRZI encoding before being sent through the transceiver to the USB host. The transmitter is also responsible for forming data and handshake packets before sending them to the host. The transmitter is responsible for calculating the 16-bit CRC included in data packets sent to the host. Fig 2: Block Diagram of USB Controller Fig 3: Block Diagram Transmitter

National Conference on Emerging Trends in VLSI, Embedded and Communication Systems-2013 19 The receiver s function is the inverse of the transmitter. The receiver is more complicated than the transmitter and requires further functionality. The receiver has capabilities to calculate both 5-bit CRC and 16-bit CRC [7]. This is necessary since the receiver receives token packets, which contain a 5-bit CRC and data packets, which contain a 16-bit CRC. The transmitter compares the value it calculated with that received from the packets. If there is any inconsistency, retransmission is requested from the host. Block diagram of receiver [9] is shown in fig 4. Fig 4: Block Diagram Receiver Information generator generates the data packets to be transmitted by the transmitter. It converts the information from the device specific logic to the prescribed field formats that can be transmitted through the USB cable. The multiplexer of the transmitter is responsible for selecting what type of byte should be sent by the transmitter. The byte that should be sent is decided by the controller through the pid select port. Enable the receiver and then transmitter. When the clock arrives, the transmitter starts to send the packets. Initially it sends the synchronization sequence followed by the PID of the packet [6]. Then it sends the CRC value. After these three bytes, it starts to send the data bytes. In order to send the binary sequence, the parallel data is first converted to serial form using a shift register. The bit stuffing is done if needed. If six consecutive 1 s comes in a sequence, the transmitter inserts a zero with that sequence. This zero is the stuffed bit and it introduces a transition in the transmitted signal level. After bit stuffing, the data is encoded using an NRZI encoder [5]. In this encoding scheme, the bit 0 is represented by a transition in the signal level and no transition for bit 1. Then it is transmitted through the D+ line of USB cable. The transmitter also generates the 16bit CRC value. A DPLL module is used for synchronization [3]. Differential signalling is used to provide noise immunity [4]. Two lines (D + and D - ) are used for the transmission of the data. Depending upon the data to be transmitted, the differential lines change their voltage levels. IV. SIMULATION RESULTS The simulation code for USB controller was written in VHDL language. The VHDL code for the USB controller was divided into several modules. There are five modules and they are device transmitter, device receiver, transmit memory, receive memory and DPLL. Function of transmit memory is to store the data bytes to be transmitted. Here the memory stores 24 data bytes. In the transmitter section, different processes are written for the NRZI encoder, bit stuffing, parallel to serial conversion, byte counter, transmit state machine and CRC calculator. DPLL module is used to generate the USB clock to provide proper synchronization between transmitter and receiver. Receiver will detect the synchronization pattern and decode the PID. The NRZI encoded data is decoded to the original bit sequence and stuffed bits are removed. Then the serial data is grouped into bytes and stored in the receive memory. So receiver module performs NRZI decoding, stuffed bit removal, serial to parallel conversion and detection of error. CRC checks are used for error detection. All the modules are coded using VHDL. A test bench program was written to simulate the USB controller. ModelSim is a widely used logic simulation tool for verification and debugging of digital circuits. Here ModelSim6.5 simulator is used. Fig 5 shows the input data bytes in decimal form. When the transmit enable signal is applied, the differential data line (tx_dp) values changes according to the input bytes. Fig 5: Input Data in Decimal form and Transmitted Signal

National Conference on Emerging Trends in VLSI, Embedded and Communication Systems-2013 20 Fig 6 shows the received data bytes in decimal form. When buffer write signal goes high, the buffer data byte is written to the receive memory. The device utilization summary of the USB controller is given in fig 8. From the device utilization summary, it is clear that the USB controller utilizes a small percentage of the available resources. Logic Utilization Number of Slice Flip Flops Number of 4 input LUTs Total Number of 4 input LUTs Used Available Utilization 309 1536 20% 472 1536 30% 685 153 44% Fig 8: Device Utilization Summary Fig 6: Received Data in Decimal Form V. IMPLEMENTATION RESULTS The transmission of data packet was implemented using Spartan3 FPGA (XC3S50) [8]. Due to the lack of input switches, only the transmit enable, receive enable, reset and data bytes to be transmitted are given as the external inputs. The FPGA clock frequency is divided in order to implement the controller on FPGA. An input data indicator is provided using an LED to indicate when to input the external data bytes. Received data bytes are displayed using 8 LEDs. Synthesis converts the VHDL description into a set of primitives or components that can be assembled in the target FPGA. A synthesizer such as Xilinx Foundation series will have to be used in this process. Xilinx ISE8.1 is the synthesis tool used here. Implementation is done using Spartan3 FPGA. Fig 7 shows the inputs and outputs for the implementation. A clock divider is used to divide the clock signal from the FPGA. Receiver and transmitter are enabled. When the DATA_CLK_IND goes high, the system will fetch the input data byte. Four data bytes are transmitted. After the OUT_FLAG goes high, the output LEDs displays the received data bytes. After displaying four data bytes the RX_COMPLETE signal goes high. VI. CONCLUSION USB controller IP was developed which is in the form of synthesizable VHDL code. USB controller IP can be used by System on Chip designers to interface easily to the USB bus system. Due to the limited clock frequency of the FPGA development board, controller for low speed USB was implemented. Low speed USB has a maximum bandwidth of 1.5MHz. However a high speed USB compatible controller can easily be developed with minimal modification to this IP. The goal of the project to develop a USB Controller IP for FPGA designs was achieved. The simulation of the resulting system was done and verified the inputs and outputs. The transmission of data packets was implemented using Spartan3 FPGA. To complete the USB core modifications should be made to this IP. We must add the Pico Blaze microcontroller to interface this to the external world. Because of the limitations of the development board, the IP is low speed USB compatible. There is a minimal modification required to the IP to make the IP usable in high-speed USB 1.1 devices. To handle isochronous transfers, the IP should operate at high speeds. The only major modification that is required is that the IP must be able to detect start of frame packets and make sure they are received in numerical order. ACKNOWLEDGEMENT The authors would like to thank the staff members of Viswajyothi College of Engineering and Technology for their valuable guidance, help and support. Fig 7: Implementation Inputs and Outputs REFERENCES [1] Elio A.A, De Maria, Gho.E, Maidana C.E, A Low cost FPGA based USB device core, 4th Southern Conference on Programmable Logic, 2008, pp. 149 154. [2] Panchbudhe N.S, Prof.Shriramwar S.S, Jichkar G.A, FPGA Implementation of USB 2.0 receiver protocol, International Journal of Advances in Electronics Engineering, pp.199-203 [3] Aweya, J, Digital phase-locked loop for frequency distribution over packet networks, 37th Annual Conference on IEEE Industrial Electronics Society, 2011, pp. 2192 2197. [4] Yeh, P, Wang A., Tseng, B.C, High speed data transmission common mode noise suppression - application to USB 2.0 and IEEE 1394,

National Conference on Emerging Trends in VLSI, Embedded and Communication Systems-2013 21 Proceedings of the 4th International Symposium on Electronic Materials and Packaging, 2002, pp.488 491. [5] Sridhar K, Prasad S, Punitha L, Karunakaran S, EMI issues of universal serial bus and solutions, 8th International Conference on Electromagnetic Interference and Compatibility, 2003, pp.97 100 [6] Don Anderson, Universal Serial Bus System Architecture, 2 nd edition, MindShare Inc. 2001 [7] Universal Serial Bus Specification. September 1998. [8] Spartan 3 FPGA family datasheet.v.2.2. Product specification DS- 099.XilinxInc. May 2007. [9] Myilone Anandarajah, USB Controller IP for FPGA Designs, 2001 Indrasena N V was born in India. She took her B.Tech in Electronics and Communication Engineering from College of Engineering, Munnar (2004). She has done her M.Tech in VLSI and Embedded System at Viswajyothi College of Engineering & Technology, Muvattupuzha, during the year 2010-2012. Her fields of interest include Linear Integrated Circuits and Digital System Design. Anitta Thomas was born in India. She took her B.Tech in Electronics and Communication from Mahatma Gandhi University College of Engineering, Thodupuzha(2004) and M.Tech from Model Engineering College, Thrikkakkara (2010).She is currently working as Assistant Professor in Viswajyothi College of Engineering and Technology, Muvattupuzha.