USB Design Suggestion

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Design Suggestion

619 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Thu Jul 01 00:10:22 MST 2010
My question is not exactly related to LPCXpresso software platform (since I successfuly applied the USBCDC example). It is about the instability.

I know software is working because at rare rates I successfully executed my prototype. But the problem is, success is really rare. I get usually "USB device not recognized." error. Sometimes it starts to enumerate, but fails later.

Exact thing happened with also an FTDI FT232RL based design. This shows me that I know something clearly wrong and it is related to hardware.

So I need your precious suggestions about layout and schematics design.

By the way, I'm working on a hand made (etched plate) prototype. All passive measurements are OK, no shortcuts, no cut routes.

As a clue, sometimes I see the "eye" formation with USBDM and USBDP, but if it will not work, I see a low signal for about 25 ms on these signals. Than it says "USB not recognized".

Any help is appreciated. Related file is attached to this message.

P.S: Right now I'm testing it with USB Mass Storage Mode for firmware update. I'm getting same unstable results. This clearly indicates that is a non-software problem. (I succeeded to see firmware.bin  on some other PC's)
0 Kudos
15 Replies

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Wed Sep 28 04:38:04 MST 2011
Please refer to this document:

LPC17XX User Manual page 275-276.

You'll find the reference circuit you asked.


Just be careful, while drawing the D+ and D- traces, you have to have a 90 Ohm Differential Impedance for maximum performance.
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gilvanl on Wed Sep 28 04:21:30 MST 2011
Hello,

I am new to the forum (and the LPC world).

I wish to ask a question about the usb hardware:
Can i make an usb host from the LPC176x (68~69 parts),
with no extra integrated circuits, as simple as the LPC1343?
Somebody can post one schematic ?

Tanks a lot, best regards to everyone !
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Fri Jul 09 04:06:19 MST 2010
Zero, thanks for all your help... You really saved my day :)

Now I'm able to connect as MSD Bootloader or USB CDC... It is my first ARM Cortex product :) I'm glad to have this community...
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jul 09 02:48:49 MST 2010
:eek: Remove C9 !!!! It's pulling low PIO0_1 for nearly a half millisecond !
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Fri Jul 09 00:49:52 MST 2010
Hi,


Quote:
Use something like

arm-none-eabi-size ${BuildArtifactFileName};arm-none-eabi-objcopy -O  binary ${BuildArtifactFileName}  ${BuildArtifactFileBaseName}.bin;checksum  ${BuildArtifactFileBaseName}.bin;

in

Properties / C C++ Build / Settings / Buid-Steps / Post build Steps

to generate a valid bin-file.

I've that post build process, including an additional hex file output.


Quote:
Start Bootloader, delete old 'firmware.bin', copy new 'xx.bin'. Now you  should see the new file with new date and size. If you start Bootloader  again, you will see again an old 'firmware.bin' with old date and 32k  size. The new file isn't shown! So you can only control the correct  copying of the file just after it is copied. If the new file isn't shown  then, copying wasn't successful.

I can see my new *.bin file after copying. File properties dialog shows the correct values.


Quote:
Check (if you haven't yet) your PIO0_1 and it's Pullup.

Already checked. It is pulled down for Bootloader mode, pulled up in USBCDC mode. (never floating)


Quote:
If USBCDC is working, your Windows Device Manager should show something  like 'LPC134x USB VCom Port (COMXX)'.

I've seen the successful operation before. (remember, I said that the first circuit was working, but rarely)

Quote:

Use 3 wires to connect SWD to LPCXpresso, so you can program/debug and  see what's going on.

Forgot to add debug connector, I think because of 2000 km driving :). I'll try to add them manually.


Quote:
Your attached files show your 'old' board again

The attachment is not the old board, I didn't add the layout (thought it's not necessary). You can see the BSS84 USB_SOFTCONNECT USBVBUS etc.


I checked the usbcdc.bin after deleting firmware.bin via copying the file from the CRP_DISABLD disk. The files match, means that bin file is successfully copied to LPC1343's flash.

The key question is, will the LPC1343 enter to bootloader mode if no valid executable data found in it's flash, even the P0.1 pulled high?

If it's so, that means I'm able to write it's flash but the bin file is not valid, despite I'm using the checksum post process.

In any case I have to see it via debug wires as you suggested.

***********
After a simple test
***********

I tried a simple test after writing the message above. Created blinky.bin from the simple LPCXpresso1343_blinky project. Copied to LPC1343. But after that I didn't connect to USB, instead I powered up the circuit via an external 5V power supply. And voila, my test led was blinking.

So, the main problem is, "why LPC1343 is booting in loader mode, even the P0.1 pulled up?" (As mentioned above, it is never floating, pulled down or up). Are there any additional constrains like USB_VBUS input?

Thanks for help.
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jul 08 11:42:58 MST 2010
1. Use something like

