View previous topic :: View next topic |
Author |
Message |
just4ho Guest
|
bulk usb demo, more than one devices |
Posted: Wed May 20, 2009 8:23 pm |
|
|
Our company made a measurement device that uses a USB connection.
I have modified EX_USB_SCOPE.C from the CCSC compiler we have bought
It works well so far.
Now we have to connect more than one device at the same PC.
When we connect two devices they are all recognized as ID 0 so PC
application can connect only one of them.
I think I have to change some constant in USB_DESC_SCOPE.H.
Could anyone give me some idea? |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Thu May 21, 2009 1:23 am |
|
|
I've been using CCS USB bulk for a while.
I'm able to connect to one or more devices.
The thing is that I'm using the Microchip API (dll file). The function MPUSBGetDeviceCount returns the number of devices attached and having the same PID/VID. All other functions take the device instance as parameter
ex: 2 devices, Instances: 0 & 1; etc...
Good Luck |
|
|
just4ho Guest
|
I got two more questions. |
Posted: Thu May 21, 2009 8:32 pm |
|
|
thank you for the help.
I got two more questions.
1. The PIC device programmed with EX_USB_SCOPE.C is pluged in the PC and installed with USBDemo.sys file provided by CCS. Can I use the mpusbapi.dll without any modification of EX_USB_SCOPE.C and USBDemo.sys?
2. If then how can I connect the driver from PC software?
When I write c code to connect the device through winapi I write as below
CreateFileA ("\\\\.\\BulkUsbDemoDevice0", // Pointer to the name of the port
GENERIC_READ | GENERIC_WRITE, // Access (read-write) mode
FILE_SHARE_READ | FILE_SHARE_WRITE, // Share mode
NULL, // Pointer to the security attribute
OPEN_EXISTING,// How to open the serial port
0, // Port attributes
NULL); // Handle to port with attribute
Can you give me an example of driver usage or a demo file? |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Fri May 22, 2009 1:05 am |
|
|
Here's what you have to do:
1- Do not modify EX_USB_SCOPE.C
2- Use the Microchip USB driver instead of USBDemo.sys. You'll have to modify the VID/PID section in the .inf file accordingly.
3- Use mpusbapi.dll as API.
4- Enjoy |
|
|
Guest
|
|
Posted: Wed May 27, 2009 5:36 am |
|
|
I have programmed PIC with EX_USB_SCOPE.C with no modification.
Then Used the Microchip USB driver (I modified the VID/PID section same as the firmware).
Then connected the cable and run Microchip’s demo software.
And got the message “Device Not Detected: Verify Connection/Correct Firmware”.
Do you have any Idea what’s wrong? |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Wed May 27, 2009 5:47 am |
|
|
Quote: | Then connected the cable and run Microchip’s demo software. |
Do not use that demo because it's meant to work with different PID/VIP. You have to develop your own program based on the microchip API. |
|
|
|