View previous topic :: View next topic |
Author |
Message |
young
Joined: 24 Jun 2004 Posts: 285
|
USB from Jan Axelson's websit |
Posted: Wed Jan 12, 2005 10:36 am |
|
|
I used the following example for usb development
http://www.lvr.com/hidpage.htm#MyExampleCode
Host
[quote]
Visual C++ 6 code for communicating with custom HIDs, Version 2
Usbhidioc2 is an improved version of my usbhidioc code for Visual C++ (below). The biggest change is that the code uses overlapped I/O to read from the device. If the device isn't responding, the application can regain control and try again or close communications with the device. Tested on Windows 98 SE, Windows 2000, and Windows XP. Other enhancements and minor corrections too.
[\quote]
Fireware
Quote: |
HID code for the PIC16C745
Firmware for the PIC16C745/765 to enable using my hidvb and usbhidioc software. From Microchip. For more PIC advice, see USB Device Development Notes from Alan Macek and USBDemo.
| I program the 16f745 using the downloaded Jademo.hex file
and used a 24Mhz crystal, with connection circuit similiar to
http://www.alanmacek.com/usb/index.html
but my host window showed the following message
Quote: |
***HID Test report***
Device not detected
SetupDiDestroyDeviceInfoListThe Operation completed successfully
|
what caused the problem, did I follow the direction wrong?
Thank you |
|
|
Guest
|
|
Posted: Wed Jan 12, 2005 12:34 pm |
|
|
When I plug the usb into the host, the following error msg occured, How to solve this problem?
Quote: |
An error occurred during the installation of the device.
The installation failed because a function drive was not specified for this device instance. |
|
|
|
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
Wrong crystal |
Posted: Thu Jan 13, 2005 12:31 am |
|
|
You must use a 6MHz crystal - The chip multiplies it to 24MHz.
Take a close look at the circuit diagram on Alan Macek's website |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jan 13, 2005 7:49 am |
|
|
thank you hillcraft:
When I load the Jademo.hex into programmer, the fuse area (OSCILLATOR) is HS with 4x pll, I could not understand what this means, When I check the datasheet of 16c745, it said HS-crystal/resonator (24 MHz), for a 6 Mhz crystal, it is define as E4 or H4, so I think I should use 24Mhz instead of 6Mhz, would you please explain this definition of the four oscilator EC, E4, HS, H4 and what kind of crystal should I use?
Thank you |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jan 13, 2005 9:30 am |
|
|
Iused another program which is ex_usb_hid.c from the CCS example file, this one use HS as the oscilator fuse. and I used a 24Mhz oscilator, on the serial monitor, I can see it continuously send data through usb port, but when I run the usbhidioc.exe program, the same msg ocured, as not device detected. ex_usb_hid send two bytes and receives two bytes as usbhidioc is doing but I could not see anything happeded in the software, why it can not detect the HID I build?
help please. |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jan 13, 2005 9:50 am |
|
|
I think may be I need to change Vendor ID and product ID, but, how can I know my chip's ID if I am using ex_usb_hid.c |
|
|
Guest
|
|
Posted: Thu Jan 13, 2005 5:10 pm |
|
|
How message and package are defined? |
|
|
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
Vendor and product ID |
Posted: Sat Jan 15, 2005 1:04 pm |
|
|
I found that if your descriptor tables etc. were set up incorrectly, and Windows enummerated the device, that it remembered the setup. The effect of this is that you may end up wasting a huge amount of time fiddling with the code, and possible correcting it, but Windows does not realize that it should recreate or reload the driver. The only way around it is to either kill the information from the registry, or to continually change the ID. I spent many many wasted hours until I figured this one out... |
|
|
|