Struggling with Teensy LC and DIN MIDI out

Status
Not open for further replies.
Hi amigos,

Need your help with this from the first glance simple project that I can't get to work.

Tring to send MIDI notes from Midi DIN to the midi USB interface (or synth). Code is super simple, wiring as well but somehow it doesn't work.

That's what I'm trying to do:
td_libs_MIDI_sch_t3.png

This is my setup:
20201017_155605.jpg

And here's the code:
Code:
#include <MIDI.h>

MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);
const int channel = 1;
int led = 13;

void setup() {
  MIDI.begin(MIDI_CHANNEL_OMNI);
  pinMode(led, OUTPUT);
}

void loop() {
  int note;
  for (note=10; note <= 127; note++) {
    digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
    MIDI.sendNoteOn(note, 100, channel);
    Serial.println(note);
    delay(500);
    MIDI.sendNoteOff(note, 100, channel);
    digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
    delay(2000);    
  }
  delay(2000);
}

Led on board is blinking but no notes are coming into the interface (which works, validated it with midi keyboard).

Resistors are 47 ohm, validated with multimeter continuity from each pin to the midi socket.

I'm completely stuck, would appreciate any help or guidance.

Thanks!

P.S. Just realized that my resistors are 5% instead of 1%, could it be the reason?
 
Hah, sometimes it's such an obvious issue you just can't see... :)

Indeed, swapping wires helped. Thanks a lot MatrixRat for the help! Spent 6 hours yesterday debugging that board but haven't tried wapping those wires :eek:
 
Wiring diagrams for MIDI DIN connectors show can show the plug or the socket and the notch up or down.... you are not the first to get it wrong.

FYI resistor values are not crucial so tolerance rating is irrelevant. MIDI org gives different low-value resistors for 3.3 v MIDI. As long as the current is sufficient.
 
Standards are all very well if everybody uses them and some Midi gear manufacturers seem to have their own ideas. One piece of kit I looked at needed around 7.5 Ma for its Midi input.

3.3v Midi output can be a bit flakey and I've noted that various folk have differing ideas of what value the two resistors *should* be. Chances are that if you have a device that needs a bit more current then it is ikely to give you trouble if you try to send 3.3v derived Midi output to it.

I usually use some kind of level shifting buffer between the TX pin and the outside world like a section of a 74HCT125 or 74HCT245 or if I don't want to waste the rest of either chip then I use a couple of transistors to do the job.
 
Status
Not open for further replies.
Back
Top