38
Standalone USB Flash to USB Flash Data Transfer Sr. No Topic Page No. 1. Abstract 2 2. Innovation 4 3. Introduction 6 4. Block Diagram & Description 9 5. Components Selection 13 6. Circuit Schematic and Explanation 15 7. Applications 17 8. Work Plan 19 9. References 21 10. Demonstration Strategy 23 Index Page No. 1

USB Proj Report

Embed Size (px)

Citation preview

Page 1: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Sr.

NoTopic Page No.

1. Abstract 2

2. Innovation 4

3. Introduction 6

4. Block Diagram & Description 9

5. Components Selection 13

6. Circuit Schematic and Explanation 15

7. Applications 17

8. Work Plan 19

9. References 21

10. Demonstration Strategy 23

Index

Page No. 1

Page 2: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

1abstract

Page No. 2

Page 3: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Abstract

The Computer has become an inseparable part of life for many people in the world. Its

innumerable uses have changed the life of many, not only in technical field but also in non

technical field. Moreover, now-a-days, with increasing use of the computer, people are

getting well versed with use of the peripherals that are associated with it. These peripherals

give additional features to the already existing functionalities of the computer, while some

enhance them. Along with the advancements in capabilities of the Computer, the

capabilities of these peripherals have also been improved, thus, making it simpler and more

user-friendly for the user. Gradually, using the computer has become a ‘child’s play’ in the

literal sense of the term. To make it even more simple, the ways by which these peripherals

are interfaced with the computer have also changed and improved. The central idea of this

project revolves around one such peripheral- the USB. This much user friendly device class

is actually recognized by its Connection type viz. the BUS; called the Universal Serial Bus.

It comprises of just four connection wires between the Host (Computer) and the Device,

governed by a set of rules called the Protocol. The aim of this project is to transfer data

remotely without using a computer, from one USB flash disk to another.

Page No. 3

Page 4: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

2Idea Innovation

(Literature survey with references)

Page No. 4

Page 5: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

2.1 Idea Innovation

The idea of this project was taken, looking at the problems faced by daily life Flash

Drive Users to transfer the data from one disk to another. Carrying a computer or a laptop

just for the sake of data transfer is not affordable these days in the age when people want all

devices to be as small and handy as possible. Moreover, transferring data via a computer

involves a lot of power to be wasted, since the computer has to be entirely functional before

it can transfer data.

Considering the massive market for all types of USB devices which is growing at an

exponential rate, there is a need for the USB host devices to keep up with it. There are

numerous types of data transactions that are being carried out through these devices. These

USB devices are shrinking in sizes day by day but not the equipment which is required to

access them.

However to operate these devices most of the times an operating system is required

which calls for the hosts to be extremely complicated system hence accessing these devices

requires complicated hardware, hence a controller that can handle the data transfer and

initiates the USB transactions was searched.

Literature Survey

A core team from Compaq, Hewlett Packard, Intel, Lucent, Microsoft, NEC and

Philips leading the development of the USB Specification, version 2.0, that has increased

data throughput by a factor of 40. This backwards-compatible extension of the USB 1.1

specification uses the same cables, connectors and software interfaces so the user will see

no change in the usage model. They will, however, benefit from an additional range of

higher performance peripherals, such as video-conferencing cameras, next-generation

scanners and printers, and fast storage devices, with the same ease-of-use features as

today’s USB peripherals [1]. USB supports three bus speeds: high speed at 480

Megabits/sec., full speed at 12 Megabits/sec., and low speed at 1.5 Megabits/sec. The USB

host controllers in recent PCs support all three speeds [2].

The USB Host Controller is in charge of asking every USB device if it has any data

to send. Because of this topology, Device can not start sending data without being

prompted [4]. This justifies the need for a USB Host Controller and its Configuration

Page No. 5

Page 6: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

3Introduction

Page No. 6

Page 7: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Introduction

Numerous applications arise in the daily life of a common Computer user that he has to

transfer data from one USB Flash device into another, that too very quickly and on the go.

For this he has to first find a computer then wait for it to boot up, then plug in his device,

