Attention all you USB junkies!

Announcements for new builds and MPIDE enhancements
User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Attention all you USB junkies!

Post by majenko » Sat Jul 08, 2017 10:22 pm

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
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

GrahamM242
Posts: 65
Joined: Fri Feb 21, 2014 6:48 pm

Re: Attention all you USB junkies!

Post by GrahamM242 » Tue Jul 11, 2017 5:08 pm

I'll have to take a look when I get some time!

GrahamM242
Posts: 65
Joined: Fri Feb 21, 2014 6:48 pm

Re: Attention all you USB junkies!

Post by GrahamM242 » Tue Jul 11, 2017 6:00 pm

Ok, is it just me or transferring CDC data about twice as fast as it used to be?

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Attention all you USB junkies!

Post by majenko » Tue Jul 11, 2017 6:33 pm

I haven't done any speed tests yet. I'm just rejoicing that it's working...
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Attention all you USB junkies!

Post by majenko » Tue Jul 11, 2017 6:36 pm

Oh, and I have got MZ support working today.

*** YES, WE HAVE USB ON MZ NOW!!! ***
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Attention all you USB junkies!

Post by EmbeddedMan » Tue Jul 11, 2017 8:54 pm

Is CDC/ACM working in high speed?

*Brian

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Attention all you USB junkies!

Post by majenko » Tue Jul 11, 2017 11:34 pm

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.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Attention all you USB junkies!

Post by majenko » Wed Jul 12, 2017 1:20 am

Looks like 5.5MBps. That's megaBytes, not megaBits...
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

GrahamM242
Posts: 65
Joined: Fri Feb 21, 2014 6:48 pm

Re: Attention all you USB junkies!

Post by GrahamM242 » Wed Jul 12, 2017 8:20 am

Nice work!

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

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Attention all you USB junkies!

Post by majenko » Wed Jul 12, 2017 10:12 am

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.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply