Offline
CA

Greetings...

I'm having hard times making arduinoboy work. I checked the wiring 1 billion times and it seems that the optocoupler is buggered. The problem is that I have 6 of them and neither works, which is kinda weird. I'm pretty sure about the pin numbering since I've checked it with the data sheet.

Here's what's going on:

1) I press a key on the midi keyboard and it sends the sequence MIDI ON C5 CH1 - MIDI OFF C5 CH1 I checked that with a MIDI monitor
2) LEDs do not respond on key presses (neither does mGB of course). Arduino is in mGB mode (LED attached to pin 8).
3) I don't have MIDI OUT yet, but in LSDJ master mode LEDs are blinking correctly as music goes from which I assume the LINK pins are also correct
4) Mode switching works fine
5) Multimeter shows 5V on RX and TX pins of Arduino - is it supposed to be so?

I'm using arduino pro mini. Official Sparkfun's one. Powered from the GameBoy

I tried another GB, double checked the link cable - they're fine, tried removing diode - no luck. Since LEDs don't react on keys I assume that signal never reaches arduino. If so then it's an optocouple problem right? Are they fucking different somehow? It's reeeally suspicious that all 6 couples are faulty (however I bought it from the same ebay seller).

But these 5V on RX and TX bother me...

Last edited by friendofmegaman (Jun 19, 2014 7:51 am)

Offline

did you check your midi cables and your interface??

Offline
CA
cyberic wrote:

did you check your midi cables and your interface??

I'm using a midi keyboard and it sends midi messages fine to my laptop. I don't see what could be wrong in this setup sad
Cable's fine so as the keyboard...

Last edited by friendofmegaman (Jun 19, 2014 8:13 am)

Offline
Alabama

What DAW are you trying to use with it?

Offline
CA
MaxDolensky wrote:

What DAW are you trying to use with it?

I'm not using any DAW. It's just a MIDI keyboard plugged into MIDI IN of the arduinoboy and arduino boy is plugged into the link  port of the gameboy. Gameboy has a speaker so I should hear the sound.

Offline
Sweeeeeeden

+5V on RX and TX is nothing to worry about. A positive voltage is the normal idle state of the serial lines. Communication is then started by pulling the serial line low, the so called start bit.

Have you checked that the arduion is correctly programmed, ie that it does the startup blink sequence and can cycle through the modes if a button is attached?

If that is working, something must be wrong on the side MIDI receiving side. Basically recheck everything there. Common errors: the resistor is the wrong value, for example if you misread the exponent stripe so you have a 2,2k or 22k resistor. The protection diode (1n4148) is reversed, which would kill the signal. You may have reversed the two pins coming off the MIDI wire. Or, something may be wrong on the other side of the optocoupler. Check that you didn't confuse the RX and TX lines on the microcontroller board.

Offline
CA

I checked the whole IN circuit several times made sure resistors are good (as well as the values), tried reversing the diode (although I'm using 914 so it shouldn't be reversed) and swapping wires to MIDI jack. Other side of the optocoupler is fine either, the resistor is good, the wires go to RX and 4-th pin in the right order (not swapped).

Startup blinking is fine, mode switching is fine when I press a button the corresponding LED lights up I saw videos on YouTube how it works so this part is correct. Also with LSDJ LEDs blink correctly with the rhythm of the track. But of course for MIDI IN I'm using mGB. Both arduinoboy and mgboy software are the latest versions.

Once I get hold of a camera I'll make a picture of the circuit... So far major suspect is the optocoupler

Offline
Michigan

What opto are you using?

Offline
Sweeeeeeden
friendofmegaman wrote:

(although I'm using 914 so it shouldn't be reversed)

This doesn't make sense. The black marking should indicate the cathode on a 1n914, just like on a 1n4148. And there's no reason you should not reverse the diode either. It should always be pointing the opposite direction to the diode in the optocoupler, or it will mute the signal.

Offline
CA
nitro2k01 wrote:
friendofmegaman wrote:

(although I'm using 914 so it shouldn't be reversed)

This doesn't make sense. The black marking should indicate the cathode on a 1n914, just like on a 1n4148. And there's no reason you should not reverse the diode either. It should always be pointing the opposite direction to the diode in the optocoupler, or it will mute the signal.

Yah I'm sorry I wasn't clear, that's what I meant. Cathode of my 914 is attached to pin 2 - where optocoupler's anode is. Anyways I tried reversing it in case I've confused anode and cathode, but no...

Jazzmarazz wrote:

What opto are you using?

I'm using 6N138 (datasheet: http://www.fairchildsemi.com/ds/6N/6N138.pdf ) Are there other optocouplers that could be used for this purpose?

