|
|
View previous topic :: View next topic |
Author |
Message |
KONAMI
Joined: 29 Aug 2010 Posts: 11
|
USB VID&PID 0x0000 |
Posted: Fri Nov 04, 2016 6:00 am |
|
|
Hello there:
I using CCS C V5.01.
I'm designing simple CDC board.
Here is my code
Code: |
#include <18F2550.h>
#device ADC=10
#fuses HSPLL,NOMCLR,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOPBADEN
#use delay(clock=48MHz,USB_FULL)
#define USB_CONFIG_PID 0x0033
#define USB_CONFIG_VID 0x0461
#include <usb_cdc.h>
#include <usb_desc_cdc.h>
void main()
{
setup_adc_ports(AN0_TO_AN7);
setup_adc(ADC_CLOCK_DIV_2|ADC_TAD_MUL_2);
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
usb_cdc_init();
usb_init();
while(TRUE)
{
usb_task();
if(usb_enumerated())
{
if(usb_cdc_kbhit())
{
char b;
b=usb_cdc_getc();
switch(b)
{
case 'a': output_high(PIN_C0);
usb_cdc_putc('a');
break;
case 'b': output_high(PIN_C1);
usb_cdc_putc('b');
break;
}
}
}
}
it compile well.
When I start simulation on Proteus, Windows(XP) detect new device.
The problem is that it say "unknown device".
I many time check clock and nothing is wrong.
Finaly I tried to simulate old project(working) it work great, I use v4.032 to build it.
But when I compile it again it make samething("unknown device")
I see in properti of device that USB_VID =0x0000 and USB_PID=0x0000
that why I force CCS C value.
But it make tha same
Could forum help me please! |
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19492
|
|
Posted: Fri Nov 04, 2016 8:03 am |
|
|
5.01, is not a legitimate version number....
What is your version?.
However there is a big change with V5. The older CCS compiler generates a device with VID=0461, and PID=0033. V5 generates a device with VID=2405, and PID=000B. There is a certified driver for this PID/VID with the compiler.
The old combination, was actual from a MicroChip example. The new one is one that CCS have paid for, and got a proper registered driver for, so it'll work with later OS's like W10.
So you need to be loading the new driver, not the old one for the new VID/PID, or it won't be recognised. |
|
|
KONAMI
Joined: 29 Aug 2010 Posts: 11
|
|
Posted: Fri Nov 04, 2016 8:27 am |
|
|
I'm using Windows XP
Compiler is 5.025
What should I do so that Windows Xp detect this configuration:
Code: | 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 - manufacturer
8, //length of string index
USB_DESC_STRING_TYPE, //descriptor type 0x03 (STRING)
'C',0,
'C',0,
'S',0,
//string 2 - product
32, //length of string index
USB_DESC_STRING_TYPE, //descriptor type 0x03 (STRING)
'C',0,
'C',0,
'S',0,
' ',0,
'U',0,
'S',0,
'B',0,
' ',0,
't',0,
'o',0,
' ',0,
'U',0,
'A',0,
'R',0,
'T',0
}; |
|
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
Re: USB VID&PID 0x0000 |
Posted: Fri Nov 04, 2016 9:13 am |
|
|
KONAMI wrote: | When I start simulation on Proteus...[snip] |
Have a look at the sticky at the top of the forum regarding proteus. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19492
|
|
Posted: Fri Nov 04, 2016 10:00 am |
|
|
and to his question about 'Xp detect this', this is the string descriptor. You don't get to this till after the device descriptor descriptor is recognised.
XP will recognise the standard supplied CDC descriptor _if you load the driver supplied with the compiler_. |
|
|
KONAMI
Joined: 29 Aug 2010 Posts: 11
|
|
Posted: Fri Nov 04, 2016 10:39 am |
|
|
I'm asking what should I do so that compiler compiles the decriptor, because I check it when I plug in physical board. I can only see USB PID =0x0000 and USB VID=0x0000. What did I miss so that XP detects "unknown device". |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19492
|
|
Posted: Sat Nov 05, 2016 3:54 am |
|
|
Your sample code, has INT_RDA enabled, but no sign of a handler for this.
If you have not got an RDA handler, this would give VID=0000, and PID=0000, as the enumeration will fail, with the PIC locked trying to handle the serial..... |
|
|
|
|
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
|