This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB Self-Powered Device Setup

Other Parts Discussed in Thread: MSP430F5638, TPD4E004

Hello, I'm trying to set up my MSP430F5638 to be a self-powered USB slave device.

The documentation looks clear, but I'm not seeing enumeration happening.


USBPWRCTRL is: 

SLDOEN = 1
VUSBEN = 1
VBOFFIE = 1
VBONIE = 1
VUOVLIE = 0
SLDOAON = 0
OVLAOFF = 0
USBDETEN = 1
USBBGVBV = 1
VVOFFIFG = 0
VBONIFGF = 0
VUPVIFG = 0

For USBCNF it's 0x01.

I'm using the MSP430 Driverlib to call USB_setup(TRUE, TRUE) and it returns success, the I call USB_enable() a few lines later.

In theory this should work, right?  But I plug in a cable (known good) and I see no enumeration.  The USB CDC driers ARE installed on Windows.

Any idea what the issue could be?

Ed Averill

  • There are lots of things that could make the enumeration fail.
    Are you able to get one of the USB examples (e.g., the mouse HID demo) running?
  • The thing that bugs me is the code WORKED on MSP430 LQFP proto board from TI, but on this hardware I don't see anything happen.. BUT.. the hardware guy changed from the TI USB design to something else..

    Let me try to fire up the CDC example and blow it into the board.. good suggestion! LEt's see what happens...
  • I just tried theCDC EchoToHost and even though the cable is plugged in, the host doesn't see it and the device thinks it hasn't enumerated yet.

    Is the fact that our device is supposed to be self-powered messing things up somehow? I have no idea WHY the hardware guy changed things, he's out due to complications from back surgery and can't be reached... I see VBUSEN = 1 on the example, should that be ON for a self-powered device?

    Sorry to be a pest, it's frustrating working this without hardware support.. your help is VERY appreciated..
  • You mean VUSBEN? Is there anything connected to the VUSB pin?
  • Yep, meant VUSBEN, sorry. Low on coffee error.

    VUSB appears to go two places.. one side goes through a capacitor to ground.. the other side goes through a switch, I think that was to let us invoke the bootloader for in-field upgrades.. the other side of the switch goes to PUR.

    I need to back and get a EE at this rate, 30 years of software development hasn't prepped me for debugging circuit design.. lol..
  • When VUSBEN is cleared, power must come in from the VUSB pin to power the USB PLL and PHY. As far as I can tell from your description, this hardware requires VUSBEN=1. (I guess "self-powered" means that it has its own 5V supply.)

    Are there any other USB-related hardware changes?

  • I'll have to go over thematic - let me get lunch down and I'll dive into it. Thanks again!
  • A few things - I fired up the example on the old proto board and it works fine there, so at least I'm sure it's not my host machine or a bad example.

    I don't see anything *obvious* in the setup that should prevent the example working on our board.. but it doesn't. Now, we DO have an oscillator on XT2, I believe the stock MSP-TS430PZ100USB is unpopulated for XT2.. not sure if that might make a difference. I think if I can determine why the sample doesn't run on our board, everything will fall into place.. and it's easier to debug with the sample than the multi-threaded mess our application is. Again, great suggestion!

    Let me see if I can chase things down.. wish me luck.. I'm developing a massive hedache..
  • Ok, hang on.. if this device is supposed to be self-powered, I'd expect to see 5V somehow channeled into VBUS, is this correct? I see on the MSP-TS430PZ100USB board that the VBUS has a tap into an TPD4E004.. is that to feed that chip with 5V?

    I wonder if TI has a reference design for a USB feed into the MSP430F5638...
  • Hello,

    You might want to verify that your descriptor.h file is showing the correct value for USB_SUPPORT_SELF_POWERED parameter.  The value should be 0xc0.  If you used the Descriptor tool to create your .inf file and selected the power to be self powered, then the value for USB_SUPPORT_SELF_POWERED should be set to 0xc0. 

    If your interface is CDC, then you will also need the .inf file created for the PID/VID you are using.

    Hope that helps.

    Regards,

    Arthi Bhat

     

  • Ed:

    I think the TI board uses 4 MHz for XT2 - are you still using 24 MHz for XT2 on your board?

    Is that difference accounted for? (probably in CDC-generated .inf file...???)

     

  • USB does not work without XT2.

    The XT2 frequency must be set correctly in the files generated by the Descriptor Tool (but this does not include the .inf file).

    If you are not using the Descriptor Tool, you have to adjust these settings manually.

  • Ok, the plot thickens.. I put a breakpoint in the USB interrupt handler, and the ONLY interrupt I ever see is VBUS coming ON. No endpoint interrupts, nothing. If it's not sending me anything no wonder there's no enumeration...!

    At this point I' REALLY suspecting a design or board construction issue. IIRC there's some PHY-level electrical negotiation prior to actual communication, so I think I should probe D+ and D- and see if anything is happening on those lines.

    We're hiring a temp H/W guy while the perm one is out sick, hopefully he can get me going.

    I did use the descriptor tool to make a new one, and folded that into our code., but obviously it never gets that far...

**Attention** This is a public forum