Random MIDI messages on serial TX

Status
Not open for further replies.

Aussie_CrocHunter

Well-known member
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:
209197CA-87A8-48F6-B707-9F50062B22C8.png
- 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?
 
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?
 
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. :)
 
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.
 
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.
 
Status
Not open for further replies.
Back
Top