Page 1 of 2

Attention all you USB junkies!

Posted: Sat Jul 08, 2017 10:22 pm
by majenko
Over the past couple of weeks I have been working on a new USB stack for chipKIT boards.

This is intended, eventually, to replace the USB support in the core, but for now whilst testing and enhancing it with more devices it is in the form of a standard library you can drop into your favourite IDE.

The new stack gives you easy access to a number of USB device mode profiles which you can mix and match at will:
  • USB Serial Port (CDC/ACM)
  • Keyboard
  • Mouse
  • Joystick
  • MIDI Interface
  • Raw HID
Not all the interfaces to these devices have been fully finalised yet.

As I mentioned you can mix and match them at will. In any combination, and with any quantities, up to the limit of the number of available USB endpoints (15). Note that the USB Serial Port uses 2 endpoints for each instance, but all the others use just one.

At the moment it only supports PIC32MX based boards, but my next task is to work on a PIC32MZ driver for it.

So feel free to have a play and break it. Report bugs back to me either here or on the Github issues page for the repository.

Download from: https://github.com/MajenkoLibraries/USB

Re: Attention all you USB junkies!

Posted: Tue Jul 11, 2017 5:08 pm
by GrahamM242
I'll have to take a look when I get some time!

Re: Attention all you USB junkies!

Posted: Tue Jul 11, 2017 6:00 pm
by GrahamM242
Ok, is it just me or transferring CDC data about twice as fast as it used to be?

Re: Attention all you USB junkies!

Posted: Tue Jul 11, 2017 6:33 pm
by majenko
I haven't done any speed tests yet. I'm just rejoicing that it's working...

Re: Attention all you USB junkies!

Posted: Tue Jul 11, 2017 6:36 pm
by majenko
Oh, and I have got MZ support working today.

*** YES, WE HAVE USB ON MZ NOW!!! ***

Re: Attention all you USB junkies!

Posted: Tue Jul 11, 2017 8:54 pm
by EmbeddedMan
Is CDC/ACM working in high speed?

*Brian

Re: Attention all you USB junkies!

Posted: Tue Jul 11, 2017 11:34 pm
by majenko
It's working in the mode called "high speed" - but is it working "in high speed"? No idea ;)

I need to dig out Paul's test sketch / client.

Re: Attention all you USB junkies!

Posted: Wed Jul 12, 2017 1:20 am
by majenko
Looks like 5.5MBps. That's megaBytes, not megaBits...

Re: Attention all you USB junkies!

Posted: Wed Jul 12, 2017 8:20 am
by GrahamM242
Nice work!

<OT Warning>That makes MZs look a lot more interesting. What boards/chips are currently supported?

Re: Attention all you USB junkies!

Posted: Wed Jul 12, 2017 10:12 am
by majenko
All of them. ;)

One word of warning: that's not the real data throughput speed - that's the speed the computer can throw the data at the chip - the chip is most likely discarding most of it since it can't fit in the serial RX buffer and it's not reading fast enough.

I am about to see if I can set a larger buffer, give it a high-water mark trigger of 1 endpoint packet less than full, and "stall" the endpoint until there is room for at least 1 more full packet. That should give us a more realistic idea of t he real speed of communication. Maybe. If it works.