and then transfer the data. Different types and makes of USB flash devices are used now-a-

days. It is not necessary that all of these devices are supported by the computer and the

operating system and their device drivers are available and installed.

Carrying a computer or a laptop just for the sake of data transfer is not affordable these

days in the age when people want all devices to be handy. Moreover, transferring data via a

computer involves a lot of power to be wasted, since the computer has to be entirely

functional before it can transfer data.

Also, the threat of viruses and malware has made the life of common computer users all

the more complicated. These viruses get activated as soon as the device is plugged into the

system and get copied along with other data from one flash device into another.

Our project here can provide a valuable solution to all problems faced by person in

above situations. Our aim is to build a small and handy device to transfer data from one

USB Flash device to another.

The device will have following features:-

Small, light weight and handy device

Powered by 9V battery

Support for all USB Flash devices formatted with FAT32 file System

Support for USB 2.0

Plug and Go function

Page No. 7

Page 8: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

About Universal Serial Bus (USB)[5]

USB was initially designed to be an interface for communicating with many types

of peripherals without the limits and frustrations of older interfaces. Every recent PC

includes USB ports that can connect to standard peripherals such as keyboards, mice,

scanners, cameras, printers, and storage drives. It is a very useful protocol designed for a

computer to communicate with almost any type of peripheral.

Some of its benefits for users include:

1. Single Interface for many devices

2. Considerably high Data rate

3. Automatic Configuration

4. Easy connection

5. Hot Pluggable

6. No user Settings

7. Frees Hardware Resources for other devices

8. No extra Power Supply needed

9. Low Cost and Low Power consumption

Benefits for Developer include:

1. Versatility

2. Operating System support

3. Peripheral support

4. Open source Support available online

Inside USB:

As mentioned above, the connection comprises of four Connecting Lines viz.

1. VCC 3. D+

2. D- 4. Ground

The VCC and Ground are the power supply signals to the device. D+ and D- are the

data lines through which actual data transfer takes place. Both D+ and D- are bidirectional

lines, both carrying data in a single direction at a time and data is modulated into

differential voltage levels to be transferred over them. The directions of D+ and D- are

reversed in TDM manner to transmit and receive data. It is a connectivity with peer-to-peer

communication.

Page No. 8

Page 9: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Variants:

VersionIntroduce

d

Supported

Speeds

Compatibilit

y

1.0 January1996 Low Speed -

1.1September1

998Low Speed, Full Speed Backward

2.0 April2000Low Speed, Full

Speed, High SpeedUSB 1.1, USB 1.0

3.0December20

08Super Speed USB 2.0

Low Speed has data rate of 1.536Mbits/s, Full Speed has 12Mbits/s, High Speed has

480Mbits/s, Super Speed has 5Gbits/s

Components:

The host is a PC or other computer that contains a USB host

controller and a root hub. The host initiates all transfers. The host controller

formats data for transmitting on the bus and translates received data to

a format that operating-system components can understand. The host

controller also performs other functions related to managing

communications on the bus. The root hub has one or more connectors

for attaching devices. The root hub, in combination with the host

controller, detects attached and removed devices, carries out requests

from the host controller, and passes data between devices and the host

controller.

The host controller creates Endpoints in the device. Endpoints are

buffers or small parts of memory used to send data to, or receive data

from. It also establishes connection called Pipes which are virtual wires

for transfer of data. A maximum of 128 devices can be connected in

cascade theoretically.

There are 4 types of data transfers- Control used for configuration

and handshake, Bulk used for huge data exchange like a file copy,

Page No. 9

Page 10: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Interrupt used for small information exchange, and Isochronous is used

when acknowledgement is not needed like in case of video camera.

4Block diagram & Description

Page No. 10

Page 11: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Block Diagram

Page No. 11

Page 12: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Block Diagram Description

1) USB Flash Disk:

These are our source and target Devices. They will be connected to the USB Host

Controller IC via the USB interface. Both the devices can be accessed simultaneously. The

memory on them is in the form of Flash which is accessed by an on board hardware. These

