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

Thread: What is the proper way to turn off Teensy 4.1?

  1. #1

    What is the proper way to turn off Teensy 4.1?

    Hi, what is the proper way to shut down Teensy 4.1 after use? It is safe to just unplug the usb cable or the battery?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,673
    Unless it needs to complete some EEPROM or SD Card or other data storage for data integrity, just losing/dropping power won't bother anything.

    The processor will simply load code and start again when repowered.

  3. #3
    Thank you. How do I know if it needs to complete some EEPROM or SD Card or other data storage for data integrity?

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,673
    Quote Originally Posted by teensy_teen View Post
    Thank you. How do I know if it needs to complete some EEPROM or SD Card or other data storage for data integrity?
    It will be based on the code you write. Unless you have some access or use of those elements - there is nothing in the system that will make use of them.

  5. #5
    Quote Originally Posted by defragster View Post
    It will be based on the code you write. Unless you have some access or use of those elements - there is nothing in the system that will make use of them.
    Thank you

  6. #6
    Senior Member
    Join Date
    Jul 2020
    Posts
    463
    That's the difference between a microcontroller and a computer - the microcontroller runs just the
    program you write (plus the libraries it uses), and nothing else, no operating system, nothing in
    the background (unless you wrote it or a library does this). They are usually rock solid against power
    cycling (thousands of times a second if you like (though if there's a bootloader that might not cope))!

  7. #7
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,879
    The Teensy 4.0/4.1 have an additional method, that may be useful depending on what you want to do.

    There is a socket on the Teensy 4.0 back row of pins, and the interior row of pins on the Teensy 4.1 just before the micro-SD card. It is next to pin #13 on the Teensy 4.0 and pin #38 on the Teensy 4.1.

    If you connect this socket to ground for a given amount of time (default 5 seconds), the Teensy 4.0/4.1 will shut itself off. It will turn itself back on if you release the connection to ground, and then you connect it to ground once again. If you have a battery connected to the RTC (real time clock), it will remember this on/off state even if the Teensy is powered off. If you don't have a battery backed RTC, it will remember the on/off state until the Teensy is powered off.

    So, I generally just install a button between that pin and ground, and I hold the button dow until it shuts off. There is a way to change the timeout period.

  8. #8
    Quote Originally Posted by MichaelMeissner View Post
    The Teensy 4.0/4.1 have an additional method, that may be useful depending on what you want to do.

    There is a socket on the Teensy 4.0 back row of pins, and the interior row of pins on the Teensy 4.1 just before the micro-SD card. It is next to pin #13 on the Teensy 4.0 and pin #38 on the Teensy 4.1.

    If you connect this socket to ground for a given amount of time (default 5 seconds), the Teensy 4.0/4.1 will shut itself off. It will turn itself back on if you release the connection to ground, and then you connect it to ground once again. If you have a battery connected to the RTC (real time clock), it will remember this on/off state even if the Teensy is powered off. If you don't have a battery backed RTC, it will remember the on/off state until the Teensy is powered off.

    So, I generally just install a button between that pin and ground, and I hold the button dow until it shuts off. There is a way to change the timeout period.
    Thanks @MichaelMeissner. There is a photo of the back of the Teensy 4.1 at:

    https://www.pjrc.com/store/teensy41.html (just above USB Host)

    I see there is a row of pins next to the winbond memory chip but I cannot find a socket next to pin 38. Which socket are you talking about?

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,673
    There is a row of pins by the button on both the T_4.0 and 4.1. That row of pins has the same function and order as labeled for the Teensy 4.0 on the 4.1 - it is just shifted.

    One of those pins is labelled as the On/Off pin.

  10. #10
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,879
    Quote Originally Posted by teensy_teen View Post
    Thanks @MichaelMeissner. There is a photo of the back of the Teensy 4.1 at:

    https://www.pjrc.com/store/teensy41.html (just above USB Host)

    I see there is a row of pins next to the winbond memory chip but I cannot find a socket next to pin 38. Which socket are you talking about?
    Defragster answered already, but by socket, I meant the through hole pin slot, next to pin 38 and in front of the micro-SD card reader.

    Unfortunately, those pins do not have labeling on the PCB. If you go to the Teensy 4.0 pinout page (https://www.pjrc.com/teensy/pinout.html), on the reverse view of the Teensy 4.0, is the description of the 5 pins at the back. Those 5 pins have the same use in the Teensy 4.1, and are just before the micro-SD card.

    I.e. starting with the pin next to pin 38:
    • On/off
    • Program
    • GND (ground)
    • 3.3v
    • Vbat (connect coin cell '+' to Vbat and '-' to GND to keep the RTC powered, and the Teensy on/off pin to remember the state)

Posting Permissions

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