Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Not getting the Reset and Endpoint0 Interrupts

2006-03-29 by Joel Winarske

Hi Sarita,

> We are developing USB HID and Core Driver on Olimex LPC2148 board.
> 
> The USB _ISR is getting invoked when the USB Cable is plugged out and the
> interrupt DEV_STAT_INT is getting invoked.
> 
> But when i connect the USB Cable, the Reset interrupt is not getting
> generated.

Reset triggers DEV_STAT_INT.  You then need to query engine with
CMD_USB_GET_DEV_STAT cmd, as below:

	  // Device Status interrupt
	  if(UsbDevIntrSt.Status)
	  {
	    // Clear Device status interrupt
	    DEVINTCLR = bmUSB_DevStatusInterrupt;
	    // Get device status
	    USB_DevStatus.Data = USB_Cmd(CMD_USB_GET_DEV_STAT,0);
	    // Device connection status
	    if(USB_DevStatus.ConnectChange)
	    {
	      if(UsbUserFun[UsbConnectEvent] != NULL)
	      {
	        UsbUserFun[UsbConnectEvent]((void *)USB_DevStatus.Connect);
	      }
	    }
	    // Device suspend status
	    if(USB_DevStatus.SuspendChange)
	    {
	      if(UsbUserFun[UsbSuspendEvent] != NULL)
	      {
	        UsbUserFun[UsbSuspendEvent]((void *)USB_DevStatus.Suspend);
	      }
	    }
	    // Device reset
	    if(USB_DevStatus.Reset)
	    {
	      USB_HwReset();
	      if(UsbUserFun[UsbResetEvent] != NULL)
	      {
	        UsbUserFun[UsbResetEvent](NULL);
	      }
	    }
	  }

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.