Previous Entry Share Next Entry
My circuit design process...
This'll have images and probably be boring to non electronics-buffs in the audience.

I mentioned before that I had found Joe Brown's "Ultra-simple" MIDI Synth page, with circuit, and this gave me hope that I could incorporate something like it into my own project.

Here's his circuit:

A few things of note: Joe Brown is in the UK, so "standard" symbols are slightly different that what I'm used to. Also, all connections are shown and pins on the breakout board are labeled, even when they aren't used. The result is a bit cluttered and the function of some of the components were obscure to me. I redrew it, taking advantage that Eagle will automatically connect two wires which have the same name (more accurately, connected wires belong to the same "net", and two nets with the same name are considered connected). This allowed me to separate the functional components, simplify the drawing, and move things around so the function is clearer. The result (for the right-half of the circuit) is this:

In this redrawing, it is clear that GPIO0 and GPIO1 are tied to low and high respectively, and that the reset switch is tied high with a momentary low to reset. It is also clear that the Vcc (5V) is used solely for power, and the 3.3V is used for logic levels -- mainly to keep GPIO1 and RESET high. The capacitors are used solely for power filtering and conditioning.

Comparing this with the schematic of the breakout board, some questions arise. Vcc is used on the BOB to light a power LED and to run two voltage regulators, one generating 3.3V (DVcc) and one generating 3.8V (AVcc), two power levels needed by the VS1103b itself. Raw 5V is not needed anywhere. Is capacitor C2 necessary or even useful? Similarly, GPIO0 is pulled to ground on the BOB, do I need to do it myself?

More concerning is the fact that GPIO1 and RESET are also pulled to ground with 100K resistors. This means that the external pull-up resistors aren't pulling them to 3.3V but rather they are in the middle of a voltage divider and are really 3V. There is also 30uA current flowing through the dividers. I guess it's OK. The current through the reset switch when closed appears to be 0.33mA, which is also OK.

The left output is supposed to be sufficient to drive 30Ohm headphones.

Look at the input side of the picture:

This is essentially identical to the reference MIDI interface in the MIDI 1.0 spec. The MIDI spec calls for a 5mA current loop through the MIDI cable, and opto-isolation on the MIDI IN side. That is essentially what we have here. When no current flows through the cable (MIDI HIGH), the opto-isolator doesn't allow current to flow from pins 6 to 5, so the RX line is pulled high. When current flows through the cable (MIDI LOW), the opto-isolator opens up a low-resistance path between pins 6 and 5, and the RX line is pulled low. It appears that 15mA flows through R2 when RX is low.

The RX line is connected to the RX on the BOB.

For reference, here's how the MIDI out side of the cable looks:

The JP1 connector is a stand-in for the Arduino. We are only concerned with 4 pins off of the Arduino, so I didn't choose the whole set. This connection also resembles the MIDI 1.0 spec's reference circuit.

Note that GND is connected to pin 2 of the connector on the Out side, but not on the In side. That is deliberate to prevent ground loops which can muck up audio.

I've got a problem with the standard MIDI out/in circuits in this situation. I will be drawing my power for the BOB from the Arduino already, which eliminates any effective isolation the 6N138 can give. I won't be using the MIDI connectors (not for this task; I might add them to allow the concertina to talk to other MIDI devices later). Effectively, the only real use of the 6N138 is to convert the 5V on A_TX to a 3.3V signal usable by the VB1103b. Not only that, but the 8-pin DIP takes up a lot of room (it's about 0.5 inch square, which isn't large, but the PCB I'm putting this on is also small.

What I want to do is just connect the TX from the Arduino to the RX of the breakout board. However, the VS1103b datasheet is very clear that more than 3.6V to the digital inputs is bad, and the Arduino output is 5V. I could use a pair of resistors as a voltage divider, but I'm concerned that the pull-up resistor will make computing the proper values a pain. Another option I guess would be to simply put a diode in there, preventing current flow from 5V to the pin, which would get pulled up to 3.3V, but providing a current path when TX is 0V, thus pulling RX low.

Similarly, I would like to get rid of the reset switch for the BOB. The Arduino already has a reset pin which you likewise bring low when you want to reset, and there's a pull-up resistor on the Arduino to bring the pin high unless switched low. However, I believe that my plans for the board will block the reset switch on the Arduino, so it's necessary to make it available. But I can tie the two reset switches together using a diode like I am for the TX line.

OK, if I eliminate everything I said I thought was unessential (the opto-isolator, the capacitors, redundant pull-up/pull-down resistors) and use the diodes to protect the 3.3V-sensitive components, I get something like:

That is deceptively simple, and I'm sure I'm missing something horrid that'll ensure I'll let the smoke out of some crucial chip.

So what am I doing wrong?

  • 1
So. Cool. Don't understand a word of it, but effing cool. :) I am psyched to see/hear the instrument you come up with.

Very good article. I'm using some of the metodes mentioned above and It's working.

Forgive me for being suspicious, but...

1) Your comment was very generic; not obviously out of place, but it would fit in virtually regardless of what I said;

2) I have never heard of you before;

3) Your facebook profile and wall all seem to be pointing to get-rich-quick schemes with no real personal information.

Can you prove you aren't a spambot?

  • 1

Log in

No account? Create an account