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

Thread: External RESET button - Teensy 3.2

  1. #1
    Junior Member
    Join Date
    Mar 2018
    Posts
    14

    External RESET button - Teensy 3.2

    Hi all,

    This seems to be a really easy one, but couldn't find a very distinctive answer online yet.

    I'm using a Teensy 3.2 in some hardware applications and would be able to do a reboot/reset from a button. Now I'm just deconnecting the power and connect it again but this isn't really what I'd prefer.

    How is it possible to this from a button? Does the teensy even have a reset port?


    Also, I'm feeding the Teensy from external power, but also do some 'online' programming sometimes, so when the teensy is connected to the external power.

    Should I cut the trace between the Vin and Vusb pads?


    Thanks in advance!
    A.

  2. #2
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    the pin hole is right next to the Program button, you just need to ground it to do a reset, attach a wire there for your button

    Click image for larger version. 

Name:	teensy30_front_pinout.png 
Views:	549 
Size:	166.5 KB 
ID:	13904

    regarding the trace, yeah cut it if you plan on using 2 sources at once. Me, I didn’t cut the trace, instead I modified a usb cable (cut the red wire), that way the USB cable never supplies power to teensy and I can retain the trace for future use

    the trace cut/modified usb cable only apply if you want both plugged in at same time

  3. #3
    Senior Member
    Join Date
    May 2017
    Posts
    106
    Yes, there is an RESET accessable, but unfurtunatly just as SMD-pad.
    See https://www.pjrc.com/teensy/pinout.html

    As long you can manage not to connect external power and USB power at same time, you don't need to cut trace between Vin and Vusb.
    To be sure cut the trace, but then you always need external power to reprogramm the teensy from the IDE.

  4. #4
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    no, look to the right end of the picture

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,151
    Looking at the card that came with the T_3.2 - on as shown on the PJRC.com website - or the back of the T_3.2 itself you'll see a pad labelled "RST".

    Switching that to Ground will reset the Teensy.

    Using the TyCommander GUI application also provides a GUI button to reset a connected Teensy.

    When a Teensy is externally powered cutting the VUSB trace will prevent contention or problems with two supplies powering the same lines. USB can still be connected to program the Teensy - but only when it is under external power when that trace is cut.

    On the Teensy's where I've cut that trace I apply some eye catching color indication on the top of the USB hood - like a red nail polish. Otherwise you can suffer some amount of concern for the failure of the Teensy to appear when connected

  6. #6
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    woah those 2 t3.2 pics look different

  7. #7
    Senior Member
    Join Date
    May 2017
    Posts
    106
    Quote Originally Posted by tonton81 View Post
    the pin hole is right next to the Program button, you just need to ground it to do a reset, attach a wire there for your button

    Click image for larger version. 

Name:	teensy30_front_pinout.png 
Views:	549 
Size:	166.5 KB 
ID:	13904

    regarding the trace, yeah cut it if you plan on using 2 sources at once. Me, I didn’t cut the trace, instead I modified a usb cable (cut the red wire), that way the USB cable never supplies power to teensy and I can retain the trace for future use

    the trace cut/modified usb cable only apply if you want both plugged in at same time
    Sorry mate,

    you gave the wrong graphic, this is for teensy 3.0 not for 3.2 as asked.

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,151
    Yes - there is no RESET pin on a T_3.2 :: see pjrc.com/teensy/card7a_rev1.pdf

    or pjrc.com/teensy/pinout.html

  9. #9
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    yup your right, i went after a google 3.2 result picture, shame on them!

    well no choice must use pad

  10. #10
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    well, not really, you can make a reset via a normally closed button, attached to VIN or GND of teensy... pressing it will cut power, letting go restores power..

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,151
    Normally closed to VIN would float when pressed - like it does when not connected … i.e. no reset? NC to GND would only run while pressed.

  12. #12
    Junior Member
    Join Date
    Mar 2018
    Posts
    14
    So, my only option with a Teensy 3.2 would be to disconnect and reconnect power through a switch?

    No other options to think of?
    Would be great to have some 'dedicated' reset button.

    Thanks in advance.

  13. #13
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,925
    Quote Originally Posted by fietstasss View Post
    So, my only option with a Teensy 3.2 would be to disconnect and reconnect power through a switch?

    No other options to think of?
    Would be great to have some 'dedicated' reset button.

    Thanks in advance.
    Sure, and the Teensy 3.5/3.6 now have a reset pin that is broken out in the row of pins next to the micro SD card reader.

    In the Teensy 3.2, you would need to solder a wire underneath the Teensy to the pad that says 'RST', and connect that wire to a button that is connected to ground (as defragster said earlier). Or have something that interrupts the power.


  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,411
    Here's the reset signal. Just short it to GND to reboot the chip.


  15. #15
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    You could add an interrupt on a pin, on FALLING edge (attachInterrupt), and have it trigger this code:

    Code:
    SCB_AIRCR = 0x05FA0004;
    This should reset whenever the pin you chosen is grounded.

  16. #16
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    Here, I wrote you working code that uses any pin for a reset, in this case, I'm using pin 12...

    This will reset Teensy whenever pin 12 is grounded, Enjoy

    Code:
    void setup() {
      pinMode(13, OUTPUT);
      attachInterrupt(12, pin_reset, FALLING);
    }
    
    void pin_reset() {
      SCB_AIRCR = 0x05FA0004;
    }
    
    void loop() {
      delay(100);
      digitalWrite(13, !digitalRead(13));
    }
    Tony
    Last edited by tonton81; 05-29-2018 at 09:11 PM.

  17. #17
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,991
    tonton81īs SW solution triggers the question: does the RST pad also resets the CPU when program is crashed, where typical SW solutions do not work?

  18. #18
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,151
    The 'Reset' pad is wired direct to processor hardware reset on the schematics I see. So that would allow processor restart when ungrounded … bad code could take it away again ...

  19. #19
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,516
    watchdog backup is solution for bad code.., the code i posted reboots the processor and USBSerial inclusively based on any pin a user chooses. This should be a solution for those people who don’t like soldering to reset pad on T3.2 and have a spare pin to use
    Last edited by tonton81; 05-30-2018 at 08:22 AM.

  20. #20
    Quote Originally Posted by fietstasss View Post
    So, my only option with a Teensy 3.2 would be to disconnect and reconnect power through a switch?

    No other options to think of?
    Would be great to have some 'dedicated' reset button.

    Thanks in advance.
    I realize this is a somewhat old thread, but in case others stumble in here:

    You might understandably find it inconvenient to have a floating wire connected to the Reset pad under the Teensy 3.2, when the rest of the connections to the Teensy are by header pins, allowing the Teensy to be mounted in a socket, and removed as needed.

    One alternative is to run a short jumper from that Reset pad to one of the header pins that's normally used for some I/O function that you don't intend to use. For example, you could run it to D23/A9/Touch. I/O pins normally power up and reset to "high-impedance", so as long as you don't accidentally program that pin, this should work fine.

    Regardless of whether you use a solution like this, or just put up with a separate wire, you'll probably want to debounce the reset switch with at least a resistor and capacitor.

    https://electronics.stackexchange.co...-mcu-reset-pin

Posting Permissions

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