MIDI device resetting itself

Status
Not open for further replies.

yeahtuna

Well-known member
I've created a midi device with teensy 2.0 that converts an expression pedal to midi. I've noticed that when plugging the expression pedal into the TRS jack, the teensy resets itself. Do you have any idea why it resets itself and what I might do to prevent this behavior?

Regards,
Rob
 
Sorry Paul, here are a few more details. The female TRS jack is connected as follows. TIP PIN -> +5v / RING PIN- > ground / SLEEVE PIN-> analog pin. The RING and SLEEVE pins on the jack are bridged using a 10k resistor. As I'm plugging in the TRS jack, the Teensy momentarily powers down and resets.

I've also noticed if I plug in a mono TS cable into the jack, which effectively connects the the analog pin directly to ground, the device powers down and doesn't restart at all. Is this normal? Can it damage the board?

The jack I'm using also has two normally closed contacts that open when a cable is plugged in. Not sure if these would be useful or not.

Rob
 
Last edited:
I've mostly fixed the issue, by switching the 5v and signal wires around. Here's a pic for reference.
wiring.png
I still have a resetting issue when plugging in a mono cable. When using a mono cable, the 5v is directly connected to the ground as per the above pic. Can this damage the teensy? I noticed that adding a resister inline on the ground wire takes care of the resetting problem. What's the lowest ohm resister that is suitable for this purpose?

Regards,
Rob
 
Hi
Looking at standard connection diagram for expression pedals ( http://www.strymon.net/2010/07/12/strymon-tech-corner-1-anatomy-of-an-expression-pedal/ ) the analog pin should be connected to the tip and ground to sleeve. The extra 10k resistor would not be needed for this configuration.

There can be a momentary short circuit between the 5V ring and the GROUND sleeve while the plug is being inserted, enough to create a dip in the power to the Teensy and reboot it. You can add a 200 ohm resistor in series to the 5V cable, this will limit the short circuit current to 25mA.

Regards
Magnus
 
Thank-you, I'll try the 200ohm resister and see if that takes care of the issue. The 10k resister is to support FSR type pedals. I'd also like to support a momentary (sustain) pedal but I think that might be impossible using this configuration. Thanks again for your help.

Regards,
Rob
 
Isnt a momentary switch equivalent to a FSR with 0 and infinite resistance ? Should work.
 
I suppose it is (read: I believe you if you say so), but sustain pedals use mono (TS) cables and that 10k resistor somehow messes with things. However, I managed to stumbled upon a solution and I'd love for someone to explain why it works. I connected another wire to the TIP and attached that to a digital pin on the Teensy and in my setup() method set it to INPUT_PULLUP mode. I didn't even read the pin, but just making that connection made everything magically work. It's late and I didn't get a chance to test it thoroughly, but my FSR, my sustain, and my expression pedal all seem to be working.
 
There can be a momentary short circuit between the 5V ring and the GROUND sleeve while the plug is being inserted, enough to create a dip in the power to the Teensy and reboot it. You can add a 200 ohm resistor in series to the 5V cable, this will limit the short circuit current to 25mA.

Yes, exactly! The power supply is almost certainly being shorted, which isn't good.

Is it really necessary to run +5V power to the connector?
 
Another idea is to connect the ring to a digital output, through a small current limiting resistor, that can be switched high, low or high impedance depending on what pedal is used.

@Paul ( Hi am am new and a happy user of Teensy 3's ) The expression pedal acts as a voltage divider and needs a positive terminal.
 
Another idea is to connect the ring to a digital output, through a small current limiting resistor, that can be switched high, low or high impedance depending on what pedal is used.

If my circuitry could determine what type of pedal was being used, that would be fine. I have a software that runs alongside the teensy and it has a little calibrate button that basically just determines the voltage range on the analogue pin and scales values appropriately.

Here's an updated diagram showing my wiring. Does anything jump out at you as being dangerous and potentially damaging to the Teensy based on the mono and stereo configurations. Again, I really appreciate your expertise.

wiring.png
 

Attachments

  • wiring.png
    wiring.png
    70.6 KB · Views: 213
I would first switch back to GROUND on sleeve and +5V on the ring to minimize risks as this is the setup what most equipments seems to be configured for.

Next connect the ring to a processor digital out pin and only apply 5V (through a 200 ohm current limiting resistor) when the configuration needs it.

You can determine the type of pedal by measuring the resistance between the ring and the sleeve. This can be done by
connection a digital output over a circa 10k resistor to the ring and the the ring itself to an analog input:

1) For an expression type pedal this will be 10-20k, the measured voltage will be around 2.5V

2) For the FSR type, the ring is not connected, if I understand correctly, and the resistance is infinite and the measured voltage around 5V

