Microchip Port Devices Driver

Posted on
  1. Microchip Port Devices Driver Windows 10
  2. Microchip Port Devices Driver Download
  3. Microchip Port Devices Driver License Test
  1. OK, I’ve got a weird one here. I’m trying to use the USB on a PIC32MX795F512L in a custom design. It’s configured as a CDC device (I want it to look like a serial COM port to the PC).  I’ve modified the Microchip USB CDC Abstract Control Model Serial Driver INF file with my own PID.
  2. For example code that gets the device handle and opens the device, see Template code discussion. Step 2: Query the Device for USB Descriptors. Next, query the device for USB-specific information such as device speed, interface descriptors, related endpoints, and their pipes. The procedure is similar to the one that USB device drivers use.

Uninstall and reinstall the driver. The device driver may have become corrupted. Uninstall the driver from Device Manager and scan for new hardware to install the driver again. In the device's Properties dialog box, click the Driver tab, and then click Uninstall. Follow the instructions. Restart your computer.



  • Opening the device and obtaining WinUSB handle.
  • Getting information about the device, configuration, and interface settings of all interfaces, and their endpoints.
  • Reading and writing data to bulk and interrupt endpoints.

Important APIs

This topic includes a detailed walkthrough of how to use WinUSB Functions to communicate with a USB device that is using Winusb.sys as its function driver.

If you are using Microsoft Visual Studio 2013, create your skeleton app by using the WinUSB template. In that case, skip steps 1 through 3 and proceed from step 4 in this topic. The template opens a file handle to the device and obtains the WinUSB handle required for subsequent operations. That handle is stored in the app-defined DEVICE_DATA structure in device.h.

For more information about the template, see Write a Windows desktop app based on the WinUSB template.

Note WinUSB functions require Windows XP or later. You can use these functions in your C/C++ application to communicate with your USB device. Microsoft does not provide a managed API for WinUSB.


The following items apply to this walkthrough:

  • This information applies to Windows 8.1, Windows 8, Windows 7, Windows Server 2008, Windows Vista versions of Windows.
  • You have installed Winusb.sys as the device's function driver. For more information about this process, see WinUSB (Winusb.sys) Installation.
  • The examples in this topic are based on the OSR USB FX2 Learning Kit device. You can use these examples to extend the procedures to other USB devices.

Step 1: Create a skeleton app based on the WinUSB template

To access a USB device, start by creating a skeleton app based on the WinUSB template included in the integrated environment of Windows Driver Kit (WDK) (with Debugging Tools for Windows) and Microsoft Visual Studio.You can use the template as a starting point.

For information about the template code, how to create, build, deploy, and debug the skeleton app, see Write a Windows desktop app based on the WinUSB template.

The template enumerates devices by using SetupAPI routines, opens a file handle for the device, and creates a WinUSB interface handle required for subsequent tasks. For example code that gets the device handle and opens the device, see Template code discussion.

Step 2: Query the Device for USB Descriptors

Next, query the device for USB-specific information such as device speed, interface descriptors, related endpoints, and their pipes. The procedure is similar to the one that USB device drivers use. However, the application completes device queries by calling WinUsb_GetDescriptor.

