Can't get the driver for USB CDC to load

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Can't get the driver for USB CDC to load

Post by garryp4 » Thu Jun 07, 2007 8:16 pm

When I try to load, or point, to the driver in the D:\Swordfish\Library\USB, Windows comes back with "Windows was unable to locate a driver for this device". Device Manager does see a Swordfish Virtual COM Port but it does not show up under the hardware Ports but has the infamous yellow question mark under Other Devices. Any suggestions?

Thanks

garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Post by garryp4 » Mon Jun 11, 2007 6:14 am

So, I have been fighting this since the last post. I've got the same thing happening on 2 different computers, one at home and one at work. I do not know a lot about USB. That is why I paid the $ for SF. USB does not work in the free version so I had to but the full version to try it. What is the chance that whom ever got some of the $ I paid actually send a little help!

I have tried the MechaniqueCDC.inf (even though the included help file twice says "All you need to do is point it towards a simple *.INI file." and lists "MecaniqueCDC.ini", which should be and .inf), copied the text from the "look at it here" into a file named cdc_usb.inf, and used mchpcdc.inf from microchip.

I believe the PIC settings are correct as Windows must be reading something to get as far as displaying the Found New Hardware screen and knowing it is a SF Virtual COM Port. However, here are the settings using the MELabs USB programmer:

PLL Prescaler - /5(20mhz)
System Clock Postscaler - /2(/1)
USB Clock - 96mhz PLL/2
Oscillator - HSPLL
Failsafe Clock Monitor - Enabled
Internal External switchover - Enabled
Powerup Timer - Enabled
Browout Reset - Enabled, SBOREN disabled
Brownout Reset volt - 4.5v
USB Regualtor - Enabled
Watchdog Timer - Enabled
Watchdog Postscaler - 1:1024
CCP2 Multiplexed with - RB3
PortB Reset State - Digital I/O
Low Power timer1 Osc - Higher power
MCLR Function - Reset
The rest disabled or unprotected.

The program is the sample program from the HELP. The board is the PICDEM FS USB demo board from Microchip with an 18F4550 and 20mhz crystal just like the program wants.

Any suggestions?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Mon Jun 11, 2007 9:02 am

> I do not know a lot about USB. That is why I paid the $ for SF.
> USB does not work in the free version so I had to but the full
> version to try it. What is the chance that whom ever got some
> of the $ I paid actually send a little help!

With respect, the chances become slimmer when people make demands like this ;-) Please note you have bought a compiler, not a license to get support should you have problems getting a project to work - although I do try to help out as much as I can.

That aside, it would help if you told me what compiler version you are using. Look in HELP...ABOUT. It should read Version x.x.x.x - ICC x.x.x.x. The OS version you are using would also be helpful. Also, open up 'USBCDC.bas' (which can be found in your library folder). The version number should be 1.1. If it is, then try the following program

Code: Select all

// device and clock...
device = 18F4550
clock = 48

// 20Mhz crystal, 48Mhz internal (FS USB)
config
   PLLDIV = 5,
   CPUDIV = OSC1_PLL2,
   USBDIV = 2,
   FOSC = HSPLL_HS,
   VREGEN = ON

// import modules...
include "usbcdc.bas"

// main program loop - this just simply reads a byte from a
// terminal window (for example, SerialCommunicator) and then
// echos it back...
while true
   if DataAvailable then
      WriteByte(ReadByte)
   endif
wend
Leave the fuses as is inside your programmer. If device manager is showing a yellow exclamation mark next to the 'Swordfish Virtual COM Port' then right click and uninstall. Unplug your demo board and restart your machine. When you machine has restarted, plug in your board. You should now get the 'Found New Hardware' dialog (showing it has detected Swordfish VCP). Do the following steps...

(1) Search - No, not at this time
(2) Install from specific location - Browse to SwordfishCDC.INF file
(3) Warning message, select continue anyway.

If all goes well, the driver should install and you are ready to go. If not, let me know at what point the install fails. Messages and screenshots of the problem would be useful.

Another way to confirm if the PIC settings are OK is to try and program one of the HID examples and see if it enumerates correctly as the HID examples do not require a INF file.

garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Post by garryp4 » Tue Jun 12, 2007 4:49 am

Yeah, sorry about the frustration. Anyway, I went through the whole process again with a reboot and still the same problem. I broke out the laptop that has XP vs. W2k and it loaded right up just like the instructions say. Hmmm. Is this supposed to work in W2K? Will work from the lap top for now. Please let me know if you have got it to work with W2K

SF is version 2.0.0.2 - ICC 1.1.5.1.

Thanks.

garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Post by garryp4 » Tue Jun 12, 2007 9:21 am

