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

bulk usb demo, more than one devices

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







bulk usb demo, more than one devices
PostPosted: Wed May 20, 2009 8:23 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu May 21, 2009 1:23 am     Reply with quote

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.
PostPosted: Thu May 21, 2009 8:32 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri May 22, 2009 1:05 am     Reply with quote

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








PostPosted: Wed May 27, 2009 5:36 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 27, 2009 5:47 am     Reply with quote

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.
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