3.3 volt 5 pin midi out question

Hi! I'm using the 3.3 volt itsy bitsy and trying to transmit midi out notes via 5 pin MIDI. I'm using this super basic example as the code (below).

This same code works fine with a 5 volt Uno with a 5 pin midi out hat AND with the same pins through the classic 220 OHM resister setup.

However, I can't get it to work with Itsy Bitsy. This is the setup:

3.3 volt out on Itsy through a 33 ohn resister to pin 4 of the midi out panel mount (which the cable plugs into).
Pin 1 of the itsy (Tx) through 10 ohm resister to pin 5 of the panel mount.
Ground on itsy to 2 on panel mount.

Any thoughts on why this might be?

  MIDI note player

  This sketch shows how to use the serial transmit pin (pin 1) to send MIDI note data.
  If this circuit is connected to a MIDI synth, it will play the notes
  F#-0 (0x1E) to F#-5 (0x5A) in sequence.

  The circuit:
  - digital in 1 connected to MIDI jack pin 5
  - MIDI jack pin 2 connected to ground
  - MIDI jack pin 4 connected to +5V through 220 ohm resistor
  - Attach a MIDI cable to the jack, then to a MIDI synth, and play music.

  created 13 Jun 2006
  modified 13 Aug 2012
  by Tom Igoe

  This example code is in the public domain.


void setup() {
  // Set MIDI baud rate:

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):
  for (int note = 0x1E; note < 0x5A; note ++) {
    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, note, 0x45);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, note, 0x00);

// plays a MIDI note. Doesn't check to see that cmd is greater than 127, or that
// data values are less than 127:
void noteOn(int cmd, int pitch, int velocity) {

I am now trying to get this sketch to transmit ANYTHING at all. I had the idea that maybe Serial is for the usb port only and I need to be using Serial1. I am trying this but still can't get it to transmit anything to the UNO. I feel like I'm on the right track though. I think I must be missing something obvious here.

Please edit your post and put the code inside code tags. Please provide a wiring diagram of your circuit.

I edited and put the code in the code tags.

I haven't done a wiring diagram before. I will figure that out soon. But in the meantime, I think I've isolated the problem: the itsybitsy seems to be communicating NOTHING. It's not sending anything out of the tx pin as far as I can tell. I hooked it updirectly to the Arduino 1-0, 0-1 and the arduino is receiving nothing from it.

Did you use voltage level translators for that? You can't safely connect 5V and 3.3V devices...

I did not - but all the communication is from the 3.3 volt device to the 5 volt device. I had read that a 3.3 volt signal would still be read a "high" by a 5 volt device. Is that not correct?

I got it! It was Serial1 not serial. As far as why that didn't work originally, I must have connected something wrong. 3.3 volt itsy bitsy is now producing 5 pin MIDI out!!!!!

Great you've solved it !

That is the 3.3v midi method. Keep in mind that 3.3v Midi is not the standard those Synth producing guys had agreed upon 45 years ago for good reason.
The setup with 2x220R resistors in line limits the current in case the pins on the male 5pin Din plug accidentally get shorted out, which is not that unlikely.
Anyway the 10r & 33R resistors are not sufficient to do that, even for themselves if they are 1/4watts (3.3v = I * 33R -> I = 3.3 / 33 = 0.1A * 3.3v = 0.330 Watt and for the 10R that is of course even worse)
So if possible i would advise you to add a TTL-chip powered with 5v, to the output port. Ideally the Schmitt trigger specified so a 74xx14 using 2 gates would be best. The Schmitt trigger specification is actually redundant if you use an MCU, and is a relic from the time that digital signals were not quite as digital as they are now.

It's not always correct, often it works but it's not guaranteed and it reduces the noise margin. But the real problem is that 3.3V ports can be permanently damaged by 5V signals applied to them.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.