Jump to content
rampadc

USB won't work unless PCB connected to debugger

Recommended Posts

Hey guys, what does it mean when a PCB stops working when it's removed from the debugger? GND's connect fine, voltages checks out. The debugger doesn't even have to be connected to the computer: as soon as I connect the PCB to the debugger, the device starts enumerating.

Share this post


Link to post
Share on other sites

MSP430F5/6 USB devices have internal pullup resistor on RESET pin, so external resistor can increase pullup strength, but it is not needed, and my USB boards don't have them.

 

What micro is used, FET VCC level, board VCC level? What if you just connect VCC/GND from FET to board without JTAG lines?

Share this post


Link to post
Share on other sites

Hey Jazz, I'm using MSP430F5510, FET VCC level is +3.3V, board VCC is 5V (from USB, then MSP430 do the conversion in-chip). Connecting just the VCC and GND from FET to board without JTAG lines got the board working. What does it mean?

Share this post


Link to post
Share on other sites

Hey Jazz, I'm using MSP430F5510, FET VCC level is +3.3V, board VCC is 5V (from USB, then MSP430 do the conversion in-chip). Connecting just the VCC and GND from FET to board without JTAG lines got the board working. What does it mean?

 

If you are using bus powered device, that use 5V from USB when device is connected to PC, than there is some problem in connection from internal 3.3V reg out (VUSB) to DVCC/AVCC lines. Maybe board need too much power (current limitation of internal 3.3V reg).

 

You mention enumeration, so problem also can be in USB program source, or related to PUR pin. To clarify things, see what is going on with simple P1.0 blinking example, and after this with USB BSL firmware upgrade example, prepared by TI.

Share this post


Link to post
Share on other sites

Blinking example works fine. I have never used BSL before so I'm not sure if it works with the PCB layout I'm using (like extra resistors, caps or buttons, etc.)

 

It's maybe USB program source related. In a keyboard-only project, the USB is enumerated and the LED blinks (without connecting to debugger). In another keyboard and mouse project, same blinking code, USB will not enumerate and LED won't blink. Would that be a bug in TI's API?

case ST_ENUM_ACTIVE:
	P4DIR |= BIT7 + BIT6 + BIT4;
	P4OUT &= ~BIT6; //GND
	P4OUT |= BIT7; //CLOCK = VCC

	while(1) {
		P4OUT ^= (BIT7 + BIT6 + BIT4);
		__delay_cycles(100000);
	}

On a unrelated note, what's your take on DriverLib's performance? I turned a pin on and off, placing a function with lots of calls to DriverLib's GPIO in between, and used a logic analyzer to measure the time it takes for the function to run. I expected the function to finish a lot quicker at 25MHz than 4MHz but surprisingly, it took the same amount of time for the function to run, regardless of clock frequency.

Share this post


Link to post
Share on other sites

what usb are you using, is it the software bitbang USB code we wrote here or some hardware solution.

 

how is your pcb laid out what pins of the debugger are you hooking up to, just the test reset lines, or all 6 (tst, rst, vcc, gnd, txd, rxd).  does the chip "run" without the debugger and the usb just doesn't enumerate, or does it not run at all?

 

many questions, need answers :)

 

[edit] hehe and I posted that before reading the rest of the thread, but several are still valid questions [/edit]

 

I know bbusb is sensitive to the clock frequency playing nice, maybe the debugger is messing with or correcting your crystal frequency?

 

if one usb type will enumerate, but another wont then your device , config, and interface descriptors may be malformed for the combo keyboard / mouse.  it is ultra picky on getting those right

Share this post


Link to post
Share on other sites

Blinking example works fine. I have never used BSL before so I'm not sure if it works with the PCB layout I'm using (like extra resistors, caps or buttons, etc.)

 

If P1.0 blinking example is working fine, when your board is connected to PC by USB, and internal 3.3V REG is used, than everything is OK with board regarding supply.

 

BSL should work OK. For trying there is no need for extra hardware. Just do mass erase over JTAG/SBW with FET, disconnect FET, and plug you board to PC. It will enter to USB BSL mode automatically.

 

It's maybe USB program source related. In a keyboard-only project, the USB is enumerated and the LED blinks (without connecting to debugger). In another keyboard and mouse project, same blinking code, USB will not enumerate and LED won't blink. Would that be a bug in TI's API?
 
