Midi Out with Teensy 3.6

Status
Not open for further replies.

jadadactyl

New member
Hi all! I'm trying to build a midi program changer and I'm trying to get MIDI out working from my Teensy 3.6 before I add more complexity to the design.

My physical setup involves running TX1 to a 220ohm resistor to pin 5 on a MIDI port. Also running 5v to a 200ohm resistor then to pin 4 on the MIDI port. Finally ground is connected to pin 2 on the MIDI port.

Below is the code I'm trying to use to test if the signal can be received by my synth, but it isn't working!

Code:
#include <MIDI.h>

#define LED 13

MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI);

void setup()
{
  pinMode(LED, OUTPUT);
  MIDI.begin(MIDI_CHANNEL_OFF);
}

void loop()
{
  digitalWrite(LED, HIGH);
  MIDI.sendNoteOn(60, 127, 1);
  delay(1000);
  MIDI.sendNoteOff(60, 0, 1);
  digitalWrite(LED, LOW);
  delay(1000);
}

Any thoughts on what might be happening?
 
I guess that you won't see anything when you connect your oscilloscope to the TX1 pin...

Your code instantiates the wrong serial port. Serial is the virtual serial over USB. The hardware UART on pins 0 and 1 is Serial1.

Thus write MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);

If that does not yet solve the problem, you should take into account that the logic high voltage of the Teensy 3.x is 3.3V and not 5V as on Teensy 2.x and Arduino. You probably need to reduce the value of the TX1 series resistor from 220R to 180R or even 150R. The midi transport does not work with voltage but with current control and the series resistor has to be dimensioned to let 5mA flow when TX1 is active.
 
Status
Not open for further replies.
Back
Top