devices have also got protocol handling hardware included on device.

Before making the devices available for use, the Operating system formats the device

with a file format. FAT-8, FAT-16, FAT-32, NTFS, are some file systems available in

Microsoft Operating Systems. Majority of USB Flash devices are formatted in FAT-32 file

system. There may sometimes be Partitions on the drive. Data encrypted with all above

formats can be accessed with an efficient Firmware on the USB Host Controller.

2) USB Host Controller IC:

This is a microcontroller which has an interface to connect a USB device. It has a

Central Processing Unit of its own. The requirement here is of 2 USB ports. It is the main

device that handles the USB protocol and does the jobs of the USB host. It may contain an

Operating System and also device drivers to interact with the device. It will be responsible

for creation of endpoints, establishment of pipes, initiating transfers, enumeration etc. We

can preferably look for capability like DMA so that CPU remains free while Data transfer

Its components are for following functions:

USB Port 1 & 2:

These are for the physical connection of the USB devices. They should be able to handle

the physical part of the USB protocol connection. Many a times, the ports also have the

required pull-up and pull-down resistors for host or slave signalling mode. They handle the

+3.3V differential signalling which is a USB standard. These blocks handle the parallel-to-

serial and serial-to-parallel conversion of the USB physical layer. This includes bit stuffing,

CRC generation, USB frame generation and protocol error checking.

Central Hardware Core:

It contains the CPU of the Host Controller. Required to do all the functions a

microcontroller does plus some additional ones. Here it accepts the information from the

microcontroller unit a, decodes it and forwards it to the Command monitor for further

execution of commands. It can also be used to handle functions such as configuration of

peripherals connected to Host controller and communications, Sleep mode, booting etc

Page No. 12

Page 13: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

GPIO Ports:

These may or may not be present on the USB host controller. They can be used

sometimes for communicating with peripheral devices and for General Purpose I/O ports

functions.

Command Monitor:

Communicating with and controlling the Host Controller is achieved by sending

instructions to the command monitor and interpreting the results. Command monitor is a

firmware like Operating System. The command monitor provides an interface which can be

utilised by a microcontroller to read and send data. A prompt is returned when the Host

Controller is ready to execute a command. Status and error information is returned after a

command has completed and event notifications are relayed to the monitor.

3) Microcontroller

The Host controller has to be sent commands to. These commands are in the form

of series of bytes that have to be sent over the Txd and Rxd lines serially. This work is done

by the Microcontroller. It can also be used to program the Host controller. It is also

required for interfacing the user interfaces.

Firmware Functions:

The firmware on the microcontroller will be function to first take inputs from the

user via the keypad routines. It will also be responsible for functions such as detection of

devices and waking system from sleep, entering power saving mode, handling of the

monitor display routines, monitoring responses coming from Host controller and taking

actions etc.

Command Lookup Table:

This is an array of bytes stored in the data memory of Microcontroller. A pointer

used to access this memory array depending upon the commands given by the user or the

relative action to be taken depending upon the status.

GPIO:

It is necessary for interfacing of keypad and the display to the microcontroller.

4) Keypad and Display:

Used by the system to establish communication with user and take inputs from user.

Page No. 13

Page 14: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

5Component selection

Page No. 14

Page 15: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Component Selection

1). USB Host Controller IC-VNC1L:

To begin with, selection of the USB host controller IC is to be done. Host

controllers can be found in market, in two types viz. Dedicated IC for USB Host, Slave and

device operations, and USB Host controllers included in microcontrollers. The second most

important criteria to look for is the presence of two USB ports on the Host Controller to

avoid the use of buffer and extra hardware. One more feature to look for was support for

FAT-32 file system included hardwired on the Host controller to avoid complications in

microcontroller code to decode it. A dedicated USB Host Controller from Vinculum was

found- VNC1L.

It has got following features over host controllers included on chip of General

Purpose Microcontrollers:

Two independent USB 2.0 Low speed / Full speed USB Host / Slave ports

Entire USB protocol handled on the chip

8/32bit MCU core

Twin DMA controllers for hardware acceleration