The following list shows the WinUSB functions that you can call to get USB-specific information:

  • Additional device information.

    Call WinUsb_QueryDeviceInformation to request information from the device descriptors for the device. To get the device's speed, set DEVICE_SPEED (0x01) in the InformationType parameter. The function returns LowSpeed (0x01) or HighSpeed (0x03).

  • Interface descriptors

    Call WinUsb_QueryInterfaceSettings and pass the device's interface handles to obtain the corresponding interface descriptors. The WinUSB interface handle corresponds to the first interface. Some USB devices, such as the OSR Fx2 device, support only one interface without any alternative setting. Therefore, for these devices the AlternateSettingNumber parameter is set to zero and the function is called only one time. WinUsb_QueryInterfaceSettings fills the caller-allocated USB_INTERFACE_DESCRIPTOR structure (passed in the UsbAltInterfaceDescriptor parameter) with information about the interface. For example, the number of endpoints in the interface is set in the bNumEndpoints member of USB_INTERFACE_DESCRIPTOR.

    For devices that support multiple interfaces, call WinUsb_GetAssociatedInterface to obtain interface handles for associated interfaces by specifying the alternative settings in the AssociatedInterfaceIndex parameter.

  • Endpoints

    Call WinUsb_QueryPipe to obtain information about each endpoint on each interface. WinUsb_QueryPipe populates the caller-allocated WINUSB_PIPE_INFORMATION structure with information about the specified endpoint's pipe. The endpoints' pipes are identified by a zero-based index, and must be less than the value in the bNumEndpoints member of the interface descriptor that is retrieved in the previous call to WinUsb_QueryInterfaceSettings. The OSR Fx2 device has one interface that has three endpoints. For this device, the function's AlternateInterfaceNumber parameter is set to 0, and the value of the PipeIndex parameter varies from 0 to 2.

    To determine the pipe type, examine the WINUSB_PIPE_INFORMATION structure's PipeInfo member. This member is set to one of the USBD_PIPE_TYPE enumeration values: UsbdPipeTypeControl, UsbdPipeTypeIsochronous, UsbdPipeTypeBulk, or UsbdPipeTypeInterrupt. The OSR USB FX2 device supports an interrupt pipe, a bulk-in pipe, and a bulk-out pipe, so PipeInfo is set to either UsbdPipeTypeInterrupt or UsbdPipeTypeBulk. The UsbdPipeTypeBulk value identifies bulk pipes, but does not provide the pipe's direction. The direction information is encoded in the high bit of the pipe address, which is stored in the WINUSB_PIPE_INFORMATION structure's PipeId member. The simplest way to determine the direction of the pipe is to pass the PipeId value to one of the following macros from Usb100.h:

    • The USB_ENDPOINT_DIRECTION_IN (PipeId) macro returns TRUE if the direction is in.
    • The USB_ENDPOINT_DIRECTION_OUT(PipeId) macro returns TRUE if the direction is out.

    The application uses the PipeId value to identify which pipe to use for data transfer in calls to WinUSB functions, such as WinUsb_ReadPipe (described in the 'Issue I/O Requests' section of this topic), so the example stores all three PipeId values for later use.

The following example code gets the speed of the device that is specified by the WinUSB interface handle.

The following example code queries the various descriptors for the USB device that is specified by the WinUSB interface handle. The example function retrieves the types of supported endpoints and their pipe identifiers. The example stores all three PipeId values for later use.

Step 3: Send Control Transfer to the Default Endpoint

Next, communicate with the device by issuing control request to the default endpoint.

All USB devices have a default endpoint in addition to the endpoints that are associated with interfaces. The primary purpose of the default endpoint is to provide the host with information that it can use to configure the device. However, devices can also use the default endpoint for device-specific purposes. For example, the OSR USB FX2 device uses the default endpoint to control the light bar and seven-segment digital display.

Control commands consist of an 8-byte setup packet, which includes a request code that specifies the particular request, and an optional data buffer. The request codes and buffer formats are vendor defined. In this example, the application sends data to the device to control the light bar. The code to set the light bar is 0xD8, which is defined for convenience as SET_BARGRAPH_DISPLAY. For this request, the device requires a 1-byte data buffer that specifies which elements should be lit by setting the appropriate bits.

The application can set this through the user interface (UI), such as by providing a set of eight check box controls to specify which elements of the light bar should be lit. The specified elements correspond to the appropriate bits in the buffer. To avoid UI code, the example code in this section sets the bits so that alternate lights get lit up.

Microchip Port Devices Driver

Use the following steps to issue a control request.

  1. Allocate a 1-byte data buffer and load the data into the buffer that specifies the elements that should be lit by setting the appropriate bits.

  2. Construct a setup packet in a caller-allocated WINUSB_SETUP_PACKET structure. Initialize the members to represent the request type and data as follows:

    • The RequestType member specifies request direction. It is set to 0, which indicates host-to-device data transfer. For device-to-host transfers, set RequestType to 1.
    • The Request member is set to the vendor-defined code for this request, 0xD8. It is defined for convenience as SET_BARGRAPH_DISPLAY.
    • The Length member is set to the size of the data buffer.
    • The Index and Value members are not required for this request, so they are set to zero.
  3. Call WinUsb_ControlTransfer to transmit the request to the default endpoint by passing the device's WinUSB interface handle, the setup packet, and the data buffer. The function receives the number of bytes that were transferred to the device in the LengthTransferred parameter.

