CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB CDC 32 vs 64 bits

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
chilense



Joined: 11 May 2010
Posts: 3

View user's profile Send private message

USB CDC 32 vs 64 bits
PostPosted: Tue May 11, 2010 7:54 am     Reply with quote

I have a USB CDC hardware that works ok when plugged in a PC with Windows XP 32 bits, but when I plug it into a XP 64 bits, it won't even enumerate (so this is even before getting the driver to work).

When you check on Device Manager and view the ID of the hardware it says unknown..... it also says VID_0000\PID_0000

Has anyone had this issue?
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Tue May 11, 2010 9:34 am     Reply with quote

Use the driver provided by Microchip and modify the inf file for CCS.

inf file:
Code:


; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation
; Copyright (C) 2007 Microchip Technology Inc.

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
LayoutFile=layout.inf
CatalogFile=%MFGFILENAME%.cat
DriverVer=11/15/2007,5.1.2600.0

[Manufacturer]
%MFGNAME%=DeviceList, NTamd64

[DestinationDirs]
DefaultDestDir=12


;------------------------------------------------------------------------------
;  Windows 2000/XP/Vista-32bit Sections
;------------------------------------------------------------------------------

[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,,,0x20

[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys

;------------------------------------------------------------------------------
;  Vista-64bit Sections
;------------------------------------------------------------------------------

[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg

[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,,,0x20

[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64

[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys


;------------------------------------------------------------------------------
;  Vendor and Product ID Definitions
;------------------------------------------------------------------------------
; When developing your USB device, the VID and PID used in the PC side
; application program and the firmware on the microcontroller must match.
; Modify the below line to use your VID and PID.  Use the format as shown below.
; Note: One INF file can be used for multiple devices with different VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_0461&PID_0033

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_0461&PID_0033


;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------
;Modify these strings to customize your device
;------------------------------------------------------------------------------
[Strings]
MFGFILENAME="mchpcdc"
DRIVERFILENAME ="usbser"
MFGNAME="Microchip Technology, Inc."
INSTDISK="Microchip Technology, Inc. Installation Disc"
DESCRIPTION="Communications Port"
SERVICE="USB RS-232 Emulation Driver"


Get the usb framework first: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2651&param=en534494

Good luck
chilense



Joined: 11 May 2010
Posts: 3

View user's profile Send private message

PostPosted: Wed May 12, 2010 12:23 pm     Reply with quote

I am using the supplied driver but the issue is even before getting to install it since the device is not recognized by the OS.
If I take a look at the device VID and PID in the device manager, I get 0000 id's.
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Wed May 12, 2010 4:35 pm     Reply with quote

Anyway, the driver supplied by CCS does not support 64-bit.
ariel.vollmann



Joined: 23 Jul 2009
Posts: 7
Location: Córdoba - Argentina

View user's profile Send private message MSN Messenger

PostPosted: Sun Aug 01, 2010 1:13 am     Reply with quote

I have the same problem with Windows 7 64bits.
When the PIC is trying to enumerate it looks that an error happens and the device disconnects and connects again... The VID & PID are zeroed in the device manager.
Did you find a solution for this issue?
On XP 32 bits there is no problems and the PIC is recognized as an serial port.
Can someone help me?
Thanks a lot in advance!
_________________
Greetings from Argentina!
lucasromeiro



Joined: 27 Mar 2010
Posts: 167

View user's profile Send private message

HID
PostPosted: Sun Aug 01, 2010 9:30 am     Reply with quote

Hello, I could not solve the problem. I found another solution: Set to use the usb as HID (Human Interface Device). From what I read does not need any driver in the system, because this driver has all systems, it is a driver generico. But I still dont know how to use HID as if by chance anyone knows please help!
It seems that the HID mode is much more versatile and interesting for us!
Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Mon Aug 02, 2010 4:16 am     Reply with quote

PICoHolic wrote:
Anyway, the driver supplied by CCS does not support 64-bit.

Actually it does, but only on recent compilers....
I think it changed at about 4.107, but from then on, the .inf file (not a driver....), includes entries for the 64bit OS's.

Best Wishes
ibanitescu



Joined: 19 Aug 2010
Posts: 1

View user's profile Send private message

USB CDC 32bits XP
PostPosted: Fri Aug 20, 2010 1:18 am     Reply with quote

Hello,

I have a PIC18F2455 and I am trying to communicate with PC using USB connection. I want my device seen as CDC (USB mass storage, HID don't satisfy myself). I have an 8MHz quartz. I can program it, but when I introduce the device in the USB, the USB host allocates current and voltage for it (I can light up some LEDs), but it displays on taskbar: USB device not recognized.

A friend of mine suggested me to use a 20MHz crystal oscillator, but I believe that settings are important:
Code:

#FUSES HSPLL                           //High Speed Crystal/Resonator with PLL enabled
#FUSES PLL2                     //Divide By 2(8MHz oscillator input)
#FUSES USBDIV                   //USB clock source comes from PLL divide by 2
#FUSES CPUDIV2                  //System Clock by 2
#FUSES VREGEN                   //USB voltage regulator enabled
#use delay(clock=48000000)

As for HARDWARE, D+, D- are ok connected, VUSB has a capacitor 470nF to GND, D+ has a pull up resistor connected to VUSB.
I believe hardware is OK.

I was presented settings, hardware, as for the code I included:
USB_cdc.h, usb
usb_desc_cdc.h
and before infinite loop I have:
Code:

#use standard_io(A)
   usb_cdc_init();
   usb_init();
   while(!usb_cdc_connected())
   {
   }


If you have any suggestions, about the code, or the suggestion to move to 20MHz oscillator.
Thank you.
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Fri Aug 20, 2010 7:13 am     Reply with quote

There is no advantage to using 20MHz over 8MHz.
There are though some problems with your settings.
The first is CPUDIV2. This does not give 48MHz operation.
This is down to an 'oddity' in the hardware, and CCS's nomenclature. The CPU dividers, have different 'meanings', when running off an external clock input, and the internal PLL. So:
Code:

Division pattern             CCS name     /x external clock /x PLL
00                         CPUDIV1       /1                      /2
01                         CPUDIV2       /2                      /3
10                         CPUDIV3       /3                      /4
11                         CPUDIV4       /4                      /6


So, to get /2, when using the internal PLL, requires you to use CPUDIV1, not CPUDIV2.....
The CCS 'names' are the divisions given when using the external clock, not the divisions given when using the internal PLL. You must use the data sheet, and translate to get the required values. :(

You then talk about using an external pull-up resistor. Have you turned off the internal resistors?. The CCS driver defaults to enabling the internal pull-ups. You need to either modify the code to turn these off, or remove your external resistor.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group