Example: barber

USB HOST CONTROLLER FOR A …

USB host CONTROLLER FOR A MICROCONTROLLER FOR USE IN ECE 4760 A Design Project Report Presented to the School of Electrical and Computer Engineering of Cornell University in Partial Fulfillment of the Requirements for the Degree of Master of Engineering, Electrical and Computer Engineering Submitted by Young Hwa Kim MEng Field Advisor: Dr. Bruce Land Degree Date: January 2013 1 Abstract Master of Engineering Program School of Electrical and Computer Engineering Cornell University Design Project Report Project Title: USB host CONTROLLER for a Microcontroller for Use in ECE 4760 Author: Young Hwa Kim Abstract: Using a microcontroller as a USB host device instead of as a USB peripheral device can be very helpful for students in ECE 4760 (Digital Systems Design Using microcontrollers ) to attach a USB mouse, a USB keyboard or a USB memory stick.

USB HOST CONTROLLER FOR A MICROCONTROLLER FOR USE IN ... implemented on AVR Mega32 microcontrollers ... to design various digital systems using Atmel AVR

Tags:

  Controller, Host, Metal, Microcontrollers, Atmel avr, Host controller for a, Host controller for a microcontroller for

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of USB HOST CONTROLLER FOR A …

1 USB host CONTROLLER FOR A MICROCONTROLLER FOR USE IN ECE 4760 A Design Project Report Presented to the School of Electrical and Computer Engineering of Cornell University in Partial Fulfillment of the Requirements for the Degree of Master of Engineering, Electrical and Computer Engineering Submitted by Young Hwa Kim MEng Field Advisor: Dr. Bruce Land Degree Date: January 2013 1 Abstract Master of Engineering Program School of Electrical and Computer Engineering Cornell University Design Project Report Project Title: USB host CONTROLLER for a Microcontroller for Use in ECE 4760 Author: Young Hwa Kim Abstract: Using a microcontroller as a USB host device instead of as a USB peripheral device can be very helpful for students in ECE 4760 (Digital Systems Design Using microcontrollers ) to attach a USB mouse, a USB keyboard or a USB memory stick.

2 Although a full software version of a USB host has been previously implemented on AVR Mega32 microcontrollers as a final project for ECE 4760 by students, the fact that it heavily loads the microcontroller forces us to look for an alternative solution, in other words, a hardware implementation. For example, dedicated host chips such as VNC1L and MAX3421 provide high-speed interface to unload the microcontroller. I implemented a useable USB host interface to Mega1284 using a chip (VNC1L on VDIP1 module) that unloads the microcontroller. The final product includes the libraries that consist of APIs that a host uses to communicate with HID (human interface device) and mass storage class peripheral devices.

3 The hardware implementation can be used by students in ECE 4760 to run a mouse, a keyboard and a memory stick. This will allow students to easily attach peripherals such as a mouse to their final project without having to use a host computer. 2 Executive Summary This USB host CONTROLLER for a Microcontroller project was proposed and is created specifically for the use in ECE 4760 class. The project is designed to create a useable USB host interface to Mega1284 using a dedicated chip, VNC1L, on its development module, VDIP1. Compared to a similar previous project the solution of which takes an approach in software, this project is done in hardware to unload the microcontroller.

4 The first and direct beneficiaries of the final product of this project would be the students in ECE 4760 who are expected to design a creative and somewhat complicated final project. The final product includes the libraries that consist of APIs that an MCU host simply calls to communicate with HID (human interface device) and mass storage class peripheral devices. What enables the mega1284 to be a USB host is the VNC1L chip that is pre-programed with its firmware. The serial communication part of this project between two chips was implemented both in SPI and USART to give students options to choose.

5 All the tasks that are related to USB protocols are performed by the mediator, VNC1L, instead of mega1284. To send data to a slave USB device and to receive data from it, the MCU host simply makes appropriate API calls and communicates with the device through the command monitor interface of the VNC1L. The bulk of this project is getting familiar with the firmware, its monitor commands and their operations. Mainly three libraries were created for three different types of popular USB devices: a flash drive, a keyboard and a mouse. Also each library was implemented twice: one with SPI and the other with USART interface.

6 Each library comes with unique APIs in a file where the appropriate firmware commands are sent to the monitor to control the actions of a device and the response data from a device is parsed to determine the status of events that happened within the device. With a VNC1L, a USB flash drive can be used for a microcontroller project to provide additional memory and eliminate the limit of memory resources available to an MCU. A data logging program could well utilize a USB drive to save enormous amount of data. A USB keyboard as a user input device can provide many more options than a pushbutton or a keypad with only a few keys available on it.

7 A USB mouse can be a perfect choice as an input and control device for game projects or draw-and-paint projects. Without the broad knowledge in the much complicated USB protocols, students in ECE 4760 will be able to easily include a USB peripheral device of their choice for their final projects, which is expected to help them expand the scope of their projects and give them more freedom to realize their creative design concepts. 3 Table of Contents Abstract .. 1 Executive Summary .. 2 Table of Contents .. 3 Introduction .. 4 Issues to be addressed .. 4 Preliminary Research .. 5 Proposal for Development.

8 7 USB Protocol Basics .. 7 USB Transfers .. 7 Enumeration .. 8 HID Report .. 8 Vinculum VNC1L Embedded USB host CONTROLLER IC .. 9 Hardware: VDIP1 module .. 9 Software: VDAP Firmware version .. 11 Firmware Upgrade .. 11 Command Monitor .. 12 Essential Monitor Commands .. 14 Serial Communications .. 15 SPI .. 15 USART .. 18 USB Mass Storage Device .. 21 USB HID Device: Keyboard .. 23 USB HID Device: Mouse .. 25 Results .. 26 Conclusions .. 30 References .. 31 Appendix A: USB Device Requests .. 33 Appendix B: User s Manual .. 36 Appendix C: Code .. 37 4 Introduction ECE 4760 class teaches students how to design various digital systems using atmel avr ATmega microcontrollers such as Mega1284.

9 A prototype board that has a type-B USB connector for serial communication is loaned to students at the beginning of the class. This allows students to have the USB connection for serial communication between their running program and the PC that runs PuTTY for debugging and taking user inputs for their programs. In this configuration, the PC is a USB host and the microcontroller takes the role of a slave device. For their final projects, students in ECE 4760 class design and produce hardware and software combined systems that could require many different kinds of user interfaces. Previously students used items such as push buttons, keypads, microphones, and light detecting phototransistors.

10 Although these items worked quite well as user input devices, many students could have benefited and made their programs more flexible or sophisticated if they could use an HID class device such as a USB keyboard or a USB mouse as a user input device. Also, adding a USB mass storage in a project could solve the problem of Mega1284 s limited memory resources that hinders developing a memory intensive project. From my experience as a previous student of the class, having an option to have a microcontroller as a host to control USB slave devices with a fast and easy interface can allow students to broaden the scope of the design of their final projects or come up with more creative systems.


Related search queries