chipKIT® Development Platform

Inspired by Arduino™

WF32 Sleep Mode

Created Tue, 15 Jul 2014 00:14:39 +0000 by briandpc


briandpc

Tue, 15 Jul 2014 00:14:39 +0000

I am trying to put the WF32 into low power sleep mode

I want to have the PIC32 sleep and only wakeup once per second to do some processing

I added the 32k crystal and the timer 1 interrupt seems to be working

The PIC32 does not appear to be sleeping

I think the chip kit core processing and timer is waking the PIC32 up

I there a way to put the PIC32 into sleep mode ??

Do I need to disable the chip kit core functionality ??

If so how do I do this ??

Below is my sample code

A rather simple program to only wake on timer1 interrupt and then go back to sleep

void setup() { Serial.begin(9600);

Serial.println("Briandunio starting...");

// Initialize the Timer 1 module BDTimer1.begin();

// Attach our routine to send the time through the serial port BDTimer1.attachInterrupt(&outputTime); }

void loop() {

  BDTimer1.unlock();
  OSCCONSET = 0x10; // set power save mode to Sleep
  BDTimer1.lock();
  

}

void outputTime() { Serial.print("Current time = "); Serial.print(millis(), DEC); Serial.println();

}


briandpc

Tue, 15 Jul 2014 01:48:05 +0000

I think I have it running now

forgot to add the wait command

void loop() {

  BDTimer1.unlock();
  OSCCONSET = 0x10; // set power save mode to Sleep
  BDTimer1.lock();
  
  asm volatile("wait") ;
  

}

Noticeable power drop