Jump to content

IIC MIDI?


stryd_one

Recommended Posts

TK just mentioned something in another thread, and rather than take it off topic, I thought it might be worthy of a thread of it's own...

Short answer: an even more powerful method is the use of the I2C protocol. In the last days I've worked out just another demonstrator, which shows, that this protocol is not only useful for accessing EEPROMs and LCDs from a MIOS core, but also to exchance data with other microcontrollers (see http://www.ucapps.de/mbhp/mbhp_iic_midi.pdf and http://www.ucapps.de/mbhp/mbhp_iic_midi_preview.jpg - this is a II<->MIDI bridge which allows to control multiple MIDI interfaces from a "master" core via I2C

I will write some documentation and especially programming examples to this project after my holidays. In the meantime you could work on the I2C slave routines for Atmel (for PIC I can provide a tested template) - MIOS already provides MIOS_IIC_* functions for I2C master accesses (an OS change is not required)

Another hint: Duggle has worked out a PIC based application for PS/2->MIDI some time ago, you could contact him in order to prevent double-effort. I think that a modification for PS/2<->I2C isn't that difficult

Best Regards, Thorsten.

TK - I saw that image a while ago in a German post, and I have it on my list to ask what it was... now i know :) That looks really great!!

I have been writing a document which I will put on the wiki soon, and I thought you might find this excerpt amusing:

Previously, I mentioned the PIC18F4620, and it’s additional memory allowing for these features to be implemented practically. I also mentioned that there is a EUSART fault (for those who haven’t heard, it’s got a bug and it causes problems with MIDI). If Microchip do not release a fixed silicon revision for this, I will implement a way to send MIDI out through the built-in I2C on PORTC pins of the PIC, to a second, older model PIC. This second PIC will then pass the incoming I2C data as MIDI out. I think that even a PIC16 could do this job, but I plan to use an 18F452. The extra power in the chip will be used to perform MIDI Effects such as transposition, delays, filtering, and LFO’s and Multi-Point Envelopes to sent MIDI CC’s, NRPN’s, SysEx, etc. The reason behind this is just because I feel that if I have to write the special code and possibly make minor modifications to circuitry to send MIDI over I2C, then I will capitalize on it and make the most of it... and the good news is, it will easily be converted to a standalone unit :) Also, I have thought about using several MIDI over I2C slaves, to allow for multiple MIDI Outs, so you could run 32 or maybe more channels.

Looks like we were working on something similar  :D I notice you've used a much cheaper PIC for the slave, which is sensible for a MIDI interface with so many of them... it is a MIDI interface, isn't it :)

I was thinking of MIDI over IIC as a workaround for that annoying 4620 EUSART bug, do you think this would be appropriate? I figured that with the greater speed and lower latency of IIC, there shouldn't be a performance loss, but I could be wrong ;)

Link to comment
Share on other sites

Currently I can only say, that this needs to be evaluated. This is a long process, just consider, that I've to upgrade my own MIDIboxes by PIC18F4620 + I2C slaves, I've to modify the applications, and I've to make some music in order to say: yes, it works ok for daily work

This is a process which can take some months

The MBHP_IIC_MIDI module is just the first step...

Best Regards, Thorsten.

P.S.: I decided to use a PIC16F derivative, because most PIC18F* have an anoying IIC bug! (-> BF flag erratum)

Link to comment
Share on other sites

Currently I can only say, that this needs to be evaluated. This is a long process, just consider, that I've to upgrade my own MIDIboxes by PIC18F4620 + I2C slaves, I've to modify the applications, and I've to make some music in order to say: yes, it works ok for daily work

This is a process which can take some months

The MBHP_IIC_MIDI module is just the first step...

Best Regards, Thorsten.

P.S.: I decided to use a PIC16F derivative, because most PIC18F* have an anoying IIC bug! (-> BF flag erratum)

Don't worry TK, I'm not in a rush :) No pressure here, I have lots of other things to keep me busy (unfortunately!). Maybe in a few months I can help you out with it.

Thanks for the tip about the BF flag! I missed that errata. I'll go with that same 16C then.

Link to comment
Share on other sites

  • 2 weeks later...

Have fun! ;-)

I just have added some programming specifics to the webpage in the hope that they don't confuse newbies that much.

This module is just a nice toy and has a lot of potential for future enhancements :)

Best Regards, Thorsten.

Link to comment
Share on other sites

Thank you TK :)

My imagination is running wild!

Edit: Now I've seen the new page, wow wow wow, THANKYOU TK!

You are helping my musical dreams come true mate. I wish I was a multimillionaire, I would hit that paypal button so hard! As it is, I will send enough maybe for some bier :)

Link to comment
Share on other sites

Hi TK,

I have a question for you.  In thread:

http://www.midibox.org/forum/index.php?topic=2870.0