Anyways my major line of deduction here is that when I press a midi key nothing happens - channel 1 LED doesn't blink and mGBoy is silent. I conjecture that the signal is not getting through the coupler. Midi cable as well as the jack are good. Bollocks how is it possible that 6 optos don't work. I've probably made some stupid mistake I can not track sad perhaps I should disassemble and re-assemble everything again (luckily I'm on the breadboard testing stage now).

Last edited by friendofmegaman (Jun 19, 2014 9:10 pm)

Offline
Taichung, Taiwan

Trash80 says there needs to be a common ground.

Offline
CA
katsumbhong wrote:

Trash80 says there needs to be a common ground.

I have common ground as well as common +5V

Offline
Jelly Stone park, MD USA

I agree that it's unlikely that all your optos are bad.
For the 6n138 circuit, I refer to the MidiBox.org's reference design. Your Resistor values may very, but should be simular to these.
On the Midi side:
PIN 4 of the midi socket goes thru a 220R (Red, Red, Bro) to PIN 2 of the 6n138
PIN 5 of the Midi socket goes to PIN 3 of the 6n138
A 1n4148 is connected between PIN 2 & 3 of the 6n138; Cathode (bar) to PIN 2

On the TTL side of the 6n138:
PIN 5 to GND
PIN 6 to Rx in; with a 1.2K pull-up (Bro,Red, Red; don't confuse with 220R Red, Red, Bro)
PIN 7 thru a 5.6K to GND (Grn,Blu, Red)
PIN 8 to Vcc

You should not have a GND from the Midi cable connected to anything. The Arduino/6n138 and GB should have a common Vcc & GND.

When sending Midi notes, should see lower then +5 V on midi socket PIN 5 or 6n138 PIN 3; most DMMs aren't fast enough to detect the serial bit transitions; just a lower average voltage. Should be lower with higher Midi traffic. A logic probe or a scope should detect the clocking of bits. If no changes are detected, suspect your cables/socket/KB
IF you see incoming Midi bits and you don't see output transitions at 6n138 PIN 6: problem with opto. If you have the transitions on the TTL side @ PIN 6 but no response from the Arduino, suspect wrong wiring, Arduino pin or firmware.

This is all pretty basic, in most cases it 'just works' so in your case it's prob something simple that's been overlooked ( had this bite me a few times)
yogi

Offline
CA
yogi wrote:

I agree that it's unlikely that all your optos are bad.
For the 6n138 circuit, I refer to the MidiBox.org's reference design. Your Resistor values may very, but should be simular to these.
On the Midi side:
PIN 4 of the midi socket goes thru a 220R (Red, Red, Bro) to PIN 2 of the 6n138
PIN 5 of the Midi socket goes to PIN 3 of the 6n138
A 1n4148 is connected between PIN 2 & 3 of the 6n138; Cathode (bar) to PIN 2

On the TTL side of the 6n138:
PIN 5 to GND
PIN 6 to Rx in; with a 1.2K pull-up (Bro,Red, Red; don't confuse with 220R Red, Red, Bro)
PIN 7 thru a 5.6K to GND (Grn,Blu, Red)
PIN 8 to Vcc

You should not have a GND from the Midi cable connected to anything. The Arduino/6n138 and GB should have a common Vcc & GND.

When sending Midi notes, should see lower then +5 V on midi socket PIN 5 or 6n138 PIN 3; most DMMs aren't fast enough to detect the serial bit transitions; just a lower average voltage. Should be lower with higher Midi traffic. A logic probe or a scope should detect the clocking of bits. If no changes are detected, suspect your cables/socket/KB
IF you see incoming Midi bits and you don't see output transitions at 6n138 PIN 6: problem with opto. If you have the transitions on the TTL side @ PIN 6 but no response from the Arduino, suspect wrong wiring, Arduino pin or firmware.

This is all pretty basic, in most cases it 'just works' so in your case it's prob something simple that's been overlooked ( had this bite me a few times)
yogi


I'll try what you suggested when I get home, but it is different from the original Arduinoboy schematic I'd assume that the original should've worked as well... hmm...

Offline
CA

Nope this setup didn't work either. Frankly I didn't expect it to, since the original schematic should work as well. And if latter didn't work, then something is fundamentally wrong...

So I ordered another opto from another manufacturer just in case it really is the cause. In the meantime - is there a way to test an opto? Some quick circuit perhaps?

Because I checked every single other part of the circuit and it is fine. I mean components are not faulty and behave how they are supposed to.


Actually I didn't check the diode, maybe this guy is faulty...

Last edited by friendofmegaman (Jun 20, 2014 3:56 am)

Offline
CA

Diode is good, LED part of the optocupler is also good. Don't know a quick way to check the receiving part of the opto tho...