arm-none-eabi-size ${BuildArtifactFileName};arm-none-eabi-objcopy -O binary ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin;checksum ${BuildArtifactFileBaseName}.bin;

in

Properties / C C++ Build / Settings / Buid-Steps / Post build Steps

to generate a valid bin-file.

2. Start Bootloader, delete old 'firmware.bin', copy new 'xx.bin'. Now you should see the new file with new date and size. If you start Bootloader again, you will see again an old 'firmware.bin' with old date and 32k size. The new file isn't shown! So you can only control the correct copying of the file just after it is copied. If the new file isn't shown then, copying wasn't successful.

3. Check (if you haven't yet) your PIO0_1 and it's Pullup.

4. If USBCDC is working, your Windows Device Manager should show something like 'LPC134x USB VCom Port (COMXX)'.

5. Use 3 wires to connect SWD to LPCXpresso, so you can program/debug and see what's going on.

6. Your attached files show your 'old' board again :confused:
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Thu Jul 08 08:35:04 MST 2010
Zero, with your valuable helps I've managed to build a proper LPC1343 USB circuit. It works fine as default MSD Bootloader Mode.

But now, I'm deleting the firmware.bin, copying the usbcdc.bin file (waiting enough time for the transfer) and safely removing hardware. I know this should update the flash with new firmware. I'm disconnecting P0.1 from the ground and pull it up via removing the jumper and reconnect to the USB port. It still recognizes the device as Mass Storage and shows me the firmware.bin (created at 06.02.2010 10:10).

I thought that it might be related with VID/PID and tried on a never connected PC with P0.1 pulled up. It recognized as MSD again.

What could be the problem? Am I not able to upload the new firmware, and because of the empty flash LPC1343 runs in bootloader mode?

Thanks again.

P.S: I'm using "checksum ${BuildArtifactFileBaseName}.bin;" line for a correct checksum in the bin file.

(New circuit attached)
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jul 02 17:00:40 MST 2010
Just cut out USB part of LPC1343 schematic & board:

Schematic:

http://www.flickr.com/photos/58892165@N08/5406160762/


Board:

http://www.flickr.com/photos/58892165@N08/5406160872/

BTW: An additional connector with SWCLK (Pin 29) , SWDIO (Pin 39) and GND can connect your board to LPCXpresso.
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jul 02 05:16:47 MST 2010
When I'm back in the office (late at night) I'll cut out a part of my working LPC1768 layout to give you an example.

But meanwhile you could buy a few FR4 (material) boards.

Your layout is looking good.
If you are trying to etch a single sided PCB, you should always fill all unused areas with a ground plane.
If you are still suspicious after integrating USB parts, post your layout again.
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Fri Jul 02 03:35:14 MST 2010
Could you also send me your PCBlayout if it's OK? I'm suspicious about my layout.

If it is a part of a bigger project you don't have to send all of the PCB design, I just want to see the USB side.

Also do I really need a GND plane? Or my layout should work? If that is the situation, I'll buy new set of raw FR-4 boards, maybe it is the copper, or the insulation material, I don't know.

Thanks for your help Zero.
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jul 02 02:49:48 MST 2010
You just need a jumper to ground PIO0_1 ( Pin 4) to start ISP after Reset. Everything else is done by Hardware.
Sounds incredible easy but is really working!
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Fri Jul 02 01:04:41 MST 2010
I have a question here. I already implemented your design with respect to differential routes. But something came on mind.

I want to upload my new firmware via USB so there will be no Firmware that will adjust USB_SOFTCONNECT feature of GPIO0_6. LPC1343 supports only FullSpeed mode. And there will be no pull-up.

I think I have to put at least a jumper for firmware update. Or does the internal MSC driver for firmware take care of the USB_SOFTCONNECT feature?
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Thu Jul 01 06:45:48 MST 2010
Thanks Zero, I'll give it a try and inform your from here about the results. But it may take some time, since I'll have a trip for a few days.
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jul 01 06:22:31 MST 2010
Just found my schematic...

[ATTACH]123[/ATTACH]
0 Kudos

584 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jul 01 05:38:06 MST 2010
My suggestion: Change your hardware.

1. Use SoftConnect.

You can use a simple FET like BSS84 to switch your 1.5 kOhm resistor.

Connect Gate to PIO0_6/USB_CONNECT, Source to 3.3V and Drain to 1.5 kOhm.

Switch PIO0_6 to USB_CONNECT with something like
 
 LPC_IOCON->PIO0_6   &= ~0x07;
 LPC_IOCON->PIO0_6   |= 0x01;  /* Secondary function SoftConn */ 


2. Use VBUS

Disconnect R7 from VCC and connect it to VBUS(5V) of USB-connector J1.

Switch PIO0_3 to VBUS with something like
 
 LPC_IOCON->PIO0_3   &= ~0x1F;
 LPC_IOCON->PIO0_3   |= 0x01;  /* Secondary function VBUS */


Don't know if that's solving your problem, but this is a reliable USB design.
0 Kudos