Hey,
I`m new here, can someone explain me( or show me a source code )how should I set my LPC1766 as a host device and read vid /pid of usb .
I allready tried example from NXP, but it didn`t help very much
Hey,
I`m new here, can someone explain me( or show me a source code )how should I set my LPC1766 as a host device and read vid /pid of usb .
I allready tried example from NXP, but it didn`t help very much
Hi Adrian Cojocari,
If you want to use the LPC1766 USB host mode, you can use the USB Host controller, LPC1766 support the USB host mode.
About the sample code, you can refer to the LPCopen code for LPC1769, the code can be downloaded from this link:
http://www.nxp.com/assets/downloads/data/en/software/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769.zip
Open nxp_lpcxpresso_1769_lpcusblib_host_examples in folder: lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769\applications\lpc17xx_40xx\iar_ewarm_projects\nxp_lpcxpresso_1769
This code is the USB host example, you can refer to it.
About the VID and PID, as you know, the VID and PID is defined in the device descriptor, so you just need to use USB_Host_GetDeviceDescriptor get the device decriptor, the VID is two bytes data in device_descriptor byte 8 and byte 9, PID is byte 10, byte 11.
Take a USB device as an example:
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Adrian Cojocari,
You are welcome!
If your problem is solved, please help to mark the correct answer button to close this question.
Thank you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Adrian Cojocari,
If you want to use the LPC1766 USB host mode, you can use the USB Host controller, LPC1766 support the USB host mode.
About the sample code, you can refer to the LPCopen code for LPC1769, the code can be downloaded from this link:
http://www.nxp.com/assets/downloads/data/en/software/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769.zip
Open nxp_lpcxpresso_1769_lpcusblib_host_examples in folder: lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769\applications\lpc17xx_40xx\iar_ewarm_projects\nxp_lpcxpresso_1769
This code is the USB host example, you can refer to it.
About the VID and PID, as you know, the VID and PID is defined in the device descriptor, so you just need to use USB_Host_GetDeviceDescriptor get the device decriptor, the VID is two bytes data in device_descriptor byte 8 and byte 9, PID is byte 10, byte 11.
Take a USB device as an example:
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------