The problem with the state of the pins when Colibri wake up

I use the Colibri T20 and WinCE7 and have problems with the state some pins when Colibri goes sleep/wake up, also when the power is turned on.

There is in ConfigBlock this configuration:

[colibripin_107] altfn=-1 dir=out lvl=0 [colibripin_32] altfn=-1 dir=out lvl=1

After loading the operating system the state of these pins corresponds to the specified: Pin107-out low level, Pin32- out high level.

But in the process of loading, as well as when Colibri wakes up by timer, the state of the pins changes - I see the oscilloscope negative pulse 4ms on pin 39. Similarly, pin 107, but there the pulse is positive.

The fact that the state of the pins varies in the process of loading does not bother me, but it strongly hinders when the device wakes up - pins are GPIO and used to control other devices.

How to make sure that the pins do not change the state when Colibri wakes up by timer? Maybe I should use other pins (which ones)?

Code for enter suspend mode:

  SYSTEMTIME  st;
  FILETIME    ft;             
  static CE_USER_NOTIFICATION un = {0};

  // add 30 seconds to the current time
  GetLocalTime(&st);
  SystemTimeToFileTime(&st, &ft); 
  (*((DWORD64*)&ft)) += 10000000 * 30;   // 1 unit = 100ns
  FileTimeToSystemTime(&ft, &st);
 
  if(!CeSetUserNotification(NULL, L"", &st, &un))  
  {
    //Error!!!!
    return;
  }
  // enter suspend mode
  DWORD R = SetSystemPowerState(NULL, POWER_STATE_SUSPEND, POWER_FORCE);

I was able to reproduce the behavior you have reported as well. Without doing any deeper investigations, I suggest two possible workarounds:

  • Use an other pin. It looks as if the behavior you have seen is related to the default pin pull configuration. If you choose a pin with default setting “pull up” for a pin that needs lvl=1 you are fine. If you choose a pin with default setting “pull down” for a pin that needs lvl=0 you are fine as well. If you would swap your configuration (SODIMM 107 lvl=1, SODIMM 32 lvl=0) this should do the job. The default configurations are documented in our datasheet from page 18 on.
  • Add a pull up resistor to the pin. It looks as the pin is not driven for a moment. The external pull up resistor will help to keep the level up. Depending on what this pin is used for, this could be an easy workaround at least it worked for SODIMM 32