Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 39 of 39

Thread: Snooze library: attachInterrupt wakes up Teensy from hibernate

  1. #26
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,480
    Duff: link is broken toward Snooze/tree/master/utility ... duff2013/Snooze/archive/v6.2.4.zip?

    I see this was done and undone: kinetis_hsrun_enable(); , I had wondered about that being disabled in snooze some months back - not that I knew it would do this ...
    That code is safely ifdef'd in the core to only appear where needed: #if defined(HAS_KINETIS_HSRUN) && F_CPU > 120000000

  2. #27
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,615
    Quote Originally Posted by duff View Post
    Should be fixed now, please download v6.2.6 here and let me know?
    OK, cloned new version and sketch works properly on T3.6 @180mhz

    However, on T3.5 sketch is still not coming out of hibernate when pin 10 is grounded ??

  3. #28
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,025
    Quote Originally Posted by manitou View Post
    OK, cloned new version and sketch works properly on T3.6 @180mhz

    However, on T3.5 sketch is still not coming out of hibernate when pin 10 is grounded ??
    Ok thanks for testing all this out it really helps, I'll take a look today.

  4. #29
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,025
    Quote Originally Posted by defragster View Post
    Duff: link is broken toward Snooze/tree/master/utility ... duff2013/Snooze/archive/v6.2.4.zip?

    I see this was done and undone: kinetis_hsrun_enable(); , I had wondered about that being disabled in snooze some months back - not that I knew it would do this ...
    That code is safely ifdef'd in the core to only appear where needed: #if defined(HAS_KINETIS_HSRUN) && F_CPU > 120000000
    I didn't read the manual close enough, can't go into any of the Low Leakage Sleep Modes in HSRUN.

  5. #30
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,025
    Quote Originally Posted by manitou View Post
    OK, cloned new version and sketch works properly on T3.6 @180mhz

    However, on T3.5 sketch is still not coming out of hibernate when pin 10 is grounded ??
    Can you try with this sketch below? My T3.5 is working with pin 10 as wakeup pin with hibernate. You have to ground pin 23 after waking to get out if the while loop.
    Code:
    #include <Snooze.h>
    #define but_pin 23
    #define but2_pin 10
    volatile boolean flag = true;
    
    
    SnoozeDigital  digital;
    SnoozeBlock config_teensy35(digital);
    
    
    void setup() {
      pinMode(LED_BUILTIN, OUTPUT);
      digital.pinMode(but2_pin, INPUT_PULLUP, FALLING);
      pinMode(but_pin, INPUT_PULLUP);
      attachInterrupt(but_pin, button_int, FALLING);
    }
    
    
    void loop() {
      
      digitalWrite(LED_BUILTIN, HIGH);
      Snooze.hibernate( config_teensy35 );
      digitalWrite(LED_BUILTIN, LOW);
      flag = true;
      while (flag == true) {
        digitalWrite(LED_BUILTIN, HIGH);
        delay(200);
        digitalWrite(LED_BUILTIN, LOW);
        delay(200);
      }
      delay(500);
    }
    
    
    void button_int() {
      flag = false;
    }

  6. #31
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,615
    Nope, your sketch behaved the same. on my T3.5, LED never goes off when i ground pin 10. I've tried using pin 12 instead of 10 .... nope? Since sketch works on T3.6 and T3.2, is there something wrong with my T3.5? is it a "bounce" problem -- i'm just grounding a jumper (no button)

    Actually, i have 2 T3.5's, and behavior is the same on both.

    Added a 5s timer. confirmed timer worked on T3.2 and T3.6. Does not work on T3.5?
    Last edited by manitou; 02-01-2017 at 09:32 PM.

  7. #32
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,025
    Quote Originally Posted by manitou View Post
    Nope, your sketch behaved the same. on my T3.5, LED never goes off when i ground pin 10. I've tried using pin 12 instead of 10 .... nope? Since sketch works on T3.6 and T3.2, is there something wrong with my T3.5? is it a "bounce" problem -- i'm just grounding a jumper (no button)

    Actually, i have 2 T3.5's, and behavior is the same on both.

    Added a 5s timer. confirmed timer worked on T3.2 and T3.6. Does not work on T3.5?
    pin 12 is not wakeup pin. I just did the same with grounding the pin and it works, I tried pin 11 also which works.

    My T3.5 I have to make sure the USB cable is pulling the USB connector down for the Teensy to get power and work. Not sure if its the connector or the solder joint that causes this. This is the same for T3.6 also.

  8. #33
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,615
    OK, i tried with pin 11. Nope. But the fact that the timer is not bringing T3.5 out of hibernate precludes any pin problems.... ????

  9. #34
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,025
    Quote Originally Posted by manitou View Post
    OK, i tried with pin 11. Nope. But the fact that the timer is not bringing T3.5 out of hibernate precludes any pin problems.... ????
    Works on my end.

  10. #35
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,480
    It works for me :: Very confusing - it has no USB ... of course . . . I thought it failed to program.
    On my T_3.5 with zipped from github (my post #26)

    powers up with ON LED
    Tap pin 10 to USB connector and I get BLINK LED <edit> : Pin23 will not wake to BLINK LED
    Tap pin 23 to USB connector and get LED ON

    ----
    With LED on - tap Pin 23 to USB connector - no change.
    Last edited by defragster; 02-02-2017 at 05:39 AM.

  11. #36
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,480
    Burned same sketch to T_3.6 : Boots to LED ON - Either pin 10 or 23 wakes from BLINK ON - but only 23 puts it back to LED ON/sleep?
    >> Win_10, IDE 1.8.1, TD 1.36b1 @180 MHz as FASTER+LTO or just FAST

    (funny note): same Pin_23 'bouncing' touch and release can wake and return to sleep if not held until blink starts.
    Last edited by defragster; 02-02-2017 at 05:42 AM.

  12. #37
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,615
    A mystery to me. sketch works with pin 10 or timer on T3.6 and T3.2, but LED just stays on when testing on either of my T3.5s. I checked bootloader version (1.03) and that seems ok. Both T3.5s have female headers (for Ether shield testing).

    EDIT
    I installed 1.8.1 and 1.35, and T3.5 is working now... whatever.
    Last edited by manitou; 02-02-2017 at 03:14 PM.

  13. #38
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,615
    @duff,
    I ran snooze tests with LC. For sleep/deepSleep/hibernate meter showed 2+ma. From old LC beta test thread, one needs to set pin 17 OUTPUT LOW. When I did that, things worked 950/190/4.3 ua for the tests. Looks like snooze lib in 2015 might have been managing pin 17 for LC, but not now? Maybe at least need a comment in github README about LC pin 17?

  14. #39
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,025
    Quote Originally Posted by manitou View Post
    @duff,
    I ran snooze tests with LC. For sleep/deepSleep/hibernate meter showed 2+ma. From old LC beta test thread, one needs to set pin 17 OUTPUT LOW. When I did that, things worked 950/190/4.3 ua for the tests. Looks like snooze lib in 2015 might have been managing pin 17 for LC, but not now? Maybe at least need a comment in github README about LC pin 17?
    Good catch I'll fix that soon.

Posting Permissions

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