Author Topic: labview driver for MCP2221 in windows 7  (Read 7440 times)

0 Members and 1 Guest are viewing this topic.

Offline cdwijsTopic starter

  • Regular Contributor
  • *
  • Posts: 57
labview driver for MCP2221 in windows 7
« on: July 25, 2016, 12:32:18 pm »
Hi All,
I have taken on the challenge to create a driver for the MCP2221 [1] in labview, in windows 7 enterprize. I seems like I can't install the labview driver instead of the windows driver. Without it, I cannot use labview to talk to the MCP2221

I have found a guide from national instruments [2]. I have done & seen the following things:
1) Create the INF File Using the Driver Development Wizard. This works without issues, I get 2 .inf files, one for windowsXP, and one for windows 7,8 and 10.
2) Install the INF files and the USB device. Copy the .inf file to C:\WINDOWS\INF. This goes without problems.
3) Right-click on the INF file in C:\WINDOWS\INF and click Install. Then I get the pop-up "UAC c:\windows\system32\InfDefaultInstall.exe" A .PNF file should be created, but this does not happen.
4) I connect my MCP2221 to my PC. Devices and Printers shows me "MCP2221 USB-I2C/UART Combo". Right-click->Hardware gives 4 lines:
HID-compliant device
USB Composite Device
USB Input Device
USB Serial Port (COM4)

5) I open Device manager, Human Interface Device->HID-compliant device. Next I go to Details, and Hardware IDs:
HID\VID_04D8&PID_00DD&MI_02

6) I have installed MCP2221Terminal. [3] This shows the same VID and PID numbers: 1 Device Connected (VID: 0x4D8, PID: 0xDD)
7) I open Device manager, Human Interface Device->HID-compliant device. Driver->Update Driver->browse->C:\windows\inf. Then I get the following message: "The best driver software for your device is already installed. Windows has determined the driver software for your device is up to date. HID-compliant device"

I have local administrator rights on this PC
[1] http://www.microchip.com/wwwproducts/en/MCP2221
[2] http://www.ni.com/tutorial/4478/en/
[3] http://ww1.microchip.com/downloads/en/DeviceDoc/MCP2221Terminal.zip

Cheers,
Cedric
 

Offline cdwijsTopic starter

  • Regular Contributor
  • *
  • Posts: 57
Re: labview driver for MCP2221 in windows 7
« Reply #1 on: July 25, 2016, 12:50:03 pm »
I have not read the guide correctly. When I do the correct steps I see the following:
1) Device manager->Human interface devices->HID-compliant device->properties->Details->Hardware ID's->HID\VID_04D8&PID_00DD&MI_02
2) Device manager->Human interface devices->HID-compliant device->properties->Driver->Update Driver->Browse my computer for driver software->Let me pick from a list of device drivers on my computer->Have Disk->Browse->prefix.inf->open->OK. Now the following message comes up: "The folder you specified doesn't contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems." Then click cancel to close all the panels.

My windows version is Windows 7 Enterprise Service pack 1, 64 bit
The NI-Visa version is not shown, but the manual (May 2014, 370131R-01) states windows7 64 bit is supported for USB.

The contents of prefix.inf:
Code: [Select]
;===========================================================================
;  This file was generated using:
;  NI-VISA Driver Development Wizard version 5.3
;===========================================================================
;
;  This file is for use with Windows 8/7/Vista. This will not work on Windows
;  XP.  This Windows Setup Information File contains the information
;  NI-VISA needs in order to access your instrument.  Do not modify the
;  contents of this file unless you are sure about what you are doing.
;
;===========================================================================
;
;  Windows Vista/7 Installation:
;  To apply the contents of this file to a system's settings, right-click
;  this file and choose "Install". If the device was plugged in before this
;  file is installed, the device will need to be removed from the "Unknown
;  Devices" class in the Windows Device Manager.
;
;===========================================================================
;
;  Windows 8 Installation:
;  To apply the contents of this file to a system's settings, a catalog file
;  must be generated and signed using either a personal certificate or a
;  certificate obtained from a Certificate Authority (CA).  For detailed
;  instructions on how to install your INF on Windows 8, visit
;  http://ni.com/info and enter the Info Code INFWin8.
;
;===========================================================================
;
;  Removal:
;  At installation, Windows copies the file into the %SystemRoot%\inf
;  directory using the alternate filename oem##.inf.  You may have
;  to search all the files to find the one from which this is copied.
;  Remove that file and its associated .pnf file (if it exists) from
;  %SystemRoot%\inf.  Either reboot the computer, or perform a
;  "Scan for hardware changes" from the Windows Device Manager.
;
;===========================================================================

