Page 1 of 1

USB Bulk using HID

Posted: 04 Oct 2007 14:08
by PICCmania
mikroC does not have generic USB library. Insted it provides HiD library. When I used it for simple data aquisition project I found that it is impossible to obtain data transfer speed more that 32KB/s(even though USB complete says it is possible at 64KB/s, that i think , might be for bothways 32KB IN, 32KB OUT).

So my question/idea is...IS IT POSSIBLE to simply change the HiD descriptor to BULK descriptor and use HiD functions for bulk transfers, so that we can actually take advantage of USB ?

32KB/s is nothing as compared to the capacity of the on-chip USB of 18F4455 (upto 1MB/s). So i request you to please make a note of this and help developers.

Re: USB Bulk using HID

Posted: 04 Oct 2007 14:24
by zristic
HID example is compiled with HID_INPUT_REPORT_BYTES set to 1. If you change this to 8 or to 64, then you will be able to transfer larger packets in one burst.

There are other variations of HID descriptor here on the forum, use the search option (specifically those posts made by xor).

Posted: 04 Oct 2007 14:42
by PICCmania
Yes, i had already made necessary changes and trying with maximum packet size of 64Bytes and i get 32KB/s with that setting.

Main objective is, can we change the descriptor and use it as a BULK device, still using HiD library functions ?Because I think, interrupt latency(which is 1ms in HiD mode and thus causes limitation of 64Bytes packets per millisecond) is governed by the descriptor(and hence USB controller on chip) and not by HiD library routines. I think HiD routines simply puts data into USB registers and set/resets appropriate bits to start transfer of data.

Posted: 04 Oct 2007 15:07
by zristic
Of course, you can change the descriptor to suit your needs. We tried to make the HID library in such a way that it influenced the transfer speed as little as possible.

Re: USB Bulk using HID

Posted: 15 Dec 2011 19:43
by wakeup12
Hello,

Is it possible to send a interrupt or bulk transfer (e.g. for a hid mouse) using hid functions or should I find another libraries? If it is possible, how can I modify this code?


Init_Main();

HID_Enable(&userWR_buffer, &userWR_buffer);

Delay_ms(1000);
Delay_ms(1000);
while(1) {
Delay_ms(1000);
i=0;
while(i<8) {
if(!HID_Write(&userWR_buffer, 1)) PORTA.B1=1;
else PORTA.B0=1;
}
}

Delay_ms(1000);
HID_Disable();
}

Thank you...