The following code example sends a control request to the specified USB device to control the lights on the light bar.

Step 4: Issue I/O Requests

Next, send data to the device's bulk-in and bulk-out endpoints that can be used for read and write requests, respectively. On the OSR USB FX2 device, these two endpoints are configured for loopback, so the device moves data from the bulk-in endpoint to the bulk-out endpoint. It does not change the value of the data or add any new data. For loopback configuration, a read request reads the data that was sent by the most recent write request. WinUSB provides the following functions for sending write and read requests:

To send a write request

  1. Allocate a buffer and fill it with the data that you want to write to the device. There is no limitation on the buffer size if the application does not set RAW_IO as the pipe's policy type. WinUSB divides the buffer into appropriately sized chunks, if necessary. If RAW_IO is set, the size of the buffer is limited by the maximum transfer size supported by WinUSB.
  2. Call WinUsb_WritePipe to write the buffer to the device. Pass the WinUSB interface handle for the device, the pipe identifier for the bulk-out pipe (as described in the Query the Device for USB Descriptors section of this topic), and the buffer. The function returns the number of bytes that are actually written to the device in the bytesWritten parameter. The Overlapped parameter is set to NULL to request a synchronous operation. To perform an asynchronous write request, set Overlapped to a pointer to an OVERLAPPED structure.

Write requests that contain zero-length data are forwarded down the USB stack. If the transfer length is greater than a maximum transfer length, WinUSB divides the request into smaller requests of maximum transfer length and submits them serially.The following code example allocates a string and sends it to the bulk-out endpoint of the device.

To send a read request

  • Call WinUsb_ReadPipe to read data from the bulk-in endpoint of the device. Pass the WinUSB interface handle of the device, the pipe identifier for the bulk-in endpoint, and an appropriately sized empty buffer. When the function returns, the buffer contains the data that was read from the device. The number of bytes that were read is returned in the function's bytesRead parameter. For read requests, the buffer must be a multiple of the maximum packet size.

Zero-length read requests complete immediately with success and are not sent down the stack. If the transfer length is greater than a maximum transfer length, WinUSB divides the request into smaller requests of maximum transfer length and submits them serially. If the transfer length is not a multiple of the endpoint's MaxPacketSize, WinUSB increases the size of the transfer to the next multiple of MaxPacketSize. If a device returns more data than was requested, WinUSB saves the excess data. If data remains from a previous read request, WinUSB copies it to the beginning of the next read request and completes the request, if necessary.The following code example reads data from the bulk-in endpoint of the device.

Step 5: Release the Device Handles

After you have completed all the required calls to the device, release the file handle and the WinUSB interface handle for the device. For this, call the following functions:

  • CloseHandle to release the handle that was created by CreateFile, as described in the step 1.
  • WinUsb_Free to release the WinUSB interface handle for the device, which is returned by WinUsb_Initialize.

Step 6: Implement Main

The following code example shows the main function of your console application.

Next steps

If your device supports isochronous endpoints, you can use WinUSB Functions to send transfers. This feature is only supported in Windows 8.1.

For more information, see Send USB isochronous transfers from a WinUSB desktop app.

Related topics

WinUSB Architecture and Modules
WinUSB (Winusb.sys) Installation
WinUSB Functions for Pipe Policy Modification
WinUSB Power Management
WinUSB Functions
Write a Windows desktop app based on the WinUSB template

This page offers six solutions to fix the USB device not recognized issue in Windows 10/8/7/XP. If you get this error message 'The last USB device you connected to this computer malfunctioned, Windows does not recognize it' or you cannot open your device, accessing data, read this article to fix this issue without data loss.


6 Fixes USB Device Malfunctioned and Not Recognized

This page unveils six solutions to fix the 'USB device malfunctioned and is not recognized' issue. If you are having this USB device error, don't worry. Pick up any method below to make your USB recognizable and work again.

