• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » USB Dual Mode Operation
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • USB Dual Mode Operation

    USB Dual Mode Operation

    This question is answered
    Bill Lyons
    Posted by Bill Lyons
    on May 01 2012 08:41 AM
    Prodigy110 points

    We are trying to implement a Dual Mode USB interface on a custom Stellaris LM3S9D90 board.  The problem I am having presently is determining when a connection is made and whether the connection is to a host or device.Is there a particular interrupt or interrupt status that I need to look for?

    We are using the same USB circuitry as is found on the ek-lm3s9d90 eval board, except that we are using a 4-pin A type USB Connector. The USB0ID pin is left floating.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • David Racine
      Posted by David Racine
      on May 02 2012 14:32 PM
      Expert5270 points

      Bill,

      It sounds like what you are looking for is USB OTG(On The Go). However, this requires a Micro-USB AB connector with the USB0ID pin. It is through this pin where the type of connection is determined. An A type connection is dedicated to the host side only.

      Take a look at this link which gives a good description of the different connector types:

      http://www.cablestogo.com/resources/usb.asp

      Once you have the proper connector for OTG, we have examples specifically for OTG detection:

      "<StellarisWare install directory>\boards\dk-lm3s9d96\otg_detect"


      You can use this example as a jumping off point for your application.

      -Dave


      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bill Lyons
      Posted by Bill Lyons
      on May 03 2012 08:24 AM
      Prodigy110 points

      Thanks for the response. Unfortunately we have an industrial application that requires the 4 pin connector that allows a thumb drive to be inserted without an adapter. In addition we also need to connect a PC for serial comm (CDC) with our board as device. I've gotten both of these working separately using the Stellarisware demo projects, but I have to toggle the ID pin for either host or device operation. So what I really need is to be able to tell at connect time whether the connection is being made by a host or device without relying on the ID pin. We can modify the support circuitry if necessary, but the 4 pin connector is a hard and fast requirement.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • marc_rir
      Posted by marc_rir
      on May 03 2012 15:12 PM
      Intellectual885 points

      Can’t you check for VBus?

      If you have 5V on the VBus connection, then go in device mode, else in host mode.

      It’s not USB compliant, but it should work.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bill Lyons
      Posted by Bill Lyons
      on May 04 2012 14:17 PM
      Prodigy110 points

      I'm not sure that that would work. I'm thinking of attaching empty cable and then attaching a host, But I will definitely see what I can do in that direction.

      Meanwhile, the USB standard says we should be using ADP (Attach Detection Protocol). Does any one know if this is implemented on the Stellaris chips? I don't see anything in the data sheet about it.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bill Lyons
      Posted by Bill Lyons
      on May 14 2012 13:06 PM
      Prodigy110 points

      Ok. We decided to go with a switch on the board that the user could flip to put the board in either host or device mode. The switch is hooked to the id pin on the chip.

      Now on to the next problem, which is how to implement a CDC host. I will do a separate post on that subject.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Rob Maris
      Posted by Rob Maris
      on Jun 05 2012 12:22 PM
      Verified Answer
      Verified by Bill Lyons
      Intellectual985 points

      Well, I have successfully implemented a dual mode scheme with separate Type B and Type A connectors while having a default device mode scheme. When a device is inserted into the type A connector, its Vbus is forwarded to USB0VBUS via a PNP voltage follower.  The USB0VBUS is also connected to the /OE of an USB switch FSUSB31 device, that effectively decouples the type B connector, to avoid messy situations. The VBUS level is polled by software and its change calls an appropriate device init or a host init function.

      Alas, dual mode is not well accompanied by TI example code. I got it working with 6852 build usblib, but no longer with 8049 & 8555 builds.

      dual mode
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bill Lyons
      Posted by Bill Lyons
      on Jun 05 2012 12:43 PM
      Prodigy110 points

      Sounds good. Would it be possible to post a drawing or sketch of the circuit?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Rob Maris
      Posted by Rob Maris
      on Jun 05 2012 13:03 PM
      Intellectual985 points

      The part of the circuit that makes USB looks like this:

      Nothing is perfect: this circuit not, too. The FPF2108 power switch virtually has no current limit at the very moment of enabling the output. In operation, a current limit is present, but this phenomenon yields sudden system voltage drop, which I worked around by adding a sort of software PWM enable signal during the first 30 ms...

      Note: R71 and D23 are not placed (the pull-up stuff is embedded into the controller)

      dual mode
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use