After Power.Hibernate cant wake up (here is code and what is this wrong?) fez_panda

   #region Class variables

        private static M1PowerSleep mInstance;
        private bool isSleeping = false;
        #endregion

        #region Properties

        public static M1PowerSleep Instance
        {
            get { return mInstance; }
        }


        #endregion

        #region Methods
        public void InitPowerSleep()
        {
            mInstance = new M1PowerSleep();
            while (true)
            {
                if (!IOInterface.Instance.BooleanInputStatus)
                {
                    if (!isSleeping)
                    {
                        DeviceSleep();
                    }
                }
            }
        }

        public void DeviceSleep()
        {
            isSleeping = true;
            Thread.Sleep(30000);
            Debug.Print("Shutting Down GSM Modem");
            GprsModem.Instance.MakePulls();
            Thread.Sleep(5000);
            RealTimeClock.SetAlarm(RealTimeClock.GetTime().AddMinutes(1));
            Debug.Print("Going to sleep M1");
            Power.Hibernate(Power.WakeUpInterrupt.InterruptInputs | Power.WakeUpInterrupt.RTCAlarm);
            DeviceWakUp();
        }

        public void DeviceWakUp()
        {
            isSleeping = false;
            Debug.Print("Wake up M1");
            GprsModem.Instance.MakePulls();
            Thread.Sleep(5000);
            GprsModem.Instance.SendData();
        }

From our super support page Support – GHI Electronics
take a look at this please http://wiki.tinyclr.com/index.php?title=Low_Power

tnx but when in interrupt port coming impulse device wakes up very well, but on timer not wakes up
i dont understand why? :frowning:

[quote] but on timer not wakes up
i dont understand why? [/quote]

There is code on that page to makeup on alarm. Have you tried it?

i created new project and here is Code
and can someone tell me what is a wrong?

i took code from here:
[url]http://wiki.tinyclr.com/index.php?title=Low_Power[/url]

using System;
using System.Threading;
using Microsoft.SPOT;
using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.Hardware.LowLevel;

using GHIElectronics.NETMF.FEZ;
using Microsoft.SPOT.Hardware;

namespace Hibernate
{

    public class Program
    {
        private static OutputPort LED;
        public static void Main()
        {
            //blink LED
            LED = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false);
            StartBlinking(500, 500);

            RealTimeClock.SetTime(new DateTime(2010, 1, 1, 1, 1, 1));
            while (true)
            {
                Thread.Sleep(3000);//blink LED for 3 seconds
                RealTimeClock.SetAlarm(RealTimeClock.GetTime().AddSeconds(10));
                Debug.Print("Going to sleep for 10 seonds!");
                // sleep for 10 seconds
                Power.Hibernate(Power.WakeUpInterrupt.RTCAlarm);
                Debug.Print("Good Morning!");
                StartBlinking(100, 100);
            }
        }

        private static void StartBlinking(int OnState, int OffState) {
            LED.Write(true);
            Thread.Sleep(OnState);
            LED.Write(false);
            Thread.Sleep(OffState);
            LED.Write(true);
            Thread.Sleep(OnState);
            LED.Write(false);
            Thread.Sleep(OffState);
            LED.Write(true);
            Thread.Sleep(OnState);
            LED.Write(false);

        }
    }
}

i tested this code On Domino and worked, why not working on Panda and how to solve this problem? please someone help me : ))) :(((

No RTC on Panda.

RTC available on panda II only :wink:

tnx all but its very bad news :D:D :)))
:((((((
and there is not something way to wake up using timer? :frowning:

Not without additional circuitry on Panda

Do you need a fixed time value? If yes, for what timespan?

If it’s only for a fixed couple of seconds, you can connect a capacitor to an interrupt pin. When the device is awake you put 3V3 on the cap with an output pin. When the device hibernates, the capacitor discharges until it reaches the TTL low level on the interrupt pin to wake up the device.

i solved the problem so i added quartz on board and worked :slight_smile: