Disconnecting Analog unput resets Teensy 3.6

Status
Not open for further replies.

bossredman

Well-known member
Hi - a couple of questions which I'm thinking are probably NOT related - BUT - maybe as they both seem to have started happening very recently.

1] I have an Expression Pedal (ie potentiometer) with a male TSR connector hooked up to my Teensy 3.6 via a TSR Female connector.

T=Analog pin A22
S=AGnd
R=+5V

Whenever I disconnect/connect the male connector from/to the female connector - it resets my Teensy.

Is that expected/normal behaviour?

2] Is it possible for a digital input to trigger itself - even when it's not connected to anything?
{edit: I think this as I have a Serial.Print statement for debugging purposes in all the code sections which get called by a swithc press. This one keeps popping up - even thouthere is nothing connected to it now }

edit 2:
Code:
#define BUTTON24 22  // IA-8
Bounce bouncer24 = Bounce(BUTTON24);
pinMode(BUTTON24,INPUT_PULLUP);

if ( bouncer24.fallingEdge())                        //Dynamic IA switch 8
        {
            Serial.print("Switch*: ");            Serial.println(24);
           ....
        }
 
Last edited:
FYI, The Teensy 3.6 is not 5V tolerant. Additionally, the Teensy 3.1/3.2 and 3.5 are only 5V tolerant on their digital pins and the analog to digital converter only goes up to 3.3V. You really need a voltage divider.
 
FYI, The Teensy 3.6 is not 5V tolerant. Additionally, the Teensy 3.1/3.2 and 3.5 are only 5V tolerant on their digital pins and the analog to digital converter only goes up to 3.3V. You really need a voltage divider.

oh...should I use the 3.3V for R then?

Have I damaged the Teensy do you think?
 
Are you using two different power supplies, or are you using the same 5V to power the teensy and supply the pedal?
In either case if you're seeing teensy reset when you connect the pedal it's probably causing a brown out, where the power supply momentary dips due to the rush of current from the new connection, particularly if the wires are long and the resistance is low.

If you've connected 5V directly to the teensy it's probably game over, but you'd know as it would stop working or at least you'd see the effect. You might get lucky if you never pushed the pedal all the way down, you might find the one pin doesn't work anymore.

A digital pin with an input pull-up shouldn't trigger spontaneously, but it really depends on the circuit outside the teensy. If the physical pin isn't connected to anything then no, if it's connected to 20ft of wire in a nice coil next the a power cable then who knows?
 
Are you using two different power supplies,
Just the 1 power supply - which feeds the Teensy.
The teensy then provides the pedal with 5V from the Teensy's onboard Vin pin.

A digital pin with an input pull-up shouldn't trigger spontaneously, but it really depends on the circuit outside the teensy. If the physical pin isn't connected to anything then no, if it's connected to 20ft of wire in a nice coil next the a power cable then who knows?
There was a switch connected (by <250mm of wire) - but I saw my screen flashing & traced it down to that switch. Atleast I thought it was a bad switch or wiring - but even now with anything connect to that pin it still triggers.
 
So you're at the mercy of your computers USB supply, I asume without any decoupling? Whack a big old capacitor across Vin - GND and that should fix it, couple microfarad.

I can't actually tell, but it doesn't look like you're using bounce correctly. The version I have requires an interval length in millis as well; if you're somehow using it without, it's probably set to zero and useless.
Try with the pin completely unconnected, it should be fine.

But there is this question of 5V, after which the teensy becomes permanently suspect. I'd recommend taking the time to test all the pins you plan on using; otherwise you're going to spend the rest of the project second guessing the teensy.
 
So you're at the mercy of your computers USB supply,
Only when uploading code - the rest of teh time it runs off its own 5V plug (like a phone charger thing).

I can't actually tell, but it doesn't look like you're using bounce correctly. The version I have requires an interval length in millis as well; if you're somehow using it without, it's probably set to zero and useless.
Not sure what happened with the original code quote - its actually this:
Code:
Bounce bouncer24 = Bounce(BUTTON24, debounce_time);
..sorry about that - must have somehow not copied correctly into the post.
 
When connecting and disconnecting the TSR plug, there can be a momentary short between then AGND on the sleeve of the female connector and the +5V on the ring of the female. This is normally just a short pulse, but can surely be enough to reset the 3.6. You should consider putting a current limiting resistor on the positive supply to the pedal, on the female side.
 
I would try 330 ohm, if you have 3.3V this gives a short circuit of 10mA, should be perfectly safe.
How well this works depends a bit on the resistor value in the pedal.
 
Status
Not open for further replies.
Back
Top