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

Thread: Teensy LC not sleeping with SPI Flash

Hybrid View

  1. #1

    Teensy LC not sleeping with SPI Flash

    Ok I have lost about 6 hours of hair so i need to consult some outside help..

    I am using a Teensy LC to do basic datalogging but i cant get the LC to sleep properly. The problem seems to be the inclusion of the SPI memory library.
    If i comment out flash.begin(); and flash.powerDown(); I can get the proper uA sleep but otherwise it stays in high power.

    Where should i start looking? Is it related to the SPI? Trying to trace the SPIMemory library hasnt really been fruitful yet.

    I have ruled out the LIS3DH sensor so ignore that code. I am just setting it to full sleep mode.

    Flash library:
    https://github.com/Marzogh/SPIMemory

    Code:
    #include <Snooze.h>
    #include <SPI.h>
    #include <SPIMemory.h>
    #include "LIS3DH.h"
    
    static const int CSFLASHPIN = 23;
    static const int CSMOTIONPIN = 9;
    
    SnoozeTimer timer;
    SnoozeUSBSerial usb;
    SnoozeBlock config_teensyLC(usb, timer);
    
    SPIFlash flash(CSFLASHPIN);
    LIS3DH SensorLIS = LIS3DH(CSMOTIONPIN);
    
    void setup() {
      SensorLIS.sampleRange = 4;
      SensorLIS.sampleMode = 10;
      SensorLIS.SampleRate = 0; //Sample rate 0 = sleep
      SensorLIS.begin();
      flash.begin();
      flash.powerDown();
    }
    
    void loop() {
      timer.setTimer(1000);// milliseconds
      Snooze.hibernate(config_teensyLC);
    }

  2. #2
    NEVERMIND! Apparently my scope just wonky. Maybe time for a new one...

    Have a nice day!

Posting Permissions

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