Prototyping a Midi to CV module with more functionality than existing offerings

Note that 6N138 is not a great choice for MIDI (though it’s commonly used anyway).

Verify you have the MIDI connector pinout right, it’s easy to get it mixed up and it’s described incorrectly in some places.

0b151f6a0133cc89267121c68bd7b81c7b7e234d_2_500x500

3 Likes

Thanks Analogoutput - I wasn’t aware of those IC options in DIY LC. I did try inverting the connections to no avail. I’ll certainly check out the 6N317 when I next go shopping.

It sounds like you didn’t spot any obvious errors in the layout, so it must be something physically incorrect with my build. I think at this point I’m just going to make a new midi input circuit on a separate daughter board and pipe the connections over.

1 Like

Have you put a scope across the 220R resistor, and from the 6N138 pin 6 to ground?

1 Like

Try using a 100 or 68 ohm resistor instead of the 220r. The LED inside the optocoupler might not be getting enough current to turn on.

1 Like

Thanks for the replies, guys. After literal hours of troubleshooting and ignoring my partner who would like to spend time with me, I finally stumbled across this forum thread recommending I add a 1K resistor from pin 7 of the optocoupler to ground:
https://forum.pjrc.com/threads/54891-MIDI-serial-(DIN)-to-usbMIDI-issues-got-weird-MIDI-messages?p=287082#post287082

This fixed the problem immediately, though not before I’d wasted my time adding a needless extra midi input daughter board thing to my project. With this final hurdle, I think I’ve completed the hardware aspect of this project, and will be moving on to software. I’ve used test code to confirm all my DACs, gates, oled screen, rotary encoder, button, 10 position rotary selector switch, and various midi and USB IO all works, so now comes the simple task of wading through integration hell for a month while ignoring my other life responsibilities. Progress photos coming soon.

2 Likes

This project is in a satisfactory state hardware wise, though I think I may need to come up with a better solution for the reference voltage. Here is a brief photo-journal of the process for anyone interested:













5 Likes

Here is the current hardware feature list. Each element has been tested with a few lines of test code, but much of it is not yet truly implemented in the software:

Midi USB in/out (also used for re-programming)
5 pin midi in (second input available, but not connected to front panel)
5 pin midi thru x 2
64x128 oled screen
rotary encoder with push button for menu
10 position rotary switch (preset selection)
12 buffered DAC outputs (12 bit)
8 gate outputs (5 volt, buffered)

I would like to implement a menu system that allows the function and midi channel for each output to be selected and saved to one of ten preset slots, eventually with assignable paraphony/polyphony groups for the oscillator CVs. Some of this is a ways down the road.

3 Likes

Holy cow, it’s been a long …checks OP date … 6+ weeks of working on this project, and I am super stoked to say that it’s done enough for now.

There are 10 presets that can be copied/saved to EEPROM, and all 12 CV outputs can be mapped to Note (first/last/high note priority available, tuning offset definable), CC (specific cc no. is user definable), or velocity, all of which can be set to a specific midi channel. All gates can also be set to a specific midi channel.

This is a little difficult to describe, so I plan to post a video soon-ish, and clean up my code to go on GitHub. This project saves a ton of space in my rack and has really allowed my synth to come alive in a way it never has before. I am so stoked on this project. If anyone else is interested in building one, I will try to get a guide worked up in the coming weeks. I need to refocus on some other life stuff at the moment, but man does this feel good.

6 Likes

Hi all, this project is really coming together except for one major problem. I think I have set up my voltage reference wrong, because is shifts periodically, throwing off the tuning. I can’t seem to find much literature on designing reference voltages, so I tried to follow LMNC’s example for the reference voltage in the tuner vco, however my adaptation does not seem to be working. Here’s what I did:

edit: the potentiometer there is a 100k trim pot. the desired voltage is right around 2.06 or 2.07 volts

Does anyone know a better way to get a super stable reference voltage, either from the 12v rail or the 5v regulator? thanks a million,
-Wes

I’d think that’d be fine. What exactly are the symptoms? How much is it varying? Is it unstable at the LM4040 cathode?

The datasheet has what you need to design it:

(There’s more details below that.)

Assuming high impedance on your VREF load (is it?), current through the fixed resistor, I_Q+I_L, is (12-4.1)/4.7k = 1.7 mA and through the pot, I_L, is 4.1/100k = 41 µA. So I_Q = 1.7 mA, which is well within the acceptable range, and power on the resistor is 1.7 mA x 7.9 V = 13 mW, which is no problem.

You’ve tried replacing the LM4040?

1 Like

Thanks for the analysis, analogoutput. I found I had connected the shunt incorrectly and had to kludge it, I suppose I can replace it to determine if my earlier error damaged it. I find the vref will vary from about 1.8 to about 2.3 volts. The impedance should be high, since my code activates the input buffers on the DAC vref inputs. I’ll try replacing the shunt. would this circuit in any way benefit from being supplied by the 5v regulator rather than the 12v rail? I’ll do some experimenting tomorrow.

This thing will play beautiful music for hours at a time and then suddenly go out of tune - sometimes between power cycles, other times mid arpeggio. Strangely, the voltage swings all at once, rather than drifting slowly. I’m kinda wishing I’d gone with the DACs that have their own internal voltage ref.

1 Like

I soldered down a new LM4040Aiz-4.1 (my third one at this point) making positive that the orientation was correct. Had a great jam for about half an hour and then boom - VREF swung to about 1.89 and everything went flat. What a head scratcher. I don’t know whether to keep investing time in this or just learn to make custom PCBs and have a proper one made using the DACs that don’t need an external ref. Sad time, I was looking forward to being done with this!

Very strange. Did you measure the voltage right at the LM4040?

@analogoutput , I re-measured right on the LM4040, same result. I don’t know if this is crazy, but is it possible the DACs are reverting from buffered vref to unbuffered ref mode after half an hour or so, thus changing the impedance and causing a voltage drop? Perhaps I need re-write those instructions periodically, or just not write them at all? I’m completely speculating at this point. This problem presented identical symptoms before I tried activating the buffers so they might be totally unrelated.

When you say “same result”, do you mean you see the same voltage drop as you see at the DACs, or do you mean you see the same voltage at the LM4040 as before the drop?

Can you set up a test with the DACs not connected to the reference voltage and see if it still changes?

By “same result” I mean the same voltage drop exists regardless of where I take the measurement. I’m beginning to think the voltage is toggling between just two possibilities, and it goes either too high or too low depending on whether I’ve most recently calibrated it to be correct in the high or low state. It would be very difficult to set up the test you’ve described, but I can try to hack something. Thanks for weighing in.

Something’s very wrong if the voltage at the LM4040 isn’t 4.1 V. I can’t see how that’s possible with the circuit you’ve shown. Unless there’s something wrong with your ground.

I tried using 5v instead of 12v as the input, and re-soldered the connections to ground - still no luck. I measured the LM4040 at 4.07 v (close enough), then waited for a voltage drop event - it measured 3.9, plenty enough to ruin the tuning. I’m at a loss as to how this issue could appear so intermittently. The tuning survived 30 minutes of play, a power cycle, another 30 minutes of play, and then dipped. This happened while I was throwing a really fast sequence at it, but I’m not sure how that could effect things. Quite disheartening. I might have to put this aside for a few days and cool off, but I certainly appreciate the advice.

Try to buffer yourself the 4040 output instead of relying on the DACs buffering and see what happens…

1 Like

No, it’s not. For the LM4040AIZ it should be 4.096 V ± maximum 4.1 mV at 25°C. Well, conceivably that’s your multimeter? But 3.9 V is out of the question. Something’s very very wrong.