MIDI in with PC900V just won't work

Status
Not open for further replies.

Electric Potato

Well-known member
Hey guys,

I've been struggling to get Teensy 3.1 to register MIDI IN using a Sharp PC900V optocoupler despite trying a number of different configurations.
I've tried, among other things :

the MIDI schematic on pjrc, https://www.pjrc.com/teensy/td_libs_MIDI.html
the official schematic at MIDI.org (http://www.midi.org/techspecs/electrispec.php),

I pulled the PC900v out of an old keyboard and put an IC socket where it used to be, so I'm able to pop it back in and confirm that it works fine.

I also know that the serial port rx1 is all set to receive because if I plug/unplug it from pin 6 on the optocoupler I get jibber jabber in the com monitor like sometimes -1's but usually a string of random larger numbers. When I play notes on any MIDI device however, I just get silence
in the serial port.

I'm stumped because I've copied the official diagram, swapping out the 5V connection for 3.3V connection and lowering the resistor,
which is basically what was done here, just with a different IC: https://forum.pjrc.com/threads/27672-Teensy-3-1-Serial-Midi-Input-Woes
just with a different optoisolator, which worked.

would it matter that I'm using a 1N4001 diode instead of a 1N914 on the DIN jack circuit? In the pjrc schematic it's unlabeled so I figured it's not super important.

Thanks so much for any help, it's been frustrating trying to solve what seems like a really simple problem
 
1N914 is a fast, signal diode. (1N4148 would also be fine, if you have those). 1N4001 is a slow, power diode. I don't know if that is enough to stop it working though.

Check, Pin 2 (shield) on the input DIN connector should *not* be connected. And you have pins 5 and 4 round the right way?
 
hey thanks for taking the time to help me guys, I've switched to the proper diode; I got a 50 pack at RS for 90% off (37 cents) :cool:

but it still doesn't work...Here is my current breadboard. If I fiddle around with the blue or purple wire (the ones with the header pins) I get messages in the serial monitor, which makes me think that it's wrong on the left side of the PC900 with the pin 1 and 2 connections, since I've never gotten a peep from anything over there. I don't have another 220ohm lying around so I strung together 2 100's and 2 10's. The teensy is powered by usb and I've connected the rail to 3.3V, the pin right next to pin 23.

This is really blasting my nuts cause I've checked the scheme over and over, and it seems to be right, and again I've tested the IC in the keyboard it came from and it definitely works. Maybe I'm missing something obvious, I'd be glad if I am. Now my eyes just kinda glaze over when I look in the direction of my breadboard so pending a simple solution I'll probably let it sit for a bit.

MIDI IN WIRE jak.jpgMIDI IN WIRE optoleftside.jpgMIDI IN WIRE ovrhead.jpg

thanks again if you have any ideas!

PS I've also tried different MIDI cables and a couple different DIN jacks in case it was a bad joint but no luck...
 
That wiring looks good.

I'd try powering the PC900 from 5 volts, not 3.3V. That will produce a 0 to 5V signal, but Teensy 3.1's RX1 pin is 5V tolerant, so it should be fine.

For troubleshooting, you might try removing the PC900 and just put a red LED in place of pin 1 and 2. When there's MIDI data, the LED should blink. If you have something transmitting time code or other continuous stuff, it might stay on all the time, but hopefully you'll still be able to observe changes in brightness when you send lots of MIDI data.

If that works, I've put the PC900 back in. Then I'd try connecting the LED plus a 220 resistor from PC900 pin 5 (signal output) to Vcc (5V). The LED should again blink when there's data. It should be the same types of patterns or behavior you observed when it was in the pin 1-2 position.
 
Hey Paul that LED on pin 1 and 2 is a great tip, I wouldn't have thought of that. Anyway, I solved it, and it WAS something simple: I had pin 4 and 5 reversed. The MIDI.org schematic and the datasheet show the pins out of order, ie 1 2 3 5 4 6, and I didn't register that. At a glance it looks like output is pin 5 but it's actually pin 4. All I can say is



















GAHHHHHH..

Anyway thanks very much for your help, I really appreciate it,

peace out
 
Status
Not open for further replies.
Back
Top