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 support@ccsinfo.com

[Resolved] USB & Win Vista error code 10

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



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

[Resolved] USB & Win Vista error code 10
PostPosted: Thu Apr 17, 2008 11:12 am     Reply with quote

Hello,

Just a quick question, I'm using PIC18F87J50 on CCS v:4.066 and Microchip USB bulk driver. On XP it works perfect. On Vista, the PC fails to recognize the device attached (error in driver even if I'm using the latest drivers provided by microchip - framework 2.1). The question: the CCS usb code, is it compatible with win VISTA? do i need updates?

Thanks


Last edited by PICoHolic on Mon Mar 09, 2009 3:44 am; edited 1 time in total
joven



Joined: 30 Jan 2007
Posts: 56
Location: Viana do Castelo - Portugal

View user's profile Send private message

PostPosted: Fri Apr 18, 2008 11:17 am     Reply with quote

hi

can you find a example in http://www.hobbypic.com/
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Apr 18, 2008 11:49 am     Reply with quote

Thanks joven,

But that's not what i'm looking for. I need to stick to the CCS usb API & Microchip bulk usb driver.

Rolling Eyes
AntonioB



Joined: 25 Oct 2007
Posts: 7
Location: Puebla Mexico

View user's profile Send private message

PostPosted: Fri Apr 18, 2008 12:21 pm     Reply with quote

Ok, i don't understand at all what are you trying to do, but if you want yo use USB from Vista it has changed, the all drivers and so don't work now, you need to get new ones, so that should be your problem, i guess you can find out more looking for WinUSB driver, hope it help you.
Tomy



Joined: 23 Feb 2008
Posts: 3

View user's profile Send private message

PostPosted: Fri Apr 18, 2008 6:24 pm     Reply with quote

Have you try new driver from microchip ? it say can use for Vista 32/64bits.
http://ww1.microchip.com/downloads/en/DeviceDoc/Release%20Notes%20for%20MCHPFSUSB%20v1.3.htm
http://ww1.microchip.com/downloads/en/DeviceDoc/MCHPFSUSB_Setup_v1.3.exe
I hope it is what you need.
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Apr 18, 2008 11:55 pm     Reply with quote

Yes i've tried it but no luck..

