sjakie Posted February 12, 2005 Report Share Posted February 12, 2005 Hi,I was thinking to use the 2com interface to start with in my midibox sid. However at first I thought it would be possible to make a simple switch for midi / serial selection without any changes to the software and reprogramming the pics, but now I am not sure. If it does require re-programming, would the following be ok to add to the main.asm of sid application so I can have my switch function? USER_Init        movlw 0x00     call MIOS_SRIO_TS_SensitivitySet         movlw 0x00 ; common midi     btfss PORTC, 4 ; rd4 is 1 is common midi     movlw 0x01 ; to host     call MIOS_MIDI_InterfaceSet         ...   I would use a 4052 and a switch to switch either the max232 or the 6n138 the rx/tx lines to pic, like so:          +5          |          [ ]10K          |       +--SW-+---- To J14 all cores       |   |       Gnd  |          | 4052          ---------         | S0   |         |     |    Midi RX---|1y1   |    Midi TX---|2y1   |         |     |    COM RX----|1y0   |    COM TX----|2y0  1z|--- Pic RX         |    2z|--- Pix TX         | E S1  |          ---------          | |          +--+            |            GND SW is a simple switch like an on/off switch. So the idea here is that the interface selection is controlled by a simple switch at power on for all cores.Will this be ok, or is there an easier way? ;D Am I missing something?Thanks Quote Link to comment Share on other sites More sharing options...
TK. Posted February 12, 2005 Report Share Posted February 12, 2005 Hi Sjakie,I guess that you want to select the interface depending on PORTD, 4 (and not PORTC, 4)Yes, this should work. But don't forget to bring this pin into TriState mode (bset TRISD, 4), otherwise you will get a short circuitBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
sjakie Posted February 12, 2005 Author Report Share Posted February 12, 2005 Ok great! I can just add the bset TRISD,4 to the user init as the first thing or do I have to change it in mios startup itself?Thanks Quote Link to comment Share on other sites More sharing options...
TK. Posted February 12, 2005 Report Share Posted February 12, 2005 Changing the MIOS startup will be difficult, since the bootstrap loader already enables the driver of this pin.Yes, you can put the TRISD, 4 at the beginning of USER_Init, MIOS won't overwrite this once more.But take care: the driver of this pin will still be initialized at power-on for ca. 2 seconds. And if you would upload another application, you could also run in trouble. Therefore I recomment a resistor (let's say 220 Ohm) between J14 and the switch in order to avoid a short.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
AndrewMartens Posted February 14, 2005 Report Share Posted February 14, 2005 Does this also take into account the different transfer rates of the connections (ie, does the Core have an auto-detect function)? Otherwise you're going to run into trouble with MIDI being 31250 bps and serial being... well, whatever your PC's serial port is set to.Or is this just designed as a switch for the physical connection, and you otherwise have a device that does 31250 bps over an RS-232 link? Quote Link to comment Share on other sites More sharing options...
sjakie Posted February 14, 2005 Author Report Share Posted February 14, 2005 Ok super, thanks Thorsten.Hi Andrew,Yes it runs at different baudrates. It will run at 38400 over serial with a drivers for several OS's available. See the midibox-to-COM page or LTC module. Thorsten already made all this.MIOS has this feature built-in, but normally it is controlled during programming time. This little add-on allows to change the interface type with a switch without the need for reprogramming the device id stuff, so you can easily use it directly with a laptop or in a midi-environment. It is not really auto-detect, but by re-using the J14 (touch sensor) pin, you can let the core (or all cores for the SID) know which interface type to configure. So it is only interface type at a time... Quote Link to comment Share on other sites More sharing options...
MTE Posted November 8, 2006 Report Share Posted November 8, 2006 Hii wanna build this too and started this shematic...it was hard to find out which pins are the right ones ::) so please anyone can tell me is the shematic correct ?I will implement it to LTC board to prevent for max/6N138-exchange ;)RegardsMTE 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.