[sdiy] PIC Baudrate Converter

Scott Gravenhorst music.maker at gte.net
Mon May 6 16:06:39 CEST 2002


That would work with specialized gear running to/from a serial port, in
which case, no baud rate conversion is required.  What I suspect Laurie
needs to do is use MIDI info transmit to and received from standard,
possibly commercial, MIDI equipment.  In this case, no speed advantage
will be realized, since the standard MIDI device *must* receive and
transmit at 32.25 kilobaud.  Rather, she would realize connectivity to
her PC/MAC computer via the serial port at a standard data
communications baud rate.

I don't have code to offer, but I can imagine it would be fairly easy
to do, since the interface between the serial port drivers is
incredibly simple, no MIDI protocol has to be considered, simply pass
the bytes.  The speed differential is the only issue; I would code to
run all ports from interrupts.  The lower speed transmitter would need
a ring buffer from which to take data since bytes could arrive from the
computer faster than MIDI rate; those incoming bytes would be stored
while the MIDI UART is transmitting.  (BTW, running that side at a baud
rate close to MIDI, as she has spec'd is one thing that limits the
required size of the ring buffer.)  The other side may not need a
buffer at all if the PIC is fast enough to process it's byte (not much
here: simply stuff it in the MIDI side transmitter buffer) which it
probably would be.  The program to do this ought to be rather small, so
there should be plenty of RAM for the ring buffer.  Worse comes to
worst, you would also have to implement hardware flow control on the
high speed transmitter side.

cyborgzero at comcast.net wrote:
>Well, if you are going to try to speed up the midi rate, why not go
>all out and go up beyond that, to, say, maybe 100k or so?
>
>I remember there was a thing called the Lone Wolf that not only sped
>up the xfer but used fiber optics between the modules for long midi
>runs...
>
>Rob
>
>----- Original Message -----
>From: "Laurie Biddulph" <boobies at ozemail.com.au>
>To: "Synth-DIY" <synth-diy at dropmix.xs4all.nl>
>Sent: Monday, May 06, 2002 7:59 AM
>Subject: [sdiy] PIC Baudrate Converter
>
>
>Hi,
>Does anyone have code for a MIDI Baudrate converter? I need two
>modules:-
>
>1) MIDI (31250) to RS232 (38600), and
>2) RS232 (38600) to MIDI (31250)
>
>I will, obviously use two chips for the functions as they will need to
>run simultaneously.
>
>Best Regards
>(Mr) Laurie Biddulph
>http://www.ozemail.com.au/~boobies
>
>Tel: +61 2 4340 1525
>Fax: +61 2 4340 0936
>
>

=========================================================  
- Government: The other religion.
- The media's credibility should always be questioned.
- Lambs who lie down with lions are lunch.

-- Scott Gravenhorst | LegoManiac / Lego Trains / RIS 1.5
-- Linux Rex         | RedWebMail by RedStarWare
-- FatMan: home1.GTE.NET/res0658s/FatMan/
-- NonFatMan: home1.GTE.NET/res0658s/electronics/





More information about the Synth-diy mailing list