lpc1788 USB device not recognized

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

lpc1788 USB device not recognized

3,048 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Mohammads on Fri Jul 04 02:18:54 MST 2014
Hello

when I connect the usb device to computer(all flash erased), it says usb device not recognized(Unknown USB Device (Device Descriptor Request Failed))!
Is that normal and I have to drive the 'USB Device' in LPC1788 by software?
maybe I have a hardware problem?
here is the schematic:
[img=621x512]http://upload7.ir/imgs/2014-07/69846740420434595568.png[/img]
Labels (1)
0 Kudos
Reply
4 Replies

2,538 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Mohammads on Fri Jul 11 17:14:26 MST 2014
Hi
I just wanted to be sure there is no hardware problem!
But, OK. I'll try to handle that.

Thank you nerd
0 Kudos
Reply

2,538 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Fri Jul 11 10:17:00 MST 2014
Hi,

So what exactly are you trying to accomplish? Are you just trying to get your MCU to be recognized as a USB device? If you are, you have to initialize the USB controller as a device as stated in my first post. You should not have to mess with any boot loaders. Simply program the flash with the necessary code and execute it.
0 Kudos
Reply

2,538 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Mohammads on Thu Jul 10 00:48:33 MST 2014
Thank you for the response

some questions; after flashing the 'USB Secondary Bootloader', I get the "USB Device Not Recognized" error!
Should I setting the USB configurations in the 'USB Secondary Bootloader' project or just compile and flash?
Is it because of bad routing of tracks?(GND track is between the USB resistors)
[img=1020x565]http://upload7.ir/imgs/2014-07/38680550861349104469.png[/img]
0 Kudos
Reply

2,538 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Wed Jul 09 09:07:00 MST 2014
Hello,

It sounds like if you are asking if the LPC1788 is "plug and play" compatible without any software. As stated in section 12.13 in the LPC17xx_8x user's manual, there is software initialization that must be done in order for the MCU to be USB device compatible.

http://www.nxp.com/documents/user_manual/UM10470.pdf

"The LPC178x/177x USB device controller initialization includes the following steps:
1. Enable the device controller by setting the PCUSB bit of PCONP.
2. Configure and enable the PLL and Clock Dividers to provide 48 MHz for usbclk and
the desired frequency for cclk. For the procedure for determining the PLL setting and
configuration, see Section 3.10.5 “Procedure for determining PLL settings”.
3. Enable the device controller clocks by setting DEV_CLK_EN and AHB_CLK_EN bits
in the ClkCtrl register. Poll the respective clock bits in the ClkSt register until they are
set.
4. Select the desired USB port pins using the PortSel register. The PORTSEL_CLK_EN
bit must be set in ClkCtrl before accessing PortSel and should be cleared after
accessing PortSel.
5. Enable the USB pin functions by writing to the corresponding IOCON registers.
6. Disable the pull-ups and pull-downs on the VBUS pin using the corresponding IOCON
register by putting the pin in the “plain-input” mode. See Section 7.4.1 “I/O
configuration register contents (IOCON)”.
7. Set EpIn and MaxPSize registers for EP0 and EP1, and wait until the EP_RLZED bit
in DevIntSt is set so that EP0 and EP1 are realized.
8. Enable endpoint interrupts (Slave mode):
– Clear all endpoint interrupts using EpIntClr.
– Clear any device interrupts using DevIntClr.
– Enable Slave mode for the desired endpoints by setting the corresponding bits in
EpIntEn.
– Set the priority of each enabled interrupt using EpIntPri.
– Configure the desired interrupt mode using the SIE Set Mode command.
– Enable device interrupts using DevIntEn (normally DEV_STAT, EP_SLOW, and
possibly EP_FAST).
9. Configure the DMA (DMA mode):
– Disable DMA operation for all endpoints using EpDMADis.
– Clear any pending DMA requests using DMARClr.
– Clear all DMA interrupts using EoTIntClr, NDDRIntClr, and SysErrIntClr.
– Prepare the UDCA in system memory.
– Write the desired address for the UDCA to UDCAH.
– Enable the desired endpoints for DMA operation using EpDMAEn.
– Set EOT, DDR, and ERR bits in DMAIntEn.
10. Install USB interrupt handler in the NVIC by writing its address to the appropriate
vector table location and enabling the USB interrupt in the NVIC.
11. Set default USB address to 0x0 and DEV_EN to 1 using the SIE Set Address
command. A bus reset will also cause this to happen.
12. Set CON bit to 1 to make CONNECT active using the SIE Set Device Status
command.
"
0 Kudos
Reply