3) For a momentary switch, the mono jack will short circuit ring and sleeve so the resistance is 0 ohms, and the measure voltage at 0 V

The pull-down from tip to ground can change this a bit but the general principle should work.

Regards
Magnus
 
I quite like the setup you've described, mainly because it lets me know what's plugged into the device and on the software end of things this gives me more options and allows for a more user friendly design. However I don't understand how it will accommodate FSR. You're right that the FSR doesn't use the ring, however these types are controllers often come with TRS cables nonetheless. Because they require 5v for the voltage divider, in the setup you've described, where does that come from?

Should I be connecting another digital out pin to supply 5v to the sleeve in this situation?
 
Last edited:
Use the same 10k resistor between ring and tip as before, will be a pullup with +5 on the ring.
OR
if you got enough unused pins, connect a separate digital pin to tip through a 10k resistor to use as a pullup

It might be possible to add an onchip pullup to analog input pin of the tip, but using a separate digital output
and a resistor gives you better control of the strength of the pullup.
 
That makes sense.... I've got loads of pins. For a future project analog pins will be at a premium, so it would be nice to only use a single analog pin. I'll test your setup. Thanks again.
 
So I tried your setup, and adding the extra analog pin works nicely to detect the what type of pedal is being used, but I was still unable to determine if the sustain pedal wass pressed or not. So I made a hybrid solution of your last recommendation and the configuration I had before and I think I've got fairly robust setup.
wiring.png

I still don't know why adding the digital pin to the TIP helps, but it does and that's good enough for me. You'll see that I just opted to leave the digital output pin set high and put a 10k resister on it, that should be safe?. The analog pin attached to the ring registers zero for sustain, about 200 - 500 for the expression pedal and 500 - 800 for the FSR.

Thanks for your help.

Rob
 
It just occurred to me that I could probably still set that digital pin low and use one of the normally closed contacts on the jack to supply full power again when the jack is unplugged.
 
Nice its working and start to look good.

The 10k on the blue connection to Ring feels a bit large, I would make it smaller, 1k or perhaps as small as 200 ohm, then you get a larger dynamic range from the expression pedal.
The maximum current will still be perfectly safe.

With the new teal connection you can move the 10k resistor beween Tip and Ring and put in on that connector, that gives you the pullup needed for FSR and momentary switches.

Regards
Magnus
 
I'm still unable to get a reading from that sustain pedal with your suggested configuration. Should I be measuring it from the analog pin or that digital pull up?
wiring.png

This configuration however, does give nice clear static values for the different pedal types.

Regards,
Rob.
 
Sure enough....Got it working by reading the digital pin. Now I just need to use the normally closed switch to detect when there's nothing plugged in. You are awesome, BTW. You're not the man behind Symbiosis are you?

Regards,
Rob
 
And here's the completed design. Magnus, I can't thank-you enough. When I finish developing this, I'll be sure to send you one.wiring.png
 
My idea was to put the 10k pullup to the Tip, the teal wire. No problem, it will work, just make sure to not
connect any digital out directly to ground, anadvertently trough a momentary switch or so. Always use
a series current limiting resistor then, around 500 to 1k. Using input pins with pullups does the same but
current limiting resistors are a cheap insurance. Theys are small enough to not disturb the readings by much
and large enough to limit the current at 5V to 5-10mA, the chip can handle that easy.

No never heard of Symbiosis, will look it up, but I do play a bit with the OpenPipe breakout board, a touch
input MIDI 'flute' trying learn how to play :) and adding some wind control. Adding a foot controlled expression
pedal thats an interesting idea I havnt thougt of before.

Regards
Magnus
 
The FSR needs a pullup resistor, I guess the internal pin pullup is good for that. The reason
to use the resistor and put the pin in output +5V mode instead of input with pullup is to match
the resistance of the pullup to approx the same value as the FSR with medium pressure.
That will give you 2.5V over the tip, and hopefully the best sensitivity for the ADC measurements
around that middle value. Experimentation is needed :)
 
And you figure in that mode, I'll be able to get a reading for the sustain from the digital input pin also attached to the tip?
 
Status
Not open for further replies.
Back
Top