jeb Posted April 20, 2007 Report Posted April 20, 2007 hello,i have done a midibox (with my own program based on the midiinout128 example)with pots, buttons, etc.i want to add a secondary midi input that will be merged with the first one.i did like in the midi merger project : RA4 (from the PIC of the core, i.e. pin #6) toa second optocoupler with resistors, diode, etc.....do i have to remove the R2 1K resistor if I use the second midi input ?because there is already a 1.2K resistor between PIC RA4 and 5v (provided by the second MIDI (optocoupler, etc.) module (see midimerger.pdf))....what do i have to add in the code ?thanx jeb Quote
lylehaze Posted April 20, 2007 Report Posted April 20, 2007 The PIC18F452 has one UART, so it will only support one MIDI IN unless you have a little help.There is a "IIC" or "I2C" MIDI module that can add another input, or there is a MBNet offering (very recently) that will allow you to network modules together over a CAN bus. This would require a processor change.I'm no expert, but I think those are your options at this time. I'm sure if I got something wrong, then smarter people will correct me.Have Fun,LyleHaze Quote
jeb Posted April 20, 2007 Author Report Posted April 20, 2007 hello,ok if this doesn't work...in fact i don't need to merge 2 inputs...i have to use MIDI IN #1 at a certain moment and MIDI IN #2 at another moment.but never both at the same time.in fact i'm looking for a solution that allow me NOT to unplug one cable and repluganother... that would be boring....is it possible to select one of the two MIDI IN ? (not to merge themif not possible) with a button for example or dynamically in the code that would ""switch"""the input.for the moment i have done it with an inversor (mechanical) switch but it's a bit boring...i would like to switch it from the code ....jeb Quote
lylehaze Posted April 21, 2007 Report Posted April 21, 2007 I think the problem would be if you switched while either one of the signals was in the middle of a message. That would corrupt the message and possibly confuse the UART.It would also require more parts, as there is no way I know of to switch the UART inputs in software._But_, don't let me discourage you. If you are sure that's what you want to do, Enjoy the challenge!LyleHaze Quote
jeb Posted April 21, 2007 Author Report Posted April 21, 2007 hello,1) what happens if i connect the 2 outputs of the 2 octo-couplers (one for each MIDI In)to the same core ?pin 6 of octocoupler 1 (MIDI IN #1) \ ------------- pin 26 of PIC18F (pin RX)pin 6 of octocoupler 2 (MIDI IN #2) /will it work if i'm sure message won't come AT THE SAME TIME (from the differents outputs) ?2) if i do :pin 6 of octocoupler 1 (MIDI IN #1) ---> pin 26 of PIC18F (pin RX)pin 6 of octocoupler 2 (MIDI IN #2) ---> pin 6 of PIC18F (pin RA4 like for the merger project)I want to use the inputs NOT BOTH AT THE SAME TIME.how to tell MIOS that MIDI comes from pin 26 or pin 6 ?3) any other switching option ? apart putting a mechanical switch (that's what i've done!) ?jeb Quote
TK. Posted April 21, 2007 Report Posted April 21, 2007 The MIDImerger project is a very timing sensitive project where the second MIDI In is realised as a software UART. It is not possible to use the same approach if the CPU is loaded with other tasks, so it is especially not possible to use the same approach with MIOS.Solution 1 is not possible, as MIDI lines are current loopsSolution 3: just use two optocouplers, and join the signals with a digital multiplexer. Maybe transmission gates (4066) could also be used.Best Regards, Thorsten. Quote
jeb Posted April 22, 2007 Author Report Posted April 22, 2007 thanx a lot for your response !how to use a digital multiplexer ? (which reference?)which pins are to be connected ?with this solution, will it be real merger ? or is it a solutiononly when we are sure that the MIDI messages fromthe 2 MIDI IN do NOT come at the same time ?thanx in advance !MIDIBOX is great !! Quote
TK. Posted April 22, 2007 Report Posted April 22, 2007 This will be of course no real MIDI merger, but my assumtion was, that this is already clear to you.I cannot give you a schematic for such a multiplexing circuit, but Wikipedia gives you a basic description: http://en.wikipedia.org/wiki/MultiplexerIf this information is not enough, I would suggest to build a seperate PIC based MIDI merger, it's propably easier for you, and it's more powerfulBest Regards, Thorsten. Quote
jeb Posted April 22, 2007 Author Report Posted April 22, 2007 hello,thanx a lot.a multiplexer would be good for me (much cheaper !! and easier thanbuilding a complete core with a PIC...)could you just give me the name of the chip needed (74?? , 74157 ?) and then i promiss i will do it by myself without asking any questions.... ;)thanxjeb Quote
TK. Posted April 28, 2007 Report Posted April 28, 2007 Not sure if this is really the easier solution, as you need to program the routine which switches between the MIDI INs by yourself.74157 would propably work, 74HC257 is a nice one, tooBest Regards, Thorsten. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.