Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC32MX795F512H improving USB speed

Status
Not open for further replies.

TheMartian

Junior Member level 3
Joined
Jul 6, 2018
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
322
Dear all, I've made a little experiment with HID library in mikroC for PIC32MX795F512H clocked at 80MHz with 8MHz crystal.
This is my code:
Code:
void main(void){
  AD1PCFG = 0xFFFF;                        // Configure AN pins as digital I/O
  JTAGEN_bit = 0;        // Disable JTAG
  USBIE_bit = 0;
  IPC11bits.USBIP = 7;
  EnableInterrupts();
  HID_Enable(&readbuff,&writebuff);
  while(1){
    while(!HID_Write(&writebuff,64))
      ;
  }
}
It just spams the computer with HID packets, each 64 bytes. The second while just wait until the packet is sent.

On PC side, I made a simple application which is receiving all USB HID incoming data and counts time. I used time and data size to calculate transfer speed, and the result is around 65KB/s.
My question is, guys, is this the maximum speed of USB communication that this PIC can do or what I am missing?
 

Check out the HID protocol spec: https://www.usb.org/developers/hidpage/HID1_11.pdf - Section 5.6 'Reports'.
It states that there can only be one HID transaction per frame and this has a maximum size of 64 bytes. Therefore that is 1 64-byte packet every mSec so you are getting all you can from a HID transfer.
If you want greater throughput then you will need to use other protocols.
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top