Search found 21 matches

by stf92
Fri Jan 31, 2014 6:51 pm
Forum: V-USB
Topic: hidtool read: 'Device or resource busy'.
Replies: 0
Views: 6139

hidtool read: 'Device or resource busy'.

Hi: I ran examples/hid-data/commandline/hidtool: $ hidtool read Error sending message: error sending control message: Device or resource busy $ I checked hiddata.c. In usbhidGetReport I found bytesReceived = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_ENDPOINT_IN, USBR...
by stf92
Fri Jan 31, 2014 2:37 pm
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

Re: usbFunctionSetup and usbFunctionWrite in action?

Well this is code from Objective Development used by Yoshiyasu Takefuji in a Circuit Cellar article from 2008 to control a programmable power supply via USB. As I implemented the circuit as he gave it, I did not touch the usbconfig.h file except for some things, namely, he transferred the voltage va...
by stf92
Wed Jan 29, 2014 1:02 pm
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

Re: usbFunctionSetup and usbFunctionWrite in action?

This is how usbProcessRx ends in my usbdrv.c: }else{ /* not a standard request -- must be vendor or class request */ #if USB_CFG_IMPLEMENT_FN_READ || USB_CFG_IMPLEMENT_FN_WRITE uchar len; replyLen = data[6]; /* if this is an OUT operation, the next token will reset usbMsgLen */ if((len = usbFunction...
by stf92
Tue Jan 28, 2014 11:17 pm
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

Re: usbFunctionSetup and usbFunctionWrite in action?

This is usbdrv.c, the driver source (except the assembler part) which I post along with usbdrv.h:
http://www.filedropper.com/usbdrv
http://www.filedropper.com/usbdrv_1
At the top of usbdrv.c (first link) you'll find what you ask for. Thanks ulao.
by stf92
Tue Jan 28, 2014 7:24 pm
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

Re: usbFunctionSetup and usbFunctionWrite in action?

Thank you. I'm posting a link to the usbconfig.h file:
http://www.filedropper.com/usbconfig

You don't need either to register or login. Just press the 'Download this file' button. The uP in the device is an ATtiny85.
by stf92
Tue Jan 28, 2014 8:56 am
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

Re: usbFunctionSetup and usbFunctionWrite in action?

Thanks for your post. Could you tell me what is wrong with the following attempt to transfer data from the PC to the device via a control OUT transfer? for(i=0;i<8;i++){ buffer[i]= i; } mode=0; ret=usb_control_msg(d, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, mode, 0, 0, (char *)buffer, ...
by stf92
Sat Jan 25, 2014 6:23 pm
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

Re: usbFunctionSetup and usbFunctionWrite in action?

Well, that won't do. What I need is source code. C source code of a usbFunctionSetup example. Thanks anyways.
by stf92
Fri Jan 24, 2014 12:13 pm
Forum: V-USB
Topic: usbFunctionSetup and usbFunctionWrite in action?
Replies: 12
Views: 15333

usbFunctionSetup and usbFunctionWrite in action?

Hi: Any example of a usbFunctionSetup and usbFunctionWrite in action? Of course they are for the user to write them, but has some user tried to transfer data to the device via a control output transfer (8 bytes maximum if I understood it)?
by stf92
Tue Jan 21, 2014 7:17 pm
Forum: V-USB
Topic: usb.h and libusb.
Replies: 0
Views: 6314

usb.h and libusb.

Hi: #include <usb.h> #include <stdio.h> #include <string.h> unsigned short IDVendor= 0x1384; /*VID must be changed. */ unsigned short IDProduct= 0x8888; /*PID must be changed. */ ........................... int main(int argc, char **argv) { usb_dev_handle *d=NULL; unsigned char buffer[3]; int i, mod...
by stf92
Tue Jan 21, 2014 11:15 am
Forum: V-USB
Topic: Does usbPoll() get executed before entry to the ISR?
Replies: 10
Views: 12333

Re: Does usbPoll() get executed before entry to the ISR?

Well then next time I'll include a link to the sources Im working with. There is no DeviceDisconnect, DeviceConnect functions in them. Anyway, my concern was with respect to the thread title, and I now see I was the victim of a blunder (made by me). Now I see that the host interrupts the device (act...
by stf92
Mon Jan 20, 2014 12:44 am
Forum: V-USB
Topic: Does usbPoll() get executed before entry to the ISR?
Replies: 10
Views: 12333

Re: Does usbPoll() get executed before entry to the ISR?

Yes, there is no bouncing in the oscillographs. I got distracted. I was speaking about the time when the device is plugged into the hub jack: deltat3: (TATTDB) This is a debounce interval with a minimum duration of 100ms that is provided by the USB System Software. It ensures that the electrical and...
by stf92
Sun Jan 19, 2014 4:30 am
Forum: V-USB
Topic: Minimal USB implementation
Replies: 13
Views: 15535

Re: Minimal USB implementation

You mean call overhead, I see!
by stf92
Sun Jan 19, 2014 4:27 am
Forum: V-USB
Topic: Does usbPoll() get executed before entry to the ISR?
Replies: 10
Views: 12333

Re: Does usbPoll() get executed before entry to the ISR?

Maybe the image below helps. It shows the USB traffic during device enumeration. "Int active" is high while the interrupt routine is executed, tx during set. If you want to understand the usb protocol, i would recommend you get a logic analyzer with USB protocol support. The saleae suppor...
by stf92
Sat Jan 18, 2014 12:44 pm
Forum: V-USB
Topic: Minimal USB implementation
Replies: 13
Views: 15535

Re: Minimal USB implementation

Why don't you include the CRC routine in usbdrvasm.S. Christian Starkjohann did this in his first implementations. That way the compiler will have nothing to do with it and code will be minimal.
by stf92
Sat Jan 18, 2014 12:23 pm
Forum: V-USB
Topic: Does usbPoll() get executed before entry to the ISR?
Replies: 10
Views: 12333

Re: Does usbPoll() get executed before entry to the ISR?

Well, it's really a pure theoretical question, but with a view to implement the data adquisition part of the program in hardware: bit reading and stuffing. This would let slow or old fashioned microprocessors to interface USB. My knowledge of USB started with the study of this program, which has led...