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

Thread: Disconnecting Analog unput resets Teensy 3.6

  1. #1
    Senior Member
    Join Date
    Jun 2015
    Posts
    232

    Disconnecting Analog unput resets Teensy 3.6

    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 by bossredman; 01-26-2017 at 03:14 PM.

  2. #2
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    538
    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.

  3. #3
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    Quote Originally Posted by brtaylor View Post
    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?

  4. #4
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    538
    Quote Originally Posted by bossredman View Post
    oh...should I use the 3.3V for R then?

    Have I damaged the Teensy do you think?
    Yep, I would use the 3.3V for R. Hard to say whether it's been damaged, I would try with the 3.3V and see if there are still issues.

  5. #5
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    OK cheers - any idea on the 2nd point too pls?

  6. #6
    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?

  7. #7
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    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.

  8. #8
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    Quote Originally Posted by brtaylor View Post
    Yep, I would use the 3.3V for R. Hard to say whether it's been damaged, I would try with the 3.3V and see if there are still issues.
    hmmm - just tried with teh 3.3v pin & still resets the Teensy.

  9. #9
    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.

  10. #10
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    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.

  11. #11
    Senior Member
    Join Date
    Aug 2013
    Location
    Gothenburg, Sweden
    Posts
    295
    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.

  12. #12
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    arh yes that makes sense - thanks.

    Do you recommended any particular value for said resistor pls?

  13. #13
    Senior Member
    Join Date
    Aug 2013
    Location
    Gothenburg, Sweden
    Posts
    295
    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.

  14. #14
    Senior Member
    Join Date
    Jun 2015
    Posts
    232
    Quote Originally Posted by mlu View Post
    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.
    Thanks - The pot in the pedal measures 10k ohm.

Posting Permissions

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