[Version]
Signature=$WINDOWS NT$
Class=visaUsbDevice
ClassGUID={A3330EDF-239D-4206-833B-1D58952613D5}
Provider=%Vendor0%
DriverVer=07/25/2016,1.0
CatalogFile=prefix.cat

;===========================================================================
;  Default Installer
;===========================================================================

[DefaultInstall]
CopyINF=prefix.inf

[DestinationDirs]

[SourceDisksNames]

[SourceDisksFiles]

;===========================================================================
;  Class Installer
;===========================================================================

[ClassInstall32]
AddReg=AddClass_AddReg

[AddClass_AddReg]
HKR,,,0,%DeviceClassString%
HKR,,Icon,,"-20"

;===========================================================================

[Manufacturer]
%Vendor1%=USBList,NTamd64

[USBList]
%USB\VID_04D8&PID_00DD.DeviceDesc%=WinUsb_Inst, USB\VID_04D8&PID_00DD

[USBList.NTamd64]
%USB\VID_04D8&PID_00DD.DeviceDesc%=WinUsb_Inst, USB\VID_04D8&PID_00DD

[PreCopySection]
HKR,,NoSetupUI,,1

[WinUsb_Inst]
Include = winusb.inf
Needs = WINUSB.NT

[WinUsb_Inst.hw]
AddReg=WinUsb_Inst_HW_AddReg

[WinUsb_Inst.Services]
Addservice = WinUsb, 0x00000002, WinUsb_AddService

[WinUsb_AddService]
DisplayName    = %WinUsb_Service_DisplayName%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\WinUSB.sys

[WinUsb_Inst_HW_AddReg]
HKR,,DeviceInterfaceGUIDs, 0x10000,"{761ED34A-CCFA-416b-94BB-33486DB1F5D5}"

[Strings]
Vendor0="Device Manufacturer Name"
Vendor1="Device Manufacturer Name"
USB\VID_04D8&PID_00DD.DeviceDesc="Device Model Name"
DeviceClassString="NI-VISA USB Devices"
WinUsb_Service_DisplayName="WinUSB Driver"

SERVICE_BOOT_START = 0x0
SERVICE_SYSTEM_START = 0x1
SERVICE_AUTO_START = 0x2
SERVICE_DEMAND_START = 0x3
SERVICE_DISABLED = 0x4

SERVICE_KERNEL_DRIVER = 0x1
SERVICE_ERROR_IGNORE = 0x0
SERVICE_ERROR_NORMAL = 0x1
SERVICE_ERROR_SEVERE = 0x2
SERVICE_ERROR_CRITICAL = 0x3
Cheers,
Cedric
 

Offline cdwijsTopic starter

  • Regular Contributor
  • *
  • Posts: 57
Re: labview driver for MCP2221 in windows 7
« Reply #2 on: July 25, 2016, 01:56:00 pm »
Hi All, I forgot the checkbox "Composite device". Below are the correct steps, I hope this helps anybody. My problem is fixed (for now :-)
1) Disconnect the MCP2221
2) Open NI-VISA Driver Wizzard, choose USB, next, choose Other, then the following message comes up: "It is recommended that you connect your USB device before running the Driver Wizzard in order to ensure compatibility with VISA. Would you still like to install the driver for the unconnected device?" Choose yes. Enter "4D8" and "dd" at vendor ID and Product ID. edit Manufacturer and model name, so it will be obvious this driver is used. Click the checkbox [X] composite device? and enter 4 for number of interfaces. Then click next. Enter a prefix name, and location for the inf file. Next-> Install the generated files on this computer. enter "yes" to the UAC prompt, and then  choose "Install this driver software anyway" to the windows security prompt.
3) Connect the MCP2221. The device manager now shows 2 lines under "NI-VISA USB Devices"

Cheers,
Cedric
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf