[sdiy] Techniques for Multiplying MIDI Clock frequency?

mskala at northcoastsynthesis.com mskala at northcoastsynthesis.com
Fri Dec 24 04:06:09 CET 2021


On Thu, 23 Dec 2021, Brian Willoughby wrote:
> I'm not sure what this "high bandwidth" mechanism is, other than the
> fact that Full Speed is a lot faster than 31.25 kbaud.

I've seen over 40 poll/NAK sequences per frame (maybe over 70; both
numbers are in my memory but I'm not sure the faster one was actually with
working code) between my host and USB-MIDI keyboard when the host had
nothing better to do than poll as fast as it could.  I ended up
implementing a token-bucket rate limiter because I wanted to allow it to
poll more than once per frame, but not at an unlimited rate.  PIC24 16-bit
microcontroller, 16MHz instruction clock; not a hugely powerful computer
there.  Of course, that is with no real MIDI data being sent - it couldn't
be transferring full 64-byte packets at that rate because it would exceed
the bus bandwidth, and the host would also hit some limit on how fast it
could actually do anything useful with the MIDI data.  But I was impressed
that the keyboard had no trouble keeping up with the host.

> My most recent project was to write USB Host firmware without an
> operating system of any kind. It was somewhat annoying because even

On what chip?

Right now, literally in my other terminal tab as I type this, I'm busy
writing up the documentation for my PIC24-based USB MIDI host synthesizer
module, which I'm hoping to release in the new year.  It's been quite an
adventure getting it to work, both because I had no previous USB
experience and because the hardware is only sort-of documented.
Microchip just tells people to use the C-language driver they provide.
For various reasons, I wanted to write my own in assembly language.  I'm
pleased to have that working now and that's why USB-MIDI is fresh in my
mind.

> after the Host was talking directly to the Device successfully, a lot
> more code had to be added to support a Hub between the Host and Device.

It is a hardware erratum of the PIC24 that it cannot be host for a hub
when there is a low-speed device on the bus.  Now, technically, that
wouldn't preclude using a hub with a PIC24 and USB-MIDI devices (because
USB-MIDI is never low-speed...); but it made a good excuse for me to say
that at least in the initial version of my project, I just don't support
hubs, period.  Made my life simpler, and not a huge imposition on the
intended use case of my module.

-- 
Matthew Skala
North Coast Synthesis Ltd.



More information about the Synth-diy mailing list