-2

I changed the keil USBHID example like http://www.keil.com/forum/21413/lpc1769-usbhid-example/ and I could send 64 bytes about each 1 ms

my changes is a little different

  in demo.c and demo.h
U8 InReport[64]

U8 OutReport[64]

demo.c
void GetInReport(void) {

for(amiri=0;amiri<64;amiri++)
{
InReport[amiri]=amiri;
}
}

void SetOutReport(void) {
for(amiri=0;amiri<64;amiri++)
{
OutReport[amiri]=InReport[amiri]
}
}

hiduser.c
...
GetInReport();
for(amiri2=0;amiri2<64;amiri2++)
{
EP0Buf[amiri2]=InReport[amiri2];

}
break;

...

case HID_REPORT_INPUT;
for(amiri2=0;amiri2<64;amiri2)
{
OutReport[amiri2]=EP0Buf[amiri2];
}

usbuser.c

...
if(USB_Configuration) {
GetInReport();
USB_WriteEP(HID_EP_IN, &InReport[64],sizeof(InReport));
}
...
void USB_EndPoint1 (U32 event) {
...
USB_WriteEP(HID_EP_IN, &InReport[64],sizeof(InReport));
...
}

and I can receive 64 byte (0 to 63) in C# by libusb

which changes needed for bulk transfer and send multiple endpoints??. I want to reach 1Mbyte/s speed, I know it's possible but I don't know which changes is needed ... can I use Isochronous transfer and send 1000 bytes per milisecond and reach this speed?which changes is nedd for this?

I would be so thankful if someone help me

Amir Poursadegh
  • 101
  • 1
  • 9
  • SO is no code-review site. – too honest for this site Oct 31 '15 at 11:53
  • @olaf he's not asking for a code review. – Russ Schultz Oct 31 '15 at 12:10
  • @RussSchultz: "which changes is ne**e**d**ed** for this?" Implies a code review. As told, this is working code (didn't check, as it is incomplete and very badly formatted&indented). But feel free to pick a different close-reason. – too honest for this site Oct 31 '15 at 12:13
  • But, the question is a bit too broad. Yes, you can use isochronous transfer and send 1000 bytes per millisecond. What changes are needed? Everything is different. go google 'isochronous example'. – Russ Schultz Oct 31 '15 at 12:14
  • @olaf your definition of 'code review' is different than mine, then. – Russ Schultz Oct 31 '15 at 12:15
  • 1
    @RussSchultz: Probably. How do you modify foreign code without a review? (The problem here is it is working code and there is no clear error description - well there cannot, because it is working). Note that I did not recommend to post on code review. Actually, I voted to close as too broad. – too honest for this site Oct 31 '15 at 12:19
  • @olaf Code review is "my code works fine, I think. did I do anything wrong?" This was "I can get HID working, but I need more throughput. How, pls?" The posted code was tangential to the actual question. – Russ Schultz Oct 31 '15 at 12:27
  • my question is not a code review.... I add my changes in keil USBHID example and mentioned I reach the 64000 bytes/second ... and I don't know which other changes is need for bulk transfer and send more than 1 endpoint?this is my main question.... :) – Amir Poursadegh Oct 31 '15 at 12:29
  • @RussSchultz: but isochronous transfer examples are for audio data not for a integer bytes for example.... I thankful for your responses ( you and @olaf) – Amir Poursadegh Oct 31 '15 at 12:43

1 Answers1

0

You could look at the USB CDC example on how to use bulk endpoints on the µC.

There will be many changes, especially on the PC (host) side: You now need a custom driver - I would not trust the windows CDC driver to reach 1MB/sec on a USB full speed connection - YMMV. With newer Windows version one could try to use WCID to load the WinUSB driver. This also means that you have to rewrite the hosts application to use the WinUSB interface.

Turbo J
  • 7,563
  • 1
  • 23
  • 43