How to add endpoints ?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Backoff

How to add endpoints ?

Post by Backoff » Thu Aug 02, 2007 8:19 am

For my device 4 endpoints of type bulk/interrupt are required. How I can add 2 more endpoints?
Thanks!

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Aug 02, 2007 2:29 pm

More endpoints would require a change in the assembler modules. Since the bits of the endpoint field are scattered over two bytes, we only evaluate one of them.

To distinguish more endpoints, you must reconstruct the full endpoint address, mask it and then compare. There are no spare cycles left in the 12 MHz module. It might be possible to add this feature at 16 MHz, but that's definitely not easy.

Backoff

Post by Backoff » Thu Aug 02, 2007 3:47 pm

Thanks for the answer!
On a site http://www.recursion.jp/avrcdc/ there are source codes from 2007-07-07 in which is present usbdrvasm.S under 12, 16 and 16,5 MHz. It will not suit?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Aug 02, 2007 3:52 pm

This is the latest version of our driver. Yes, it supports 4 endpoints: One control endpoint (0), two interrupt- or bulk-in endpoints and one interrupt- or bulk-out endpoint.

The interrupt-out endpoint can have the same number as one of the interrupt-in endpoints, we therefore need only one bit to distinguish them.

I had the impression that you want 4 interrupt/bulk endpoints. This is not easily possible. If you want to enable the endpoints as described above, see AVR-CDC for an example.

Backoff

Post by Backoff » Thu Aug 02, 2007 4:15 pm

I want to make the composite USB device consisting of three parts.
1. Vendor Request Device (1interrupt-in endpoint)
2. Hid-Class (Keyboard)
3. CDC-Class
Now the my the device consist of items 1 and 2.
I wish add item 3 in my device, it is possible with last version of the driver?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Aug 02, 2007 4:20 pm

I don't think so, because you need separate endpoints for each function in the composite device.

You can share endpoints if the various functions are mutually exclusive and you choose one of them with a configuration value. But that's probably not what you want.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Aug 02, 2007 4:22 pm

Correcting myself: You might be able to share endpoints even if all functions run simultaneously. You can probably use endpoint 0 for all three functions because the function can be distinguished by the request. You can also probably share the interrupt endpoint because CDC does not really require interrupts. Then the two bulk endpoints are free for CDC.

The critical question is whether you can share the interrupt-in endpoint. That's worth an experiment.

Post Reply