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

Thread: Snooze Issues on Teensy 3.2

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    6

    Snooze Issues on Teensy 3.2

    I am using the Snooze library to put my Teensy 3.2 to sleep but I am encountering a few issues.

    Firstly, in the SnoozeBlock.pinMode() function I can only directly assign the pin number. So SnoozeBlock.pinMode(23, INPUT_PULLUP, FALLING); works but SnoozeBlock.pinMode(iPin, INPUT_PULLUP, FALLING); where iPin is defined as: int iPin = 23; does not work. Why would this be?

    Secondly, upon waking I can't get the Teensy to communicate via serial over the USB port. Is there any way to re enable the USB port to make this work? I've also found that if I try to call Serial.println(); after waking it seems to lock up the Teensy. If I can't get the USB port to work after waking I may need to look at a different method to conserve power. My application is a data logger for a motorcycle. For a few reasons I want to keep the Teensy powered so simply switching the power won't cut it. What have you guys found you have been able to get the current draw down to without the Snooze library?

  2. #2
    Member
    Join Date
    Sep 2015
    Location
    Mechelen, Belgium
    Posts
    22
    Hi,

    One thing what i did in a gps project with teensy 3.1 was going down in cpu frequncy.
    My runtime on a single lion 18650 cell more than doubled. Maybe an option?

    Regards, Otto

  3. #3
    Junior Member
    Join Date
    Oct 2016
    Posts
    6
    Quote Originally Posted by Hersoft View Post
    Hi,

    One thing what i did in a gps project with teensy 3.1 was going down in cpu frequncy.
    My runtime on a single lion 18650 cell more than doubled. Maybe an option?

    Regards, Otto
    Were you able to change the CPU frequency via code while your program was running or did it need to be selected prior to compiling? I definitely need full processing speed while the logger is logging but reducing CPU speed while waiting to start a log would certainly be acceptable.

  4. #4
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,010
    Quote Originally Posted by SySt View Post
    I am using the Snooze library to put my Teensy 3.2 to sleep but I am encountering a few issues.

    Firstly, in the SnoozeBlock.pinMode() function I can only directly assign the pin number. So SnoozeBlock.pinMode(23, INPUT_PULLUP, FALLING); works but SnoozeBlock.pinMode(iPin, INPUT_PULLUP, FALLING); where iPin is defined as: int iPin = 23; does not work. Why would this be?

    Secondly, upon waking I can't get the Teensy to communicate via serial over the USB port. Is there any way to re enable the USB port to make this work? I've also found that if I try to call Serial.println(); after waking it seems to lock up the Teensy. If I can't get the USB port to work after waking I may need to look at a different method to conserve power. My application is a data logger for a motorcycle. For a few reasons I want to keep the Teensy powered so simply switching the power won't cut it. What have you guys found you have been able to get the current draw down to without the Snooze library?
    It doesn't matter if you use Snooze or not USB will be an issue, since the clocks for USB are shut down by hardware. As far as the PIN mode stuff what sleep mode are you using -> Snooze.sleep, Snooze.deepSleep or Snooze.hibernate? Pin 23 is not not wakeup pin for deepSleep or hibernate.

  5. #5
    Junior Member
    Join Date
    Oct 2016
    Posts
    6
    Quote Originally Posted by duff View Post
    It doesn't matter if you use Snooze or not USB will be an issue, since the clocks for USB are shut down by hardware. As far as the PIN mode stuff what sleep mode are you using -> Snooze.sleep, Snooze.deepSleep or Snooze.hibernate? Pin 23 is not not wakeup pin for deepSleep or hibernate.
    Would a possible solution to the USB issue be to use a software reset on the Teensy upon waking? I can make that work for me.

    I am using pin 23 for Snooze.sleep. As I said, it works if I use this code:
    SnoozeBlock.pinMode(23, INPUT_PULLUP, FALLING);

    But it doesn't work with this code:
    int iPin =23;
    SnoozeBlock.pinMode(iPin, INPUT_PULLUP, FALLING);

  6. #6
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,010
    Can you upgrade to version 6 Snooze here.

    Quote Originally Posted by SySt View Post
    Would a possible solution to the USB issue be to use a software reset on the Teensy upon waking? I can make that work for me.
    a reset would work.
    Quote Originally Posted by SySt View Post
    I am using pin 23 for Snooze.sleep. As I said, it works if I use this code:
    SnoozeBlock.pinMode(23, INPUT_PULLUP, FALLING);

    But it doesn't work with this code:
    int iPin =23;
    SnoozeBlock.pinMode(iPin, INPUT_PULLUP, FALLING);
    Just checked with version 6 and this worked for me.
    Last edited by duff; 11-23-2016 at 04:16 PM. Reason: update the link

  7. #7
    Junior Member
    Join Date
    Oct 2016
    Posts
    6
    Quote Originally Posted by duff View Post
    Can you upgrade to version 6 Snooze here.


    a reset would work.

    Just checked with version 6 and this worked for me.
    Thanks for the help. I have the teensy resetting upon waking and sleep is working exactly as I want it to.

  8. #8
    Junior Member
    Join Date
    Dec 2018
    Posts
    8
    Quote Originally Posted by SySt View Post
    Thanks for the help. I have the teensy resetting upon waking and sleep is working exactly as I want it to.
    How do you reset the teensy upon waking up? I'd like to do the same. Thanks

  9. #9
    Junior Member
    Join Date
    Dec 2018
    Posts
    8
    I've found this: https://forum.pjrc.com/threads/24304...=teensy+reboot
    Post #10.

    It works. It resets. I need to check if my application benefits from it now.

Posting Permissions

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