While XP did load and Device Manager showed a new com port, I was only able to get one character to come back. While watching the Device Manager screen, the list would go off and back on as if the USB device was being pulled and plugged back in, till eventually the system would not recognize the device. Added an LED toggle at the start of the program and found that the watchdog must have been resetting the PIC, so increased the postscaler to 16384.

Code: Select all

// device and clock...

Device = 18F4550
Clock = 48               // 20Mhz crystal, 48Mhz internal (FS USB)

Config

   PLLDIV = 5,
   CPUDIV = OSC1_PLL2,
   USBDIV = 2,
   FOSC = HSPLL_HS,
   VREGEN = ON

// options...

// import modules...

Include "usbcdc.bas"

Dim  LED0 As PORTD.0
Dim  LED1 As PORTD.1
Dim  LED2 As PORTD.2

Low(LED1)       //
Low(LED2)
High(LED0)      // LED is on
DelayMS(100)    // wait one second
Toggle(LED0)    // switch

// wait for connection...

Repeat
 Toggle(LED2)
 DelayMS(30)   // wait one second
Until Attached

// main program loop - this just simply reads a byte from a

// terminal window (for example, SerialCommunicator) and then

// echos it back...

While true
   If DataAvailable Then
      WriteByte(ReadByte)
      Toggle(LED1)    // switch
   EndIf
Wend
Re-installed the com port and it worked. I have version 1.0 of USBCDC.BAS. Where can I get 1.1?

I also have a question about the .inf file? Why are the 4 lines repeated?

Code: Select all

;------------------------------------------------------------------------------
;  32 bit section for Windows 2000/2003/XP/Vista
;------------------------------------------------------------------------------

[DriverInstall.NTx86]
include=mdmcpq.inf 
CopyFiles=DriverCopyFiles

AddReg=DriverInstall.NTx86.AddReg 

[DriverInstall.NTx86]
include=mdmcpq.inf 
CopyFiles=DriverCopyFiles
AddReg=DriverInstall.NTx86.AddReg 
I retried all this with W2K and still no luck.

Thanks!

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Tue Jun 12, 2007 3:41 pm

Unless you really need to, I would suggest programming without the WDT enabled. If it is a must, take a look at

http://www.sfcompiler.co.uk/wiki/pmwiki ... rdfish.FAQ

You really need to get 1.1 of the library. It has new USB driver firmware and also MecaniqueCDC.INI file. Run the online updates to install, restart the IDE and check the library version again to make sure 1.1 is installed. You really do need these updates to move things forward.

You then need to uninstall the USB CDC driver from your PC, as mentioned earlier in this thread. Then try the sample program exactly as I posted it, again shown earlier...

garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Post by garryp4 » Tue Jun 12, 2007 8:36 pm

What about using W2k vs. XP?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Tue Jun 12, 2007 8:53 pm

The latest Swordfish USB libraries has been tested on W2K by one of the BETA testers and it does work. I have personally tested both HID and CDC with XP and Vista. The XP and Vista testing was very extensive, on multiple machines and USB hubs. If you are asking which OS to go for, then I would recommend XP or Vista.

However, to move things forward I really think you need to try the above first - that is, latest *.inf and Swordfish library files...

garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Post by garryp4 » Wed Jun 13, 2007 9:48 pm

Is there any way I can contact the beta tester? I know that there is some communications between the PIC and the PC w/ W2K as I changed the Descriptor file and have different text appear in the Found New Hardware window.

Also, the HID worked like a champ on W2K.

Thanks for your time.

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Wed Jun 13, 2007 10:02 pm

I've tried it successfully on W2K, but I'll re-test it for you to confirm.

Steve

garryp4
Posts: 126
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Post by garryp4 » Tue Jun 19, 2007 8:51 pm

Any luck with W2K? Sure appreciate the help.

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Fri Jun 22, 2007 9:08 pm

OK, sorry for the delay. I have just tried the code posted by Dave above with W2K and it works on my laptop. It recognised it as a virtual com port and anything I sent from the serial communicator was echoed back successfully. Have you tried uninstalling the device from device manager and then trying again? Check that you have admin rights?

Regards,

Steven

CHRISHODDYSON
Registered User
Registered User
Posts: 9
Joined: Tue Jul 03, 2007 8:55 pm
Location: SOUTHAFRICA

USBCDC

Post by CHRISHODDYSON » Thu Apr 04, 2013 10:05 am

HI

I find that my usb serial device works perfecly fine on 32 bit sysems but when i use it with win7 64 bit things seem to be different and my device is not found.
CHRISO

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Thu Apr 04, 2013 10:12 am

Win 7 will search for the driver, then fail. I've posted some instructions on installing the Firewing driver, which was written in Swordfish:

http://www.firewing.info/pmwiki.php?n=F ... DriverWin7

The Firewing CDC uses the library updated by Jerry:

http://www.sfcompiler.co.uk/wiki/pmwiki ... USBLibrary

Post Reply