Workable SolutionsStep-by-step Troubleshooting
Fix 1. Unplug ComputerShut down computer > Unplug the power cable > Replug and restart the computer a few minutes later...Full steps
Fix 2. Change USB Cable/PortCheck the available USB cables and ports one by one > If USB cable or ports itself is damaged, change it ...Full steps
Fix 3. Update Device DriverOpen Disk Management > Expand 'Universal Serial Bus Controllers' > Right-click 'Generic USB Hub'...Full steps
Fix 4. Fix Root HubOpen Device Manager > Expand Universal Serial Bus Controllers > Right-click USB Root Hub...Full steps
Fore More FixesChange USB settings and reinstall USB driver to make USB recognized (in Fix 5 and 6)...Full steps

'USB device not recognized' is an error that usually occurs to the Windows computer when you plug in a USB device. Here, the USB device mentioned by Windows is a general concept, not limited to a USB hard drive or flash drive, but other devices using a USB port for connection, including a USB mouse, keyboard, Android phone, camera, printer, etc. When Windows generates such an error, the USB will not show up on your computer. As a result, you can't open your device or access your data. In different situations, the error is followed by different messages.

'The last USB device you connected to this computer malfunctioned, and Windows does not recognize it.'

'One of the USB devices attached to this computer has malfunctioned, and Windows does not recognize it. For assistance in solving this problem, click this message.'

The USB device malfunctioned and not recognized error has frustrated a large number of users. If you are one of the victims, here are some fixes you can try to resolve the issue and make your device detected.

Microchip Port Devices Driver Windows 10

How to Fix USB Device Not Recognized in Windows 10/8/7/XP/Vista

If your device is not recognized at the moment, you can try the below six solutions to make it show up again. You don't have to try every method, but we strongly recommend you follow the sequence, which our experts have tried many times.

Fix 1. Unplug your computer to fix the USB device malfunctioned

It sounds like a piece of cake thing to do, but it works! For most of not recognizing USB gadgets, there is typically nothing wrong. A computer restart could solve it. This way is meant to reboot the motherboard, which has all of the computer hardware connected to, including the USB ports. Rebooting the motherboard usually helps solve the temporary insufficient power supply for outside devices.

Step 1. Cut your computer power at its source, which is unplugging your computer from the wall outlet.

Step 2. Leave the computer alone for a few minutes, and then replug it in the wall outlet for a restart.

Step 3. Now check if the computer is able to detect the USB device and assign a drive letter to it.

If this fix failed, don't panic, the next methods are also doable.

Fix 2. Change the USB cable or USB port to Fix USB device not recognized

Microchip Port Devices Driver Download

Is the computer's USB port working properly? You need to check the available USB ports one by one to see whether it is a computer hardware problem or a problem with the device itself. If changing to another port solves the problem, then there is something wrong with the previous port. You can give up that broken port, or send your computer for repair.

Fix 3. Update/Rollback a device driver if the USB device not recognized

Device Manager operation is another widely suggested way to troubleshoot a non-recognizable USB device on Youtube and IT forums. Does this method apply to your situation? Go on to have a check.

Step 1. Type device manager in the search box to open Device Manager.

Or you can press Windows + R keys simultaneously to bring up the Run box, then type devmgmt.msc, and hit Enter.

Step 2. Expand 'Universal Serial Bus Controllers' and you will see the item called 'Generic USB Hub'. Righ-click on the first Generic USB Hub and choose Properties.

Step 3. Now, navigate to the 'Driver' tab, choose 'Update Driver...'.

Step 4. When asked how do you want to search for driver software, there are two options.

Microchip port devices driver license test

1. Search automatically for updated driver software

This way is an automatic update by Windows. When it finished, all you need to do is to disconnect the USB device, restart the computer and reconnect it again. Windows will install the latest driver for you.

2. Browse my computer for driver software

When you choose this option, you need to continue with the other pop up 'let me pick from a list of device drivers on my computer.'

Microchip Port Devices Driver License Test

From the list, select Generic USB hub, which normally the only choice. Click 'Next' and then Windows will install the driver for you.

