e-toy Posted August 19, 2007 Report Share Posted August 19, 2007 hi thereI'm on an project for an MIDIO 128 like controller, but I need very long distances between DIN and DOUT (up to 200 meters total) . As I know that the new PIC 18F4685 use an ECAN Bus for linking to slave core Modules and this ECAN are capable to transport Data over long Distances( 40 meters @ 1Mb/sec), I asked myself if I also could use such a PIC for MIDIO 128. Well, I didnt found an answer :( so I try it here ;)My idea is to use a Master Unit Controller wich I can select the Slave Modules and trig the DOUT of the selected Slave Module. In addition I use an MIDI I/O to control every DOUT of every attached slave in realtime. The Slave Modules would be linked with Master over the CAN Bus (long distance)As I'm not an expert in MIOS and C programming (in fact currently I'm an beginner) I have a few questions 1. I think MIOS 1.9 is ported to PIC18F4685 and CAN BUS is accesible. Is MIDIO128 also usable on this PIC and can access to the CAN Bus also ? Is MIDIO128 suitable for my project ? Better ways ?2. Is it possible in MIOS to reduce the Can Bus speed so i can use longer wires (distance to Slave) ? Do I need extra CAN tranceivers ?3. In MBSID CAN it's a onewire solution. What is needet for longer distance ? The slave Modules are Battery Powered. Is a common ground imortant ? May someone can give me a hint ?Thanks in advancee-toyHave made a picture for better visualisation Quote Link to comment Share on other sites More sharing options...
e-toy Posted August 19, 2007 Author Report Share Posted August 19, 2007 have found some answers Do I need extra CAN tranceivers ?Yes What is needet for longer distance ?Two wire solution (differential) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted August 20, 2007 Report Share Posted August 20, 2007 "Found" answers? Where'd you find that? :DMate if I were you I'd just get a pair of those midi over ethernet boxes. Much faster and easier and probably cheaper than developing your own solution in the long run... Quote Link to comment Share on other sites More sharing options...
e-toy Posted August 20, 2007 Author Report Share Posted August 20, 2007 a pair of those midi over ethernet boxesquiet expensive (over 400 bucks) for one pair, or ceaper boxes dont reach enought distance ...maybe theres a good cheap box, but I could't found it. May there's a much cheaper solution ::) what about max distance for DIN/DOUT Signals ? Quote Link to comment Share on other sites More sharing options...
TK. Posted August 20, 2007 Report Share Posted August 20, 2007 The ECAN peripheral is not supported by MIOS itself, it's an application specific function which needs a lot of programming. It isn't a compatible replacement to MIDI, it's just another networking concept. There isn't a step-by-step guide available which explains how to integrate CAN support into MIDIO128 - it can be assumed, that this has to be worked out by a dedicated freak.The maximum distance for DIN/DOUT signals is about 0.5m .. 1m, so this is no feasible solution for your plan.Maybe it would be easier to convert the MIDI signal to RS422. There are transceiver chips, e.g. from Maxim, which can be used for such a purpose. The maximum distance of RS422 is about 1000 m @ MIDI speed (but I never tested this myself)Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
e-toy Posted August 21, 2007 Author Report Share Posted August 21, 2007 okthanks for your infos TKI think I'm not the dedicated freak to solve the Can implementation ::)what about RS422 ?Do you mean instead of the MAX232 an other driver or an RS232 to RS422 converter ?The only problem with RS232/422 is (as far as i know) the unicast.So I can only connect two devices together ???And of course the cables (two twisted pairs for RS422)hmmI'm a bit confused e-toy Quote Link to comment Share on other sites More sharing options...
TK. Posted August 21, 2007 Report Share Posted August 21, 2007 Do you mean instead of the MAX232 an other driver or an RS232 to RS422 converter ?Yes, e.g. the MAX489 could workSo I can only connect two devices togetheryes, but by enabling the MIDI merger you could chain the core modulesSorry, I don't have another idea for a stable solution - maybe somebody else has more experiences with long distance connections?Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
TheAncientOne Posted August 28, 2007 Report Share Posted August 28, 2007 I have sent midi via RS422 in the past, for a lighting application. It was over 10 yeasr ago, and the docs have long gone, but I recall a conversion chipset, and sending the remote power for the receiver over some spare pairs in the cable. I think the chips were TI 75179 etc series, as used in a lot of DMX systems now. You can build a MIDI extender like this quite easily, as I recall: we used the lighting rig unit over about 400m of very electrically noisy environment. Later, one of the guys I worked with did a fancy fibre optic, because they wanted to re run it in the same ducts as the sound gear, and there was some pickup from the RS422 cable, even though both the mic cables and the RS422 were balanced lines, (my half remembered guess is that the amp feeds were single ended). That worked well, but cost a lot more. Nowadays there are a lot of fibre channel GBICs going cheap on ebay, and it might be worth reverse engineering one. With monomode fibre, you could get a 10Km MIDI. Unless you are an expert, don't even think about off the shelf radio link modules, getting full data integrity is not easyTher is a note on how someone did a similar thing here http://www.kmitl.ac.th/~kswichit%20/Rs422/Rs422.htmlWorth looking at:AD7306Chips from Maximinteresting application note from maxim hereST Micro - in 8 pin DIL Quote Link to comment Share on other sites More sharing options...
/tilted/ Posted August 29, 2007 Report Share Posted August 29, 2007 I was going to suggest MIDI to RS485. This is what I use everyday (DMX) in the lighting world. It's a differential, multi-point serial that holds up to 100kb/s at over a kilometer. (So MIDI's 31.25kb/s over 200m should be well-doable.)More's the point, it's three wires (sig+, sig-, GND) + SHIELD and daisy-chainable.Now, RS-485 is more of an electrical specification than a data protocol. What this means is you don't need to follow a standard method of transmitting (you don't anyway, it's your project, right? ;)) So, you could basically convert MIDI directly to RS-485 and back again, with no need to add extra start and stop bits, etc.Hope this helps. Quote Link to comment Share on other sites More sharing options...
audiocommander Posted August 29, 2007 Report Share Posted August 29, 2007 HiI am using shielded 25m cables on an AIN, that's working well if I don't cross high voltage cables (400V). I just had once problems with induction signals. As I'm using this with my Sensorizer, a slight drop of voltage is not the point for me.As you're not saying what you want to do exactly (so I don't know if you're trying to add 100 buttons or 4 step mats), I'd just experiment a bit. The thicker the diameter of the cable the longer it can be. But as TK already said, this won't work for the multiplexed connections between the Core and the modules; this should only work for the module and the connected switch/button/whatever.Another option might be to use two MIDIboxes connected to two computers with (W)LAN. I dunno about PCs, but on Mac OS X there is an inbuilt function to exchange MIDI data between computers over LAN. So, by using two Cores and two Mac Minis or iBooks, you could set up a local LAN or WLAN and exchange MIDI over these laptops.Mabe there are also active MIDI cable extenders? I'm sure that more people want to have longer MIDI cables than 10 m.iirc TTL signals will work from 4.5 to 5.5V; there are digital multiplexers and demultiplexers that can encode and decode digital signals (eg. 4-to-10 and 10-to-4). Therefore you could also set up your own matrix; and even if the 5V drop to 4.5, it should still work. I don't know however, if there are any timing issues.Best,Michael Quote Link to comment Share on other sites More sharing options...
e-toy Posted August 29, 2007 Author Report Share Posted August 29, 2007 Thanks for all your tips !If I understand right, I could attach an RS-485/422 line driver directly to the MIDI Ports to transmit MIDI over longer distance. There are no special Driver needet. right ?The RS-485 multi-point feature sound very nice :)Do I have to use a full duplex line (2 Twisted pair) or does it work also work with half duplex ?I will try to explane what project I'm working on. May it help ;)I need to control some Simple I/O's distributed on an wide space (outdoor). The I/O should have 16 Outputs and 16 Inputs. Every Output switch an Relais. The Input monitors the Output load (is a consumer e.g. lamp, attached proper to the Relais or not) and make it visible with an LED on the I/O.Every I/O should be adressed separatly (may I could use MIDI channels for a max of 15 I/O's).I would use one Core and 4DOUT + 2DIN Module for One I/O I also need a "Remote Control" to switch these Output's on an off. Normal state should be off, after trigger the Output, it should go in ON state (for 10 - 100 ms). The Output load state should be visible also on the "Remote Control". For the "remote control" I would use one core and x DIN/DOUT modules (depends on how much Buttons/Leds would be implemented. I think the MB64 SW could also be usable insted of the MIDIO128because (if it works) I may also would try to implement AIN on the "Remote Control" and AOUT on the I/O Module. So i think the only problem is to transmit the MIDI data over long distance. I know, my english is not very perfect, but I hope you understand what I try to explane. e-toy Quote Link to comment Share on other sites More sharing options...
/tilted/ Posted August 31, 2007 Report Share Posted August 31, 2007 If I understand correctly, you are talking about doing this in a master/slave configuration? Perhaps then, you could do this:[tt]+-------------+ +-------------+ +-------------+| | == Midi Out via RS485 => | | == Midi Out via RS485 => | || Master unit | | Slave unit | | Slave unit || | <= Midi In via RS485 == |==(Merger)===| <= Midi In via RS485 == | |+-------------+ +-------------+ +-------------+[/tt]For this, you would need full duplex RS485, as you are sending and receiving.This would work by turning your Midi Out from Master into a sort of "bus" for talking to all the slaves. Each slave would "listen" to the Midi Out from the master (via Midi In port), but add nothing to it.Assuming that you have several "slave" units, you would then have the monitor midi "bus" running through a merger at each slave unit, (where the slave is talking back to the master, but not listening to any slaves)If you could absolutely be sure that no two slaves would be "talking" at once, you could avoid the midi merger.One way to do this would be to only send a status update from a "slave" when that slave is requested by the master. The master then waits for the update (and/or a timeout period) before polling the next slave, etc.If you only have one master and one slave, you could ditch the merger altogether. Quote Link to comment Share on other sites More sharing options...
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.