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

Thread: Random MIDI messages on serial TX

  1. #1

    Random MIDI messages on serial TX

    So Iíve decided to try using 9v DC to power my foot controller so that it can be used on guitar pedal boards.
    Using Teensy 2.0:
    Iíve added a 5-pin DIN for MIDI out (220ohm resistors on pins 4 and 5 as per the PJRC site) with Wires about 5cm long to the teensy inside an aluminium enclosure.
    Iíve also added a 9v DC barrel jack which goes into this linear regulator I built as per this schematic:
    Click image for larger version. 

Name:	209197CA-87A8-48F6-B707-9F50062B22C8.png 
Views:	68 
Size:	94.5 KB 
ID:	20441
    - I then used the recommendations for diodes and cutting the 5v pad on the teensy 2.0 as per PJRC website for external power supply/USB power switching.

    I have no worries at all with the power side of things - itís working beautifully. USB MIDI is fine. But with the serial TX MIDI, it outputs the messages I asked it to, but then occasionally is starts an infinite stream of random messages (note on, pitch bend, after touch - all ones I am not using) or perhaps just adds the odd one in sometimes. If I press the buttons really slowly it just occasionally puts a random ďnote onĒ message in there, but other times it starts a big stream of data!

    I canít seem to find any help on this particular topic. Iím quite sure itís something to do with the power. My friend suggested I needed to use linear regulator rather than the switching one I was using before but the problem is still exactly the Same.
    Could it be the small unshielded section of wire from the teensy to the 5-pin connector on the enclosure?

  2. #2
    Senior Member
    Join Date
    Aug 2019
    Melbourne Australia
    Been playing with din Midi circuitry on a breadboard with a T2, pots, buttons and a noisy display - a bit of a jungle of wires, and have not encountered any need to use shielded cables for the Din Midi out.

    Have had similar random stuff like you describe but that was due to a dodgy optocoupler at the receive end. Was not consistent and changed with temperature. Try a different Midi IN port.

    What are you using for a power source? a switch-mode wallwart by any chance?

    Reason for asking is that a lightly loaded switch-mode can be really noisy supply especially if driving a noisy digital load. Some manufacturers specify a minimum load of 20% of rated maximum current, less than that, regulation is not guaranteed.

    Standard practice here is to engineer the problem out of the equation with a bunch of parallel R as a dummy load. An experiment perhaps?

  3. #3
    I am indeed using a switch mode wallwart! Perhaps thatís my issue! My main problem is not having a 9v DC power supply - Iím using standard guitar pedal wiring which means the barrel is positive and centre is negative.

    I guess Iíll just have to look around for one!
    Thanks for the info.

  4. #4
    Senior Member
    Join Date
    Aug 2019
    Melbourne Australia
    Just had another thought:-

    If the RX pin is not used and left floating it may pick up garbage and depending on what the code is doing, said garbage may be sent to the output.

    Maybe turning on pullup for the RX pin, or adding a suitable pullup resistor is worth checking out.

  5. #5
    Senior Member
    Join Date
    Dec 2014
    A big enough capacitor (220 uF or so) should clean up a too-noisy wall wart.
    If you hook up a scope or logic analyzer, do you see the random MIDI being sent by the Teensy?
    If so, it's likely you have some bug in your sketch, which overwrites some buffer or otherwise causes unpredictable behavior.
    Also, you posted the diagram for the power supply, but not the diagram for how you wire the MIDI, or code for how you initialize it. Doing so might help someone spot some problem.

  6. #6
    That is exactly the problem. I turned on INPUT_PULLUP on pin 7 and no more problems! Noisy power and all Thanks so much!

Posting Permissions

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