LPCXpresso 1769 USB VCOM or CDC (example)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPCXpresso 1769 USB VCOM or CDC (example)

4,955件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cell85 on Sat Mar 03 11:17:47 MST 2012
Hi,

I want to use the LPCXpresso 1769 USB Port as a Virtual Com Interface (VCOM).
I allready soldered the USB mini Port with 330Ohm Resistors on the Pin's of the 1769. (D- / D+, VinExt, GND)

At the moment I'm using UART2 with 115Kbaud to transmit Data to my PC via a Sparkfun USB-2-Serial Bridge (FTDI).

Do you guys have an working project or an example (I didnt find any) to use the LPCXpresso USB as a VCOM Device?

Thank you!

WR
Sam
32 返答(返信)

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetii on Mon Dec 15 06:24:23 MST 2014
HI

I found one more issue with lpcxpresso board and example called: usbd_lib_cdc_uart

in file cdc_uart.c we can find on usbd_lib_cdc_uart(): /* Pin-muxing done in board init. */
This is true but lpcxpresso board use UART3 for debug purpose and this example define SELECTED_UART to LPC_UART0.

It means that our uart is not fully initialized.
Moreover in datasheet of LPCXpressoLPC1769revB.pdf there are no information where uart0 is exposed.

In fact uart0 is on ports p0.2 (TXD0) and p0.3(RXD0).

At the end of the day to have this example working we need add for eg in main.c such code:
    //After Board_Init(); in main.c
    //Settings for usb port
    Chip_IOCON_PinMux(LPC_IOCON, 2, 9,  IOCON_MODE_INACT, IOCON_FUNC0);
    Chip_GPIO_SetPinDIROutput(LPC_GPIO,2,9);
    Chip_GPIO_SetPinOutLow(LPC_GPIO,2,9);//Pull up usb port as a slave.
    //Settings for uart0
    Chip_IOCON_PinMux(LPC_IOCON, 0, 2,  IOCON_MODE_INACT, IOCON_FUNC1);
    Chip_GPIO_SetPinDIROutput(LPC_GPIO,0,2);//TXD0

    Chip_IOCON_PinMux(LPC_IOCON, 0, 3,  IOCON_MODE_INACT, IOCON_FUNC1);
    Chip_GPIO_SetPinDIRInput(LPC_GPIO,0,3);//RXD0
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetii on Mon Sep 29 17:19:30 MST 2014
HI there.

I have LpcXpresso board with LPC1769 mcu, Rev C.

Acording to the datasheet I connect PC(usb) to pin J6-36, J6-37.
For example i upload usbd_lib_cdc_uart project from lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769.zip

After that i don`t see (under dmesg) that my pc try enumerate my board. Nothing changes...

After digging I notice that I don`t see that port p2.9 is set as output and pullup D+ line.

So in: void Board_USBD_Init(uint32_t port){} of board.c file I add:

Chip_IOCON_PinMux(LPC_IOCON, 2, 9, IOCON_MODE_INACT, IOCON_FUNC0);
Chip_GPIO_WriteDirBit(LPC_GPIO, 2, 9, true);
Chip_GPIO_WritePortBit(LPC_GPIO, 2, 9, false);

After that dmesg show:

Sep 30 02:13:22 LG kernel: [124726.373152] usb 3-3: new full-speed USB device number 64 using xhci_hcd
Sep 30 02:13:22 LG kernel: [124726.390340] usb 3-3: New USB device found, idVendor=1fc9, idProduct=0083
Sep 30 02:13:22 LG kernel: [124726.390346] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 30 02:13:22 LG kernel: [124726.390349] usb 3-3: Product: VCOM Port
Sep 30 02:13:22 LG kernel: [124726.390351] usb 3-3: Manufacturer: NXP
Sep 30 02:13:22 LG kernel: [124726.390353] usb 3-3: SerialNumber: NXP-77
Sep 30 02:13:22 LG kernel: [124726.392073] cdc_acm 3-3:1.0: This device cannot do calls on its own. It is not a modem.
Sep 30 02:13:22 LG kernel: [124726.392119] cdc_acm 3-3:1.0: ttyACM0: USB ACM device
Sep 30 02:13:22 LG mtp-probe: checking bus 3, device 64: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
Sep 30 02:13:22 LG mtp-probe: bus: 3, device: 64 was not an MTP device
Sep 30 02:13:38 LG ModemManager[777]: <info>  Creating modem with plugin 'Generic' and '1' ports
Sep 30 02:13:38 LG ModemManager[777]: <warn>  Could not grab port (tty/ttyACM0): 'Cannot add port 'tty/ttyACM0', unhandled serial type'
Sep 30 02:13:38 LG ModemManager[777]: <warn>  Couldn't create modem for device at '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3': Failed to find primary AT port

Regards.

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Mar 08 07:39:07 MST 2012