64kB embedded Flash ROM Prog. Memory, 4kB Data SRAM

Interface to MCU / PLD / FPGA via UART/ FIFO/SPI interface

Up to 28 GPIO interface pins for data I/O and command monitor interface

3.3V operation with 5V safe inputs

Along with these features, VNC1L has some other features that make it most suitable for

the application.

Criteria for VNC1L selection

Twin Host Controllers inbuilt

Availability of Twin DMA controllers

Availability of ready VDAP

NCU- 32bit Numeric Co-processor Unit for handling of FAT32 file system

Handles entire USB protocol On Chip

Page No. 15

Page 16: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

2). General Purpose Microcontroller

For commanding/ programming USB Host controller PIC 16F688 IC is used. Any

General purpose Controller can be used with sufficient memory to store commands that are

to be given to Host controller and having sufficient GPIO ports to interface Human

Interface Devices. Hence PIC 16F688 is selected. (This controller may be changed in case

of requirement to add additional features to entire device and make it more user friendly)

PIC 16F688 has following features:

14-Pin Flash-Based, 8-Bit Microcontroller

Wide operating voltage range (2.0V-5.5V)

12 I/O pins with individual direction control

Operating Current:

- 8.5μA @ 32 kHz, 2.0V, typical

- 100μA @ 1 MHz, 2.0V, typical

Enhanced USART Module

In-Circuit Serial Programming

4kB on chip Program Memory, 256 bytes data memory

Page No. 16

Page 17: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

6Circuit schematic

& explanation

Page No. 17

Page 18: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Page No. 18

Page 19: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Explanation

1). VNC1L USB Host Controller

The controller is based around a custom processor core with twin direct memory

access (DMA) engines to accelerate data transfers and a 32bit numeric co-processor to

optimise the calculations for the file system - all in a single chip with 64Kbytes of

embedded flash program memory and 4Kbytes of internal data SRAM.

Vinculum is specifically targeted at the embedded USB controller market and

requires a minimum of external support components. One key feature of the Vinculum core

is that its code length is significantly reduced compared with common MCU cores.

Reducing the code overhead of the core allows much more functionality to be squeezed

into the on-chip e-flash memory.

The DMA controllers are controlled automatically by hardware and there is no need

for developer to configure or use them manually at the time of using the IC in projects [3].

2). PIC16F688 Microcontroller

The PIC is the controller of the system, taking data from sensors or other sources

via its general purpose I/O pins (RC0, RC1, RA2 on pins 9,10,11), converting the data

format and writing that data in a stream to a file on the flash drive. Commands and data are

sent via TXD (pin 6) to the VNC1L RXD (pin 32). VNC1L handles the FAT 12/16/32 file

creation and data storage on the USB Flash drive communicating with the drive via

USB2DM and USB2DP on pins 28 and 29. Data is read from the flash drive via the same

pins, and sent from the VNC1L TXD (pin 31) to the RXD (pin 5) of the PIC for use by the

system firmware.

The system is controlled by the firmware on the PIC, with the transfers controlled

by instructions issued by the PIC and interpreted by the standard firmware on the

Vinculum. Whilst that is a simple description of the system, there is more required to

complete the design. The devices need power, crystals to control their clocks, and they need

to be programmed.

Using a 20MHz crystal on pins 2 and 3 of the PIC allows for higher baud rates of up

to 115200 bit/s in its UART interface as opposed to the maximum 9600 bit/s achievable by

using the internal 8MHz oscillator, thus improving the performance of the system. PIC IO

pins RC2 and RC3 are used by the PIC firmware to simulate RTS/CTS handshake signals

with the VNC1Ls UART interface.

Page No. 19

Page 20: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

3). 3.3v LDO Regulator

VNC1L requires a 3.3v supply which is provided by a 3.3v LDO regulator, and has

5v tolerant IO pins which enable it to connect to the PIC without using level shifters.

Input to this regulator is supplied through 9V battery.

4). Twin USB Port

On PCB there are two Receptacle Shells which are inlet for the USB Drives. USB

