Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Struggling with Teensy LC and DIN MIDI out

  1. #1
    Junior Member
    Join Date
    Nov 2019
    Posts
    5

    Struggling with Teensy LC and DIN MIDI out

    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:
    Name:  td_libs_MIDI_sch_t3.png
Views: 59
Size:  21.2 KB

    This is my setup:
    Click image for larger version. 

Name:	20201017_155605.jpg 
Views:	30 
Size:	92.2 KB 
ID:	22111

    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?

  2. #2
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    163
    Have you tried swapping the orange and white wires?

  3. #3
    Junior Member
    Join Date
    Nov 2019
    Posts
    5
    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

  4. #4
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,376
    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.

  5. #5
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    163
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •