CDC working example

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

CDC working example

2,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Mon Jun 04 04:31:25 MST 2012
Hello Evry1...

Im new to the LPCExpresso forum and I use LPC1769 for my project. Recently migrated from PIC to ARM. :) I think this is the place where I can start my new experiments for USB.

So guys tell me where can I find a good USB Device CDC working example ? Since it's lil bit urgent looking for a quick reply from u.....

Thank You Every1
0 Kudos
Reply
14 Replies

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Tue Jun 12 08:00:12 MST 2012
Ok thanx gentlemen.... finally I could figure out the case. Sorry for asking the same thing again without going into deep. Appreciated ur great help and now I have a better idea about Xpresso IDE as well as the code. :)

Thanx again
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jun 12 07:33:35 MST 2012

Quote: ranaya
Btw it supports RDB1768 board only.



Nonsense :eek:  Samples are working with LPCXpresso176x too, if you add the required hardware :)


Quote: ranaya
So what are the source/ header files I should modify to match it for  lpcxpresso 1769 revB board?



#1 Throw out LCD library and delete LCD function calls.
#2 Set MCU to 1769.

That's a 5 minutes job :eek:
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Tue Jun 12 07:21:41 MST 2012

Quote: ranaya
So what are the source/ header files I should modify to match it for lpcxpresso 1769 revB board ?



I don't know. You'll have to check the code to see if there are board specific things like LCD initialization / writing strings to LCD etc.
The schematics of the board are also available (Code Red website) in case you want those as a reference.

I've used one or two of the RDB1768 examples and it is fairly straight forward to change things.

Rob
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Mon Jun 11 23:11:53 MST 2012
Hi Mr.Rob, "RDB1768cmsis2_usb_serial" is the best example to test my USB app. Btw it supports RDB1768 board only.


Quote:
The RDB1768cmsis2 zip file contains a set of example projects
suitable for use on Code Red's RDB1768 development board.



So what are the source/ header files I should modify to match it for lpcxpresso 1769 revB board ? Would greatly appreciated ur help....

Regards
Ranaya
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Sun Jun 10 08:14:57 MST 2012
hi...thanx for ur replies. :)

@Rob65 : Sorry, Seems I've chosen the wrong example. i went through the example code inside the archive called "NXP_LPCXpresso1769_MCB1700_2011-02-11.zip". In cdc example(USBCDC) it includes uart functions too. Readme file states,


Quote:

Testing the USB Virtual COM port with serial cable:

  Open two Hyperterminal windows.
      One with "LPC17xx USB VCom Port(COMx)"
      One with "Communications Port (COM1)".
  Connect PC port COM1 to the comport on the board and open "COM1"
  and "COMx". Data from COM1 will be echoed on "COMx" and visa versa.



I think here, to demonstrate the sample we need both serial and usb. :) serial interface for com1 and usb for VCOM ;)
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sun Jun 10 06:08:59 MST 2012

Quote: ranaya
Why shud i use uart pins, functions for cdc example ?


Who told you you should use the uart pins ? Not Zero and surely not me.

The example that I mentioned contains a README.txt file and in there you'll see:

Quote:

USB_Serial Example
------------------
This example provides a minimal implementation of a USB serial port, using
the CDC class. This therefore allows you to connect to the board over USB from
a terminal program, such as hyperterminal.

By default this port of the example will simply echo everything it receives
right back to the host PC, but incremented by 1. Thus if you type 'a' on the
host PC, the program will send back 'b'.

So it creates a USB serial port (that's a [B]USB[/B] port) that echos everything it received back to the PC.

Sounds simple enough to me.
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ex-kayoda on Sun Jun 10 01:15:55 MST 2012
Zero is obviously drilling (or killing :rolleyes:) his trainees this weekend.

UART is used to demonstrate input/ output function of this samples.

So don't panic, if you don't connect anything to RX /TX of UART there's no UART Police coming.

Hardware: Add a connector, that's all. As Zero described:

See #5 of http://knowledgebase.nxp.com/showthread.php?t=2955
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Sun Jun 10 00:42:12 MST 2012
Can sm 1 please explain me these things ? Why shud i use uart pins, functions for cdc example ? It's just another usb class ! Or to demonstrate it we need uart ???

Thanx, appreciated ur replies
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Sat Jun 09 00:07:18 MST 2012
Hi all .... I need to clear few things.

For USB CDC example, do i need rx and tx pins to connect something ? I mean, for USB cdc class, the usb connection is recognized as a serial connection. So there is nothing to deal with uart functions. am i correct ?

>> Xpresso datasheet states USB Pullup as well as the 33ohm resistors already integrated with  
   the board. So I need only a usb connector! and load the cdc example to it. Then PC will 
   enumerate it if i select correct drivers ??? 

----------------------------------------------------------------------------------------------
For lpc1769, what is the average data throughput we can expect with USB CDC ??? 

I think Mr.Zero may have somthing to say abt this

Thank You Gentlemen
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Wed Jun 06 11:09:37 MST 2012
Hi Zero....

Thanx alot for pointing it and for the quick reply.... I'll change my IOs and match them to 1768 settings.
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jun 05 05:21:23 MST 2012

Quote: ranaya
Btw nxpUSBlib supports for LPC11U14 and LPC1768 LPCXpresso with Rev B base boards only.



BTW: If it supports LPC1768 it supports LPC1769, too :eek:

Example_VirtualSerialDevice is the right place to start

Don't know which hardware you are using, but USB connect GPIO (to switch D+ via FET/BJT) is defined in bsp_LPCXpressoBase_RevB_17xx.h of LPCXpressoBase_RevB:
#define USB_CONNECT_GPIO_PORT_NUM 0
#define USB_CONNECT_GPIO_BIT_NUM  21
Changing this to your USB connect pin should start USB enumeration and your PC should ask you now for an inf file (= nxpUSBlib VirtualSerial.inf)
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Tue Jun 05 01:22:15 MST 2012
Hi....
Thanks alot atomicdog and Rob65 for ur quick and kind replies. :) I'll go through the link as well as the example codes. Btw nxpUSBlib supports for LPC11U14 and LPC1768 LPCXpresso with Rev B base boards only. I'll try and see how to modify it.

Regards
Anuradha
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Jun 04 11:04:51 MST 2012
If you installed the LPCXpresso IDE, followed the instructions in the getting started manual and examined the other examples that are delivered with the software therre is a good chance you found an example (inside the RDB1768 set of examples, its called RDB1768cmsis2_usb_serial).
Another example is called USBCDC and that one is inside the set o MCB1700 examples.

Both will run with little modiications on the LPCXpresso board.

Rob
0 Kudos
Reply

2,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Mon Jun 04 08:39:46 MST 2012
you can start here... http://www.lpcware.com/content/project/nxpusblib
0 Kudos
Reply