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

Thread: Can't get simple MIDI OUT working

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

    Can't get simple MIDI OUT working

    Hi everyone, need you help with my simple MIDI setup.

    I'm trying to send midi notes (and potentially clock) from Teensy LC to TX port using the schematics from https://www.pjrc.com/teensy/td_libs_MIDI.html but without midi in, so basically:
    Click image for larger version. 

Name:	td_libs_MIDI_sch_t3.png 
Views:	6 
Size:	7.2 KB 
ID:	18120

    That's how it looks on the board:
    Click image for larger version. 

Name:	board.png 
Views:	35 
Size:	644.9 KB 
ID:	18121

    But midi devices are not getting any input. Also tried with USB to midi interface (by connecting MIDI OUT from teensy to the interface and monitoring the input on the laptop), but it doesn't recognise any input as well.

    Here's the program itself:
    Code:
    #include <MIDI.h>
    
    int led = 13;
    
    MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);
    const int channel = 1;
    
    void setup() {
      pinMode(led, OUTPUT);
    
      MIDI.begin(MIDI_CHANNEL_OMNI);
      Serial1.setTX(1);
    }
    
    void loop() {
      int note;
      for (note=10; note <= 127; note++) {
        Serial.println(note);
        digitalWrite(led, HIGH);
    
        MIDI.sendNoteOn(note, 100, channel);
        delay(1000);
        MIDI.sendNoteOff(note, 0, channel);
    
        digitalWrite(led, LOW);
        delay(1000);
      }
      delay(2000);
    }
    What is also strange that my Usb to Midi interface doesn't seam to "detect" the input -- it has two leds that blinks when it receives incoming MIDI or sends outgoing, but it doesn't seam to be triggered when connected to teensy.

    Is there anything wrong in my setup?

    Thanks in advance.

  2. #2
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,238
    Any chance you have connectors 4 and 5 switched at the DIN connector?

    There is always some ambiguity in sorting out if the connector is shown from the face or connection side.

  3. #3
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,176
    Your code works for me with the same circuit wired to the connector "face".
    If you have a multimeter with continuity tester, check that the continuity from the T3.2 ground pin to the breadboard ground rail is good. The solder connection on the ground pin looks like it might not be making good contact. The other two pins look like they might be OK but check their continuity as well.

    Pete

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,822
    Those pins don't look like they're soldered properly!

    Here are the step for successful soldering.

    Click image for larger version. 

Name:	soldering.png 
Views:	2 
Size:	125.1 KB 
ID:	18126

    Step 2 and 3 are critically important, especially feeding the solder into the point closest to the 2 surfaces. Solder has a "flux" chemical inside which cleans the 2 metal surfaces as you feed it in. If you touch only 1 of them with the solder, or worst of all melt some solder on your iron before touching the pad and wire, you won't get any of that essential flux chemical onto both metal surfaces. The continued heating after you withdraw the solder is also really important, so all 3 metals are heated to a uniform temperature. If you withdraw the iron too quickly, they will be at different temperatures and will not cool down together to form a strong bond.

    Also watch this quick video Robin & Erin made to demonstrate how to solder these sorts of pins.


  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,822
    Oh, also, check those resistors with a multimeter.

    Normally the colors for a 47 ohm 1% resistor should be yellow, violet, black, gold, brown.

    I can't quite tell what color that 4th stripe is, but it doesn't look like gold. If it's red or brown, those would be mugh higher resistors that would prevent enough current from turning on the LED input on whatever you're trying to whereever send the MIDI signal.

  6. #6
    Junior Member
    Join Date
    Nov 2019
    Posts
    3
    Thanks for replies and great soldering tutorial PaulStoffregen!

    Checked my resistors with multimeter and they are actually 47 kohm. So my lame mistake.

    Will try to get proper ones and also solder pins correctly.

    Thanks again for your help everyone!

  7. #7
    Junior Member
    Join Date
    Nov 2019
    Posts
    3
    Unfortunately correct resistors didn't fix the problem -- they got me one step closer but still not completely there

    Now my midi interface detects that MIDI IN is connected (led on the interface lights up), but still no notes are coming in.

    From time to time I see couple of thousands empty messages like this sent within few seconds:
    Click image for larger version. 

Name:	Screenshot 2019-11-09 at 09.32.40.png 
Views:	3 
Size:	47.6 KB 
ID:	18152
    but it probably due to some drops in current as they all always look the same.

    I've also measured current on both 3.3v after resistor and on GPIO pin (tried 1 and 10) after the resistor, and the interesting thing is (at least to me since I don't understand why it's happening): before I connect midi cable current on 3.3v after the resistor is 3.2V (the same as on GPIO after the resistor), but as soon as I connect MIDI it drops to 0,23V while current on GPIO pin stays the same (3.2V).

    Is it supposed to work like that?

    Another theory I have is that perhaps I burned something on the Teensy while lame-soldering?

Posting Permissions

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