Internal 3.3V REG is able to supply few extra mA. So if your keyboard-only project working OK, and keyboard-mouse project only connected to FET, maybe keyboard-mouse need more mA. Simple measure current with device connected to FET, running keyboard-only / keyboard-mouse to see mA ratio.

Share this post


Link to post
Share on other sites

I can't measure the current for some reason, as soon as a resistor is connected in between or put the multimeter in the middle of the circuit directly, USB stops working for a few minutes - may have shorted something. 

 

So I used an external +3.3V supply (from an Arduino) and USB won't work still. Connecting VCC and GND from FET to PCB no longer solve the problem, it won't enumerate.

 

The problem is still the same, USB won't enumerate for KB+Mouse unless board is connected to FET, and FET doesn't have to be connected to computer. I then load TI's HID Mouse example onto the board and the problem arises, USB won't enumerate. So the problem now is that my board will not enumerate if it has HID Mouse unless it's connected to an unpowered FET. TI's HID Mouse example works fine with MSP430F5529LP but then the chip is connected to TI's debugger anyway.

 

I included the schematic of my board. A component is removed because the pinout is proprietary. VCC is +3.3V.

post-32777-0-54873500-1394706346_thumb.png

Share this post


Link to post
Share on other sites

A few thoughts/ideas to corner the cause:

  • Make sure that there's only one power source at a time. Either USB, or FET, or Arduino. Otherwise it's hard to tell what's going on.
  • But keep GND connected to the FET as long as there's any other connection to the FET.
  • Does the reset line (PWR on your schematic) go somewhere on the hidden device? If so, where?
  • According to the MSP430F550x datasheet the internal LDO delivers 10mA max. Depending on the clock, the MCU itself can draw up to 6mA. Did you check the power budget of the rest of your circuit? If it's above 4mA, VCC might drop and cause a reset.
  • Did you check whether the MCU runs even when enumerating USB fails? E.g. by wiggling a pin, blinking a LED?

Share this post


Link to post
Share on other sites

PS: To my first point, not powering from FET/Arduino = physically disconnect the wire that connects +3.3V to the FET/Arduino.

PS2: I'm not sure if that diode on VBUS is a good idea. It will drop the USB voltage to 4.5V before it reaches the MSP430. Probably not an issue, datasheet says VBUS needs to be between 3.76 and 5.5V.

Share this post


Link to post
Share on other sites

I included the schematic of my board. A component is removed because the pinout is proprietary. VCC is +3.3V.

 

On schematic USB part is OK, but I don't see any cap on +3.3V line?

Share this post


Link to post
Share on other sites

 

A few thoughts/ideas to corner the cause:

  • Make sure that there's only one power source at a time. Either USB, or FET, or Arduino. Otherwise it's hard to tell what's going on.
  • But keep GND connected to the FET as long as there's any other connection to the FET.
  • Does the reset line (PWR on your schematic) go somewhere on the hidden device? If so, where?
  • According to the MSP430F550x datasheet the internal LDO delivers 10mA max. Depending on the clock, the MCU itself can draw up to 6mA. Did you check the power budget of the rest of your circuit? If it's above 4mA, VCC might drop and cause a reset.
  • Did you check whether the MCU runs even when enumerating USB fails? E.g. by wiggling a pin, blinking a LED?

PS: To my first point, not powering from FET/Arduino = physically disconnect the wire that connects +3.3V to the FET/Arduino.

 

The reset line (PWR) is connected to a button using R7 as pull-up resistor. The TrackPoint connected to the MSP430 uses 5V, 7mA. I connect it straight to VBUS so it shouldn't pull any juice from the MSP430. The only thing the MSP430 driving are the 2 N-MOSFET's (BSS138) +3.3V line.

 

On schematic USB part is OK, but I don't see any cap on +3.3V line?

Besides changing to using BSS138, I started putting in caps. So right now, the caps are desoldered to see if it's causing the problem. I didn't include them in that schematic because it's desoldered. Here's the full schematic.

 

The 'round' VCC is 5V. Pointy VCC is always +3.3V.

post-32777-0-32017900-1394730061_thumb.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...