Search found 481 matches

by ulao
Fri Nov 10, 2017 6:38 pm
Forum: V-USB
Topic: check if USB is idle
Replies: 2
Views: 3829

Re: check if USB is idle

check for the arrest usbPoll(); //issue at least one for the check below if (USB_INTR_PENDING & (1<<USB_INTR_PENDING_BIT)) // Usbpoll() collided with data packet { uint8_t ctr; // loop takes 5 cycles asm volatile( " ldi %0,%1 \n\t" "loop%=: sbis %2,%3 \n\t" " ldi %0,%1 \...
by ulao
Fri Nov 10, 2017 6:32 pm
Forum: V-USB
Topic: Simultaneous In and Out interrupt transfers
Replies: 6
Views: 4319

Re: Simultaneous In and Out interrupt transfers

Yeah, not going to happen. This is an over,kill but explains why https://forums.obdev.at/viewtopic.php?f=8&t=11102 The v-usb consumes the entire CPU to handle NAK until the driver is ready. You will have no choice but to wait for it to do its thing before sending out. Simultaneous is not achieva...
by ulao
Fri Nov 10, 2017 6:23 pm
Forum: V-USB
Topic: v-usb not really good for control transfers after all.
Replies: 4
Views: 4520

Re: v-usb not really good for control transfers after all.

One small addition. It may be wise to check for the interrupt arrest before enabling. usbPoll(); //issue at least one for the check below if (USB_INTR_PENDING & (1<<USB_INTR_PENDING_BIT)) // Usbpoll() collided with data packet { uint8_t ctr; // loop takes 5 cycles asm volatile( " ldi %0,%1 ...
by ulao
Fri Nov 10, 2017 5:59 pm
Forum: V-USB
Topic: v-usb not really good for control transfers after all.
Replies: 4
Views: 4520

v-usb not really good for control transfers after all.

If anyone has looked in to the v-usb on the wire you will learn a few things... sending the NACK consumes all the CPU time.and this can go on for quite a while. The host only stops sending IN packets right before the end of the frame, to avoid colliding with the 1 ms keep alive pulse. This finally l...
by ulao
Fri Oct 27, 2017 4:01 pm
Forum: V-USB
Topic: Is Data IN endpoint required for HID devices?
Replies: 1
Views: 3626

Re: Is Data IN endpoint required for HID devices?

I'm getting confused by this as well. See my latest post.

The EP0 I though had a default in? Thus no need to make another. I do know in some uses of v-usb it is absolutely needed to create another pipe.
https://stackoverflow.com/questions/141 ... ry-for-avr
So maybe it is just good practices to have an in and out defined.
by ulao
Sun Oct 08, 2017 7:10 pm
Forum: V-USB
Topic: Using Pin change interrupt instead of INT0
Replies: 2
Views: 4002

Re: Using Pin change interrupt instead of INT0

I find this rather interesting, could anyone explain the advantages/disadvantages or reason for wanting to do so? I'm thinking it would allow the device to sync to the usb poll better but not sure I follow the intention.
by ulao
Fri Sep 29, 2017 1:54 pm
Forum: V-USB
Topic: check if USB is idle
Replies: 2
Views: 3829

Re: check if USB is idle

Been going down this road all month.... Do you use any control transfers? If so things get twice as hard. Assuming you have a normal interrupt based USB poll every 8-10ms you can tie everything to the usbpoll. Somewhere in your code you should have a line like so. while (!usbInterruptIsReady()) usbP...
by ulao
Fri Sep 29, 2017 1:47 pm
Forum: V-USB
Topic: USB\DEVICE_DESCRIPTOR_FAILURE
Replies: 1
Views: 3779

Re: USB\DEVICE_DESCRIPTOR_FAILURE

added a 1k5 ohm pullup resistor to D- and 1m ohm pullup resistor to D+. Using the latest code examples that will not work. Or maybe you just failed to explain it right? The 1k5 goes from D- to the (normally middle pin) pull up pin. The Driver turns this pull up on and off. It may work with the righ...
by ulao
Wed Aug 23, 2017 4:54 am
Forum: V-USB
Topic: output report go right to usbfunctinowrite?
Replies: 6
Views: 4791

Re: output report go right to usbfunctinowrite?

Turns out I must have had a corrupt, partial or old version of the driver. I had no reason to suspect that but changing a define blew up the code. So after I re downloaded to fix that I figure I better come back to this bug. Sure enough that also fixes this issue.
by ulao
Sat Aug 19, 2017 1:52 am
Forum: V-USB
Topic: output report go right to usbfunctinowrite?
Replies: 6
Views: 4791

Re: output report go right to usbfunctinowrite?

I did as you suggested but still have the same issue? What can I look at to further this investigation.
by ulao
Mon Aug 14, 2017 3:44 am
Forum: V-USB
Topic: output report go right to usbfunctinowrite?
Replies: 6
Views: 4791

Re: output report go right to usbfunctinowrite?

Looks like we may have another bug here. if(usbRxToken < 0x10){ /* endpoint number in usbRxToken */ change it to this: if(usbRxToken == USBPID_OUT){ /* endpoint number in usbRxToken*/ so this works but breaks control sets where no_msg is used. After more headaches I noticed that the return is causin...
by ulao
Mon Aug 14, 2017 1:47 am
Forum: V-USB
Topic: output report go right to usbfunctinowrite?
Replies: 6
Views: 4791

Re: output report go right to usbfunctinowrite?

Ok I finally found this Using Interrupt- and Bulk-Out endpoints Interrupt- and Bulk-Out endpoints are used to send stream type data to the device. When the host sends a chunk of data on the endpoint, the function usbFunctionWriteOut() is called. If you use more than one interrupt- or bulk-out endpoi...
by ulao
Sun Aug 13, 2017 10:56 pm
Forum: V-USB
Topic: output report go right to usbfunctinowrite?
Replies: 6
Views: 4791

output report go right to usbfunctinowrite?

This is not making sense to me. I have a descriptor that uses a set, get, and 5 outputs. This descriptor is the FFB example by Microsoft. I can show all relevant code if needed but it will dramatically complete things. I rather step my way in to this mystery question at a time. So here is what I cur...
by ulao
Sun Aug 13, 2017 5:13 pm
Forum: V-USB
Topic: Mouse interface to AVR
Replies: 1
Views: 3592

Re: Mouse interface to AVR

You can easily read the mouse with the avr (ps/2 ???) and send the data out as usb with v-usb.
by ulao
Sun Aug 13, 2017 5:11 pm
Forum: V-USB
Topic: Understanding USB better to use V-USB
Replies: 2
Views: 3919

Re: Understanding USB better to use V-USB

use the wiki for a nice read up
http://vusb.wikidot.com/driver-api

the usb read and write are when the data needs to be done in chunks. From the setup you return USB_NO_MSG so the driver can use those read write functions. You must also set the define in the usb config.