I even got the newest driver (framework 2.1) and still. no luck :(
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sat Apr 19, 2008 12:12 am     Reply with quote

Maybe Vista isn't a reliable solution. Being an early adopter of Vista puts you in a Starship going were no one has gone before. USB on a Microsoft platform has its own degree of random issues. Now if you enjoy the blue screen of death and unpredictable crashes then you won't be disappointed. Waiting several years and letting others test Vista could be the smart way to go.
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Sat Apr 19, 2008 12:57 am     Reply with quote

I like it Laughing

But i have no other choice Sad
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Apr 25, 2008 11:28 am     Reply with quote

No one is facing such problem !?!??! Shocked

Now i have tha latest compiler version 4.071 and still no luck under Vista.
I'm using the MCP usb bulk driver (framework 2.1)

Rolling Eyes
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Jun 27, 2008 2:29 am     Reply with quote

After doing some investigations and testings, i can affirm that the problem is in the CCS USB firmware API.

I have tried the Microchip latest Vista USB bulk driver on their firmware and t works perfect under Vista.

Now what? Rolling Eyes
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Fri Jun 27, 2008 6:49 am     Reply with quote

Contact CCS

Ken
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 3:43 am     Reply with quote

I had to fix these values to 64 and it worked:

Code:

#define USB_EP1_TX_SIZE    64   //size to allocate for the tx endpoint 1 buffer
#define USB_EP1_RX_SIZE    64   //size to allocate for the rx endpoint 1 buffer
nuwavedc



Joined: 06 Feb 2008
Posts: 17

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 7:02 am     Reply with quote

PICoHolic

Do have enumeration data I can view, I am troubleshooting a similar problem with CCS CDC.
_________________
Thanks,

NuWaveDC
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 7:14 am     Reply with quote

Code:

#define USB_EP1_TX_SIZE    64   //size to allocate for the tx endpoint 1 buffer
#define USB_EP1_RX_SIZE    64   //size to allocate for the rx endpoint 1 buffer


here's my usb_desc.h
Code:

///////////////////////////////////////////////////////////////////////////
////                         usb_desc.h                                ////
////                                                                   ////
///////////////////////////////////////////////////////////////////////////


#IFNDEF __USB_DESCRIPTORS__
#DEFINE __USB_DESCRIPTORS__

#include <usb.h>

//////////////////////////////////////////////////////////////////
///
///   start config descriptor
///   right now we only support one configuration descriptor.
///   the config, interface, class, and endpoint goes into this array.
///
//////////////////////////////////////////////////////////////////

   #DEFINE USB_TOTAL_CONFIG_LEN      32 //config+interface+class+endpoint

   //configuration descriptor
   char const USB_CONFIG_DESC[] = {
   //config_descriptor for config index 1
         USB_DESC_CONFIG_LEN,     //length of descriptor size
         USB_DESC_CONFIG_TYPE,         //constant CONFIGURATION (0x02)
         USB_TOTAL_CONFIG_LEN,0,  //size of all data returned for this config
         1,      //number of interfaces this device supports
         0x01,                //identifier for this configuration.  (IF we had more than one configurations)
         0x00,                //index of string descriptor for this configuration
         0xC0,                //bit 6=1 if self powered, bit 5=1 if supports remote wakeup (we don't), bits 0-4 reserved and bit7=1
         0x32,                //maximum bus power required (maximum milliamperes/2)  (0x32 = 100mA)

   //interface descriptor 0 alt 0
         USB_DESC_INTERFACE_LEN,  //length of descriptor
         USB_DESC_INTERFACE_TYPE,      //constant INTERFACE (0x04)
         0x00,                //number defining this interface (IF we had more than one interface)
         0x00,                //alternate setting
         2,       //number of endpoints, not counting endpoint 0.
         0xFF,                //class code, FF = vendor defined
         0xFF,                //subclass code, FF = vendor
         0xFF,                //protocol code, FF = vendor
         0x00,                //index of string descriptor for interface

   //endpoint descriptor
         USB_DESC_ENDPOINT_LEN, //length of descriptor
         USB_DESC_ENDPOINT_TYPE,     //constant ENDPOINT (0x05)
         0x81,              //endpoint number and direction (0x81 = EP1 IN)
         0x02,              //transfer type supported (0 is control, 1 is iso, 2 is bulk, 3 is interrupt)
         USB_EP1_TX_SIZE & 0xFF,USB_EP1_TX_SIZE >> 8,         //maximum packet size supported
         0x01,              //polling interval in ms. (for interrupt transfers ONLY)

   //endpoint descriptor
         USB_DESC_ENDPOINT_LEN, //length of descriptor
         USB_DESC_ENDPOINT_TYPE,     //constant ENDPOINT (0x05)
         0x01,              //endpoint number and direction (0x01 = EP1 OUT)
         0x02,              //transfer type supported (0 is control, 1 is iso, 2 is bulk, 3 is interrupt)
         USB_EP1_RX_SIZE & 0xFF,USB_EP1_RX_SIZE >> 8,         //maximum packet size supported
         0x01,              //polling interval in ms. (for interrupt transfers ONLY)

  };

   //****** BEGIN CONFIG DESCRIPTOR LOOKUP TABLES ********
   //since we can't make pointers to constants in certain pic16s, this is an offset table to find
   //  a specific descriptor in the above table.

   //NOTE: DO TO A LIMITATION OF THE CCS CODE, ALL HID INTERFACES MUST START AT 0 AND BE SEQUENTIAL
   //      FOR EXAMPLE, IF YOU HAVE 2 HID INTERFACES THEY MUST BE INTERFACE 0 AND INTERFACE 1
   #define USB_NUM_HID_INTERFACES   0

   //the maximum number of interfaces seen on any config
   //for example, if config 1 has 1 interface and config 2 has 2 interfaces you must define this as 2
   #define USB_MAX_NUM_INTERFACES   1

   //define how many interfaces there are per config.  [0] is the first config, etc.
   const char USB_NUM_INTERFACES[USB_NUM_CONFIGURATIONS]={1};

   #if (sizeof(USB_CONFIG_DESC) != USB_TOTAL_CONFIG_LEN)
      #error USB_TOTAL_CONFIG_LEN not defined correctly
   #endif


//////////////////////////////////////////////////////////////////
///
///   start device descriptors
///
//////////////////////////////////////////////////////////////////

   //device descriptor
   char const USB_DEVICE_DESC[] ={
         USB_DESC_DEVICE_LEN,          //the length of this report
         0x01,                //constant DEVICE (0x01)
         0x10,0x01,           //usb version in bcd
         0x00,                //class code (if 0, interface defines class.  FF is vendor defined)
         0x00,                //subclass code
         0x00,                //protocol code
         USB_MAX_EP0_PACKET_LENGTH,   //max packet size for endpoint 0. (SLOW SPEED SPECIFIES 8)
         0xD8,0x04,           //vendor id       (0x04D8 is Microchip)
         0x20,0x00,           //product id 0020
         0x00,0x01,           //device release number
         0x01,                //index of string description of manufacturer. therefore we point to string_1 array (see below)
         0x02,                //index of string descriptor of the product
         0x00,                //index of string descriptor of serial number
         USB_NUM_CONFIGURATIONS   //number of possible configurations
   };


//////////////////////////////////////////////////////////////////
///
///   start string descriptors
///   String 0 is a special language string, and must be defined.  People in U.S.A. can leave this alone.
///
///   You must define the length else get_next_string_character() will not see the string
///   Current code only supports 10 strings (0 thru 9)
///
//////////////////////////////////////////////////////////////////

//the offset of the starting location of each string.
//offset[0] is the start of string 0, offset[1] is the start of string 1, etc.
const char USB_STRING_DESC_OFFSET[]={0,4,24};

#define USB_STRING_DESC_COUNT sizeof(USB_STRING_DESC_OFFSET)

char const USB_STRING_DESC[]={
   //string 0
         4, //length of string index
         USB_DESC_STRING_TYPE, //descriptor type 0x03 (STRING)
         0x09,0x04,   //Microsoft Defined for US-English
   //string 1
         20, //length of string index
         USB_DESC_STRING_TYPE, //descriptor type 0x03 (STRING)
         'M',0,
         'U',0,
         'L',0,
         'T',0,
         'I',0,
         'L',0,
         'A',0,
         'N',0,
         'E',0,
   //string 2
         36, //length of string index
         USB_DESC_STRING_TYPE, //descriptor type 0x03 (STRING)
         'S',0,
         'e',0,
         'r',0,
         'i',0,
         'a',0,
         'l',0,
         ' ',0,
         'C',0,
         'o',0,
         'n',0,
         't',0,
         'r',0
         'o',0
         'l',0
         'l',0
         'e',0
         'r',0
};

#ENDIF

I didn't change anything else...
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