Quote: Sudee
its not found in the examples177xx zip in nxp web.:(


Try the LPC17xx/RDB1768cmsis2 examples - there are some USB examples in there - you may have to change them a bit to remove the RDB1768 dependencies but they do work (that's what I used to base my own code on).

Rob
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sudee on Thu Mar 08 05:05:07 MST 2012
Help me IF any body have LPC1769 USB code as its not found in the examples177xx zip in nxp web.:(
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cell85 on Wed Mar 07 09:11:10 MST 2012
d+ and d- was mixed up. now everything works fine!

thank you!!
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Tue Mar 06 23:59:43 MST 2012

Quote: cell85
zero i know and i connected logical as described in the manual

the +5V from usb goes to V_IN (3,3 - 5,5V)
or what did u mean ????


not 15mbit ... 1,5 mbit!!!  TYPO


You are confusing us.

Who are you asking these questions?
I'm not zero but I assume it's me you mean.

If you connected as described earlier then you got D+ and D- mixed up.
According to your earlier post: D+ = White, D_ = Green but the getting started shows D+ = Green and D- = White.

The =5V was only mentioned by Pollux.
He also referred to the schematics. Please have a look at the schematics to understand how the +5V and +3.3V are routed. Page 1 gives a nice overview showing how the +5V and 3.3V are connected.

There has been some confusion as to the 1.5k resistor. I just checked and with the LPCXpresso 1769 board you should not use any resistors (as also stated before by Zero). Unfortunately this is a bit confusing with the different LPCXpresso board and not clearly explained in the manual (but you should see this reading the schematics of your board).

I think there is nothing more I can add to this. If you still don't get the USB to work then you should either get a local engineer helping you out or hire someone to fix the problem for you.

There is no way to fix your problem that may be PC/driver, LPCXpresso software or LPCXpresso hardware related without having access to the complete setup (or at least the relevant parts).

Regards,
[INDENT]Rob
[/INDENT]
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cell85 on Tue Mar 06 17:49:17 MST 2012

Quote: Rob65
It is more likely that you connected the whole thing wrong.

Check out the "Getting Started Manual" that came with the LPCXpresso software, there is a nice picture in there describing how to connect the USB cable.

(I don't know why I did not refer to that the first time :eek:)

Rob




zero i know and i connected logical as described in the manual

the +5V from usb goes to V_IN (3,3 - 5,5V)
or what did u mean ????


not 15mbit ... 1,5 mbit!!!  TYPO
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Tue Mar 06 10:52:04 MST 2012

Quote: Zero
High speed, you're dreaming :)
:(



Point taken.
But the question is if this provides Sam (cell85) with the information he needs to get his USB connection up&running.
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Mar 06 10:19:48 MST 2012

Quote: Polux rsv
Is the LPC1769 USB controller a Full or High speed USB controller ??? :rolleyes:



High speed, you're dreaming :)

UM:

Quote:

The USB device controller on the LPC17xx enables full-speed (12 Mb/s) data exchange with a USB host controller.

:(
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Tue Mar 06 10:09:10 MST 2012
15mbit ??? ok, let say 15Mbits/s :)

Is the LPC1769 USB controller a Full or High speed USB controller ??? :rolleyes:
Full speed is 12 Mbits/s , High speed is 480Mbits/s.
How can a 12Mbits/s line reach 15Mbits/s whithout compression and protocol overhead :rolleyes::D

Angelo
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by belamy on Tue Mar 06 08:32:02 MST 2012

Quote:
       Thank you Zero :)

all things are working now. The CDC/VCom works fine, i have a bandwith of 15mbit thats awesome!!!!




Do you really got 15mbit/s speed on USBCDC example?
VCOM has 64bytes buffer and data pooling from PC is made every 1ms.

How do you measure this speed?
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by medis on Tue Mar 06 05:38:30 MST 2012

Quote: Rob65
Please check the license with the Keil USB code to see if it suits your needs before using it.

Rob



As i understood,reading keil license:it are "AS IS" without any warranty,just
for NXP microcontroller devices only (this is obvious due stack itself) and just for
executable files distribution.Strange,but nothing said about source files sharing
0 件の賞賛
返信

2,630件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by medis on Tue Mar 06 05:21:08 MST 2012

Quote: Rob65
Please check the license with the Keil USB code to see if it suits your needs before using it.

I only use LPCUSB. LPCUSB was developed by Bertrik to remove some of the restrictions on the Keil stack.

Also note that just using the 1.5k resistor is not OK as long as you only plug in the USB cable when the USB stack is up and running. As soon as Windows detects the USB cable (through the 1.5k resistor) it will start enumeration of the device - when USB is not running on your device at that time enumeration will fail.
It will work OK if you do as described in the getting started manual with the USB stack being initialized as soon as your main() is entered but when there is a too long delay between power up and USB initialization things will fail.
Use an extra transistor to the USB_CONNECT pin to be less dependent on this.

Rob



Hi,thanks for suggestions,but the problem are on mine PC  mashine only,because i have found,that other usb com ports also become almost unusable.Swapped  many usbser.sys driver versions in  windows\system32 dir,but it doesn't help.

Keil using just for lpcxpresso board testing purposes.Will look later for LPCUSB (maybe here ready to use drivers with 11u14 device?).O maybe later just use vendor class with  libusb driver and will try to get the full usb communication speed

lpcxpresso board already have 1k5  pullup resistor with transistor swich(P0-6) to  D+  line
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Tue Mar 06 02:47:38 MST 2012

Quote: medis
On NXP site are "code.bundle.lpc17xx.keil.zip" package with all sources(LPC17xxSampleSoftware.102\keil\USBCDC) and inf files



Please check the license with the Keil USB code to see if it suits your needs before using it.

I only use LPCUSB. LPCUSB was developed by Bertrik to remove some of the restrictions on the Keil stack.

Also note that just using the 1.5k resistor is not OK as long as you only plug in the USB cable when the USB stack is up and running. As soon as Windows detects the USB cable (through the 1.5k resistor) it will start enumeration of the device - when USB is not running on your device at that time enumeration will fail.
It will work OK if you do as described in the getting started manual with the USB stack being initialized as soon as your main() is entered but when there is a too long delay between power up and USB initialization things will fail.
Use an extra transistor to the USB_CONNECT pin to be less dependent on this.

Rob
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by medis on Tue Mar 06 01:54:41 MST 2012

Quote: cell85
ok but whats the problem with my system then ?
Is the USB Phy defective ?



Hi

On NXP site are "code.bundle.lpc17xx.keil.zip" package with all sources(LPC17xxSampleSoftware.102\keil\USBCDC) and inf files
But if Your VID and PID are 0000,then driver will not run,because VID PID do not match inf file.

If you put usb wires wrong- usb do not appear on the device manager and shows something "usb device do not recognized" (on the righ bottom win desktop corner)

Try different PC.Yesterday tryed on lpc11u14 device:after usb plug and drivers install,seems enumerating goes without problem and i get com port,but after every usb replug yellow question appeared and always reistall drivers.
But when try send receive-nothing works.Looked with usb snooper-no transaction are going

Switched to other PC and all problems gone.
Now look solution to repair pc or will go system reinstall

br
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Tue Mar 06 01:11:18 MST 2012

Quote: cell85

Green on USB -
White on USB +
Black on GND
Red on VIN



Remember (or read the schematics http://ics.nxp.com/support/documents/microcontrollers/pdf/lpcxpresso.lpc1769.schematic.pdf), The 5V Vin pin is connected to the LPC-link, which makes the 3.3V sent back to the LPC1769. Whithout LPC-link, the LPC board running alone should be powered by 3.3V on the "Vout" (J6 pin 28) .

I also had problems with dual CDC. When I download the code and then run/step with the debugger, the PC (Win XP) doesn't recognize the new devices. But if I [B]disconnect[/B] the USB cable (not the LPC-link), run/restart  my application and then [B]reconnect[/B] the cable, both CDC devices are detected.

Angelo
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Mar 05 23:32:14 MST 2012

Quote: cell85
Is the USB Phy defective ?


It is more likely that you connected the whole thing wrong.

Check out the "Getting Started Manual" that came with the LPCXpresso software, there is a nice picture in there describing how to connect the USB cable.

(I don't know why I did not refer to that the first time :eek:)

Rob
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cell85 on Mon Mar 05 16:05:33 MST 2012
ok but whats the problem with my system then ?
Is the USB Phy defective ?
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Mar 05 10:44:49 MST 2012

Quote: cell85
but the usbser.sys ist provided in the zip of the keil project. in this RDB inf file there is "include=mdmcpq.inf"  is that ok ?



Yes, that is OK. The usbser.sys and mdmcpq.inf are part of Windows.

The whole idea is that the CDC protocol is standard and that the operating system contains a standard device driver for this protocol. You just need to tell windows that the device identified by the given VID/PID should user usbser.sys.

I had both my own version and the standard version from NXP running on my lpc1769 board without any problems.

Rob
0 件の賞賛
返信

2,631件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cell85 on Sun Mar 04 15:35:49 MST 2012
Ok guys, maybe the usb initialization ist not working right.

when i click on driverdetails/device details and scrolling down the parameters the VID PID is 0000 0000.

The code is running and there is no halt or error.

But  I still think this code from CodeRed Example is not working with the LPC1769.

Does anyone of you guys have a own running LPCXpresso 1769 example project which is testet with drivers?

I really want to import it to see if its a hardware fault.

I directly solderd the usb cable pins to the PCB
Green on USB -
White on USB +
Black on GND
Red on VIN

The Shild of the Cable is not connected


:(
0 件の賞賛
返信