EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

USB interfacing with LPC devices

Started by Jean-Sebastien Stoezel March 2, 2010
Hello,

I apologize in advance if that this is a broad question. I guess I
need to start somewhere, and I believe this list is the best place to
do so.

I would like to interface a PC with a USB enabled LPC device. And this
is where I am not sure where to start. In the past I have worked with
FTDI chips, which come with an API. The API allows you to access
features of the chip.

When it comes to LPC devices, and any other USB devices I guess, I
believe windows defines classes... I think there is a mass memory
class, virtual com port. The device I am working on would not fall in
these classes. It is in some sorts an IO processor. Which class would
this be? Next is how do you interface with these classes,
programmatically on the PC side? How do I interface on the
microcontroller side?

Thanks,
Jean

An Engineer's Guide to the LPC2100 Series

--- In l..., Jean-Sebastien Stoezel wrote:
>
> Hello,
>
> I apologize in advance if that this is a broad question. I guess I
> need to start somewhere, and I believe this list is the best place to
> do so.
>
> I would like to interface a PC with a USB enabled LPC device. And this
> is where I am not sure where to start. In the past I have worked with
> FTDI chips, which come with an API. The API allows you to access
> features of the chip.
>
> When it comes to LPC devices, and any other USB devices I guess, I
> believe windows defines classes... I think there is a mass memory
> class, virtual com port. The device I am working on would not fall in
> these classes. It is in some sorts an IO processor. Which class would
> this be? Next is how do you interface with these classes,
> programmatically on the PC side? How do I interface on the
> microcontroller side?
>
> Thanks,
> Jean
>

If you want to see code for a VCOM serial port or a mass storage device, look at www.jcwren.com/arm The code is for the LPC2148.

Make your device fall into either VCOM, mass storage or HID so you don't have to write the Windows end of the driver. HID might be appropriate and Windows has a universal HID driver.

Do a Google search for 'lpc2148 hid' and you will find a lot of app notes from Keil and NXP.

Richard

There are thousands of posts in here on USB but start by
googling "LPCUSB" and you will find a wealth of information.
Also, be sure to go to NXP's website and look at their firmware examples.
Check out http://www.lvr.com/hidpage.htm for information on HID and more.

The NXP is a raw device so you will configure your firmware to emulate on of the USB classes of devices.
IAR and others sell software development boards that come with example code for each class. Those are your best starting points for learning how to use the USB function.

Hope that helps.

--- In l..., Jean-Sebastien Stoezel wrote:
>
> Hello,
>
> I apologize in advance if that this is a broad question. I guess I
> need to start somewhere, and I believe this list is the best place to
> do so.
>
> I would like to interface a PC with a USB enabled LPC device. And this
> is where I am not sure where to start. In the past I have worked with
> FTDI chips, which come with an API. The API allows you to access
> features of the chip.
>
> When it comes to LPC devices, and any other USB devices I guess, I
> believe windows defines classes... I think there is a mass memory
> class, virtual com port. The device I am working on would not fall in
> these classes. It is in some sorts an IO processor. Which class would
> this be? Next is how do you interface with these classes,
> programmatically on the PC side? How do I interface on the
> microcontroller side?
>
> Thanks,
> Jean
>

Yes broad question indeed.

>> Which class would this be?

Vendor class, more than likely. Either it fits a standard HID or some other
known class, or it is a custom vendor class.

If you are new to USB, then I would suggest you start reading - a lot. "USB
Complete" by Axelson is a good book. There are many others. If you do a
custom device then you will need to write a Kernel driver for Windows for
it. You have lots of custom code to do: MCU, Driver, Windows app.
Everything has to work together.

After you understanding how USB works, different modes, etc, then you can
get some sample code for an LPC for USB and it will make a whole lot more
sense. A lot like drinking from a firehose.

Chris.

Alright, with your answers it looks like my application would need an HID
interface.

Thank you for pointing me towards the right direction. Redwire85, your
comments helped a lot. http://www.lvr.com/hidpage.htm seems to be very
accessible code to understand HID programming on the host side, while LPCUSB
seems like a tunr key solution on the MCU side.

Chris, your comment about drinking from a firehose is pretty funny, though
pretty true too.

I guess I'll be back with more specific USB questions soon.

Thanks!
Jean
On Tue, Mar 2, 2010 at 10:24 AM, Chris wrote:

> Yes broad question indeed.
> >> Which class would this be?
>
> Vendor class, more than likely. Either it fits a standard HID or some other
> known class, or it is a custom vendor class.
>
> If you are new to USB, then I would suggest you start reading - a lot. "USB
> Complete" by Axelson is a good book. There are many others. If you do a
> custom device then you will need to write a Kernel driver for Windows for
> it. You have lots of custom code to do: MCU, Driver, Windows app.
> Everything has to work together.
>
> After you understanding how USB works, different modes, etc, then you can
> get some sample code for an LPC for USB and it will make a whole lot more
> sense. A lot like drinking from a firehose.
>
> Chris.
>
>
>

The 2024 Embedded Online Conference