drives can be inserted through these receptacle ports. It has inbuilt four wired combination

which can be mounted on the PCB. The shell is being grounded with net GND.

Page No. 20

Page 21: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

7applications

Page No. 21

Page 22: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Applications

This type of a device can be useful in the day to day life of the common computer

user. Hen a person uses a USB Flash Disk to store his data, there come situations when he

has to transfer this data from one Flash Disk to another very frequently.

A device like this can come very handy at such times. Further applications include:

Quick and easy access to device

Easy to carry

Low power consumption

Easy to use

Plug and go functionality

Used wherever USB data has to be transferred

Page No. 22

Page 23: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

8Work plan

Page No. 23

Page 24: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Phases for this semester

Sr.

No.Dates Phase

1. July 2nd week

Searching the information about

latest technologies & projects

based on it.

2. July 3rd weekDiscussing with teachers &

Finalizing the project

3. Aug 1st weekStudy of the required components

and software i.e. Feasibility study

4. Aug 2nd weekDetailed study of the Project

including USB Protocol

5. Aug 3rd week Surveyed FTDI sites

6. Sep 1st weekSearching of USB Host Controller

IC

7. Sep 2nd weekSearching of stack for host

controller

8. Sep 3rd week Selection of PIC Microcontroller

9. Sep 4th week Searching for USB Device Driver

10. Oct 1st week Firmware & Linux Device Driver

11. Oct 2nd week Designing of circuit schematic

12. Oct 4th week Documentation

Page No. 24

Page 25: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Phases for next semester

Sr.No

.Dates Phases

1. Dec 4th week PCB Designing

2. Jan 2nd week Fabrication of PCB

3. Jan 3rd week Mounting of Component & Testing

4. Jan 4th week Firmware Designing & Coding

5. Feb 4th week Firmware Testing

6. Mar 2nd weekTesting of Unit with Human

Interface

7. Mar 4th week Final assembly & Casing

8. Apr 1st week Presentation & Documentation

Page No. 25

Page 26: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

9References

Page No. 26

Page 27: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Books Referred:

USB COMPLETE By “JAN AXELSON”

- Penram Publications

LINUX DEVICE DRIVER By “CORBET & RUBINI”

- O’Reilly Publications

Websites Visited:

www.usb.org

www.ftdichip.com

Document Reference No.: FT_000006

Vinculum Firmware User Manual Version 2.05

VNC1L Datasheet Version 0.95

Document Reference No.: FT_000159

Migrating Vinculum Designs From VNC1L to VNC2-48L1A

Application Note AN_118 , Version 1.2

VDAP - Vinculum VNC1L Disk and Peripheral Interface Firmware

Datasheet Version 1.07

www.everythingusb.com

http://en.wikipedia.org/wiki/Universal_Serial_Bus#cite_note-0

http://www.microchip.com/stellent/idcplg?

IdcService=SS_GET_PAGE&nodeId=2896

Refrences:

[1]. A Technical introduction to USB 2.0, www.usb.org- white papers

[2]. USB Complete by Jan Axelson, 3rd Edition, Page No. 5

[3]. FT_000138, Vinculum-II Embeded Dual USB Host Controller IC Datasheet

Version - 1.1

[4]. Linux Device Drivers, USB Drivers, Page No. 327

Page No. 27

Page 28: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

[5]. USB Complete by J. Axelson, 2nd Edition, Chapter 2

Page No. 28

Page 29: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

10

Demonstration strategy

Page No. 29

Page 30: USB Proj Report

Standalone USB Flash to USB Flash Data Transfer

Demonstration Strategy

Designing of a fully functional device with two USB Ports.

Support for only those Flash Disks that have been formatted with FAT 32 File

System

Limiting of size of disks to upto 4GB.

Support for Graphical Display to be provided.

Function to copy entire Flash Disk (Memory Mapping).

Function to read both Flash disks one by one and let user select which data to be

copied via keypad.

The final unit will contain a small PCB with all Surface mounted packages, a

graphical/ dot matrix display, a keypad, battery in small casing.

Page No. 30