Someone brings up the use of a MAX3100 for SPI->UART conversion, and you mention that that IC might be the best solution for adding MIDI ports to MIOS.  Behind the scenes did you try this and find it unsuitable, or is it still a possible method to get an extra UART connection to a CORE module?  I've purchased a SpeakJet and am planning on hooking it up to MIOS.

Cheers,

Tom

Link to comment
Share on other sites

Hi Tom,

I haven't selected this chip, since the FIFOs are much too small - 2*8 byte are not enough for heavy MIDI routing compared to 2*96 bytes provided by a MBHP_IIC_MIDI interface.

Also the price is much higher than a PIC16F88.

A single MAX3100 at NewArk: $6.40

A single PIC16F88 at NewArk: $2.66

So - there was no question which chip is the better solution. Although the firmware development wasn't that easy than expected (there are many corner cases in IIC which had to be taken into account) -  but at the end it works stable :)

SpeakJet: now where you mention this, I think it's time that I should also do some experiments with this chip, it's a great companion for MBSID/MBFM

I just have ordered two from the donations I got in the last weeks (thank to all you guys! :)

Best Regards, Thorsten.

Link to comment
Share on other sites

<offtopic>

about the speakjet and about the c64 keyboard.. why not combine that those projects.. then you can just type in the phrases.. and if you wanna tweak you can use the extra keys and some pots and or encoders.. oh and btw.. i want one :D

</offtopic>

Link to comment
Share on other sites

I've been thinking of a combination midi mega-splitter/merger to speed things up and avoid the need to turn everything on if I just want to play with one device.  From first glance, this looks like it would do the job nicely.

Link to comment
Share on other sites

SpeakJet: now where you mention this, I think it's time that I should also do some experiments with this chip, it's a great companion for MBSID/MBFM

Wahoo! :)

I have a speakjet in front of me, but I (now) need either the MAX or another PIC.. I think I'll go with the PIC since it seems to be more versatile.

Cheers,

Tom

Link to comment
Share on other sites

  • 1 month later...

This is probably a stupid question, but I can't seem to find a specific answer, and reading the MIOS v1.9 source isn't leading me to the answer I'm looking for.

Am I reading things wrong, or am I correct in my (new-found) belief that IIC_MIDI cannot currently be used for MIDI input? That is, that input still must be handled by the core's USART and only output can use IIC_MIDI?

And if I'm correct on that, may I ask if there are plans to change MIOS itself so that it may be wholly bootstrapped via IIC_MIDI?

Thanks very much...

-Steve

Link to comment
Share on other sites

MIOS itself only provides a redirection to the IIC MIDI Out, for MIDI In the changes have to be made at the application side, since the MIDI streams have to be merged properly (see MIDI router project).

I don't plan to integrate merging of IIC_MIDI streams into MIOS, since depending on the use case different strategies are required - all the variants would unnecessarily blow up the code.

And if I'm correct on that, may I ask if there are plans to change MIOS itself so that it may be wholly bootstrapped via IIC_MIDI?

This doesn't make much sense:

First of all, this would increase the code size of the 1st level bootloader, so that it wouldn't fit into the 1k range anymore.

Second: the IIC MIDI In is not so performant like the internal EUSART, the optimized polling method would require an additional IO connection which is not possible with most (main) applications (or I would have to reduce features)

Third: there is no (known) bug for the internal EUSART Rx input, therefore it can be used without problems.

So: the MIDI Input of the MBHP_IIC_MIDI module will only be used by special applications like the MIDI router project.

Best Regards, Thorsten.

Link to comment
Share on other sites

What are you up to there c0nsumer?  ;D

It's embarassing, but I'm realizing that I screwed up the first design of my boards. Based on this thread I figured it was 'proper' to use IIC_MIDI for both MIDI in and out. Well, after building the hardware and having things not work, I went digging and came to the realization which prompted the previous question.

By the way, thanks for clearing that up, TK...

It's only a single jumper wire fix, but it's still frustrating, regardless. Ah well, at least I'm learning things as I go along...

Link to comment
Share on other sites

Eh, the problem is more that I thought I could also use it for the MIDI input... But I can't.

The other problem I'm having is that it seems that MIDI IN is stuck on, and I'm not sure why. Output from the 6N138 (on pin 6) is *always* ~5VDC, and I'm not certain why. My layout matches the MBHP_CORE schematic, so maybe I have a bad 6N138?

I also noticed that pin 7 on the 6N138's I see in other designs floating around the internet have pin 7 left floating or tied to ground with a 10K resistor, where MBHP_CORE uses a 5.6K.

So, I'm not sure what's going on yet... I'll poke at it more either tonight or tomorrow once I'm home.

Oh, the reason I think that MIDI IN is stuck on is because when attempting to flash the PIC using MIOS Studio, all I ever see are the same-old SYSEX messages from the core, and nothing I send to it seems to work. Since I don't see the MIDI IN line (to RX on the PIC) bouncing around between 5V and 0V, I'm pretty certain this is where my problem lies.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...