pauleffect
Member
Hi guys.
I've been toying for a couple of days with RawHID - PC comms. No matter what I do, I can't seem to get over the mind boggling speed of 6kbps. It should be somewhere around 64kbps. So i'm off the mark by a factor of 10...
I'm at my wits end.
I left the tx/rx intervals at 1 ms, both 64byte buffers.
Here's the usb_desc
This is the main loop (and the only thing running)
As for the PC side, I'm using https://github.com/soldernerd/HID_Utility.
Thank you for your time!
I've been toying for a couple of days with RawHID - PC comms. No matter what I do, I can't seem to get over the mind boggling speed of 6kbps. It should be somewhere around 64kbps. So i'm off the mark by a factor of 10...
I'm at my wits end.
I left the tx/rx intervals at 1 ms, both 64byte buffers.
Here's the usb_desc
This is the main loop (and the only thing running)
Code:
void loop()
{
int x;
x = RawHID.recv(bufferReceive, 0);
//Incoming message
if(x>0)
{
//First useful byte marks the start of an individual transfer
if(bufferReceive[1]==0x01)
{
ReceiveLock=true;
digitalWrite(LED_BUILTIN, HIGH);
}
if(ReceiveLock)
{
//TODO stuff with data coming in 64 byte chunks
}
//First useful byte marks the end of the tranfer
if(bufferReceive[1]==0x02)
{
SendingLock=false;
digitalWrite(LED_BUILTIN, LOW);
//Tell the host it's ok, we got what we needed
RawHID.send(bufferOK,0);
}
}
}
As for the PC side, I'm using https://github.com/soldernerd/HID_Utility.
Thank you for your time!