Main Site Documentation

Hibernate and IO50(EINT3)


#1

I have problems with hibernation and IO50 on USBizi100
Depending on the pin configurations( especially InterruptMode ), the board hangs before or after hibernate.
In the code bellow, the board will freeze before hibernate if the pin was grounded before, or after hibernate, if the pin will be grounded after hibernation.
The board will crash even if the inputEINT3 is not created and the pin has changed the state during hibernation .


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

namespace MFTestExtInt3
{
    public class Program
    {
        static InterruptPort inputEINT3;
        static InterruptPort inputGood;
        static OutputPort LED = new OutputPort(USBizi.Pin.IO69, true);
        
        public static void Main()
        {
                      
            Thread.Sleep(7000);
          
            inputGood = new InterruptPort(USBizi.Pin.IO10, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeHigh);
            inputEINT3 = new InterruptPort(USBizi.Pin.IO50, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeHigh);
          
            
            while (true)
            {
                
                LED.Write(false);
                
                GHIElectronics.NETMF.Hardware.LowLevel.Power.Hibernate(Power.WakeUpInterrupt.InterruptInputs);
            
                //blinking led
                for (int j = 0; j < 5; j++)
                {
                    LED.Write(j % 2 == 0);
                    Thread.Sleep(300);
                }
            }
        }

    }
}


Cosmin


#2

Have you tried the example in the documentation:

http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/html/3a782fdf-ea3c-c29a-561b-a2efa9ef5174.htm


#3

I hope I’m not very beginner in netmf.
I use 12 inputs,canbus and alarm clock to wakeup my board from hibernate.
All works fine , except IO50.This input seems to be very special , because it shares interrupts with EINT3.
I’ve tried to hack the cpu registers with no luck.


#4

Please use InterruptPort with the same pin to check if you get events from it. You may have the wrong pin or have a defective pin? Maybe try a different board.


#5

I have tested on the second board, the pin is ok , I can read it’s state, and the attached event is raised each time when I put the pin to ground.


#6

So you receive events but you do not wakeup?!

Can you please put this in a small program and try then post back?


#7

The board wakeup(I can see this from power consumption) , but the program crash before to return in managed code .
The code is in the first post.