If updating the driver doesn't help solve the USB device problem, don't suspend though, try to update each Generic USB Hub until updated them all for once.

In the same path to update the driver, you can also try to roll back to the previous driver before the error occurs. Instead of selecting 'Update Driver' in the 'Driver' tab, choose 'Roll Back Driver' this time.

The changes made on the computer power and the device driver should take effect, and your USB device will no longer report issues. Otherwise, try the rest three methods one by one.

Microchip port devices driver scanner

Fix 4. Fix USB Root Hub to Fix USB drive not recognized

The USB root hub is the software driver that lets you connect multiple USB peripherals to your computer. Most computers have multiple root hubs so you can share the data bus across multiple devices. So if the computer cannot recognize your USB drive, you can try to fix the USB root hub.

Step 1. Open Device Manager. Find the Universal Serial Bus controllers option and single click it to expand.

Step 2. Find the USB Root Hub option in this category. Right-click it and choose Properties.

Step 3. Go to the Power Management tab and uncheck the 'Allow the computer to turn off this device to save power' option. Then click OK to save your change.

Fix 5. Change the USB Selective Suspend Settings

Another possible reason why your USB got malfunctioned is the hub driver suspends the USB automatically. In this case, change the USB selective suspend settings could help.

Step 1. Right-click on the Windows icon and click Power Options.

Step 2. In the Choose or customize a power plan windows, click Change plan setting

Step 3. In the Edit Plan Settings window, click Change advanced power settings.

Step 4. In the Power Options window, find and expand USB settings, expand USB selective suspend settings and Disable both On battery and Plugged in settings.

Step 5. Then Click Apply and OK to save the settings.

Fix 6. Uninstall USB device driver to make USB recognized

Being different from the options of updating or degrading the driver version, uninstalling the driver could result in a total disability of all the USB ports. So take care of this last-try method.


Step 1. Open Device Manager (Right Click on Windows Logo and Click Device Manager).

Step 2. Now find and expand Universal Serial Bus controllers. Now right-click on USB drivers and click Uninstall. Do for all USB drivers one by one.

Step 3. Now, restart your PC. The USB drivers are automatically re-install and solve the corrupted USB devices problem.

Further Troubleshooting: Data Recovery

Those six ways we mentioned above are all the possible ways said to be helpful to fix the 'USB device malfunctioned and not recognized' error.

If one of the fixes worked, you should be able to access your USB and use the saved data again.

What if you opened the USB drive but find something missing? You need third-party software to retrieve your data. Here, EaseUS disk data recovery can help even when your USB device is listed in disk management but not showing up on your computer. The program works well in Windows 10/8/7/XP and other previous versions.

Step 1. Run USB data recovery software.

Connect the USB flash drive to your computer and launch EaseUS USB data recovery software on your PC. Select your USB drive which marks as a removable disk, and click 'Scan' to start finding your lost files.

Step 2. Scan all lost files from USB.

EaseUS Data Recovery Wizard will thoroughly scan your USB flash drive and find all your lost data on it. After the scanning process, use the Filter feature to filter a specific file type. You can check and preview found USB files in this program.

Step 3. Restore all lost files from USB.

A double-click will allow you to preview the file results. Choose the target files and click 'Recover' to save them to a secure location on your PC or other external storage devices.

To retrieve data from USB devices, we suggest you save retrieved files to another secure location in case of further problems.

Format USB to NTFS/FAT32 and recreate partition on USB

Some people encountered more serious issues than once. They said the same USB device starts malfunctioning again after a short period of time after the repair. If this is the case, formatting and recreating a new partition can help.

  • Connect the USB to the PC, right-click on This PC/My Computer and select Manage.
  • Enter Device Manager, select Disk Management, locate and right-click on your malfunctioned USB, and select Format volume...
  • Complete the Format process and set the file system to NTFS or FAT32.

Now you can check if the USB shows up in your computer or not, if not, continue with the steps below:

  • Open Disk Management, right-click on USB and select Delete Volume, complete the process.
  • When USB shows as unallocated, right-click on it and select New Simple Volume, set the drive letter and file system (NTFS/FAT32) for it, and complete the process.

After this, you should access the USB drive on your PC and save data on it again.