Baud Rate Conversion to non standard(MIDI)

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I successfully made a MIDI device with velocity sensitive triggers using force sensing resisters and another with accelerometers as single axis drum triggers.

I did this using the atmega168.

My problem is I'm making this device wearable and wireless and the wireless devices are limited to standard baud rates, they're zigbee(DIGI's xbees).

I'm wondering how it would be possible to buffer these signals to the 32.15k rates of MIDI, as I'd like a standard MIDI cable on the recieving radio end.

I only need to send three bytes at a time as these are percussive so I won't be doing chords, so I'm figuring a little propagation delay/buffering wont hurt none.

I've done some research into asyncronous reciever/transmitters with dual clocks but I'd like some advice, maybe what direction to take in research on the matter. Any help at all would be much appreciated.

Thanks in advance,

Kristof

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Send xbee at 38400, use an avr to receive from xbee at 38400, send midi at 31200.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Much appreciated.

The compiler I'm using is the Arduino(Wiring) open source platform, and as far as I know there's no documentation available on how to do that.

Would the chip's buffer accept data at the 38400 rate while running at 32.15k?

I'm a second year electronics tech student, I apologize for my green-ness.

I wouldn't mind scrapping the Arduino environment for something else as long as it's inexpensive.

I was just figuring I'd cache the serial output on a chip and then externally clock it with another crystal but if there's a software fix that would be grand.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, you'll need two uarts - one to receive at 38400 another to transmit at 31.5k. You can implement a software uart to do the transmit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I wouldn't mind scrapping the Arduino environment for something else as long as it's inexpensive.

Studio and WinAVR (if you're on Windows) aren't even inexpensive - they're free :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A lot of different baud rates for MIDI presented in this thread.
AFAIK MIDI runs at 31.250 kbit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
AFAIK MIDI runs at 31.250 kbit

It does. It's a number that's an integer division of 1/2/4/8MHz. For example 1000000 / 32 = 31250

This is because MIDI equipment generally always used "decimal" crystals.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
This is because MIDI equipment generally always used "decimal" crystals.

Yup, figured that out one day.
So the "magic" crystal in this case is rather 16MHz than 20MHz.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well both 16MHz (divide by 512) and 20MHz (divide by 640) can be used to achieve an accurate 31250

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My bad :oops: