A sleeping STM32 can be woken up by a rising edge on its wake up pin. But if the IC on the other end of the line only interrupts as falling edge, is it possible to invert it somehow ?

  • \$\begingroup\$ Which STM32 device were you looking at? After only a quick glance at st.com/web/en/resource/technical/document/reference_manual/… I can see that it says in section 9.2 that rising, falling, or both events can be configured to cause external interrupts. \$\endgroup\$ – Laszlo Valko Dec 14 '13 at 4:14
  • \$\begingroup\$ @LaszloValko : yes, interrupts can be rising/falling/both but the wakeup logic seems to expect a rising edge. In the same document section 5.3 table 11 "Standby mode wake up" contains "WKUP pin rising edge". \$\endgroup\$ – davew Dec 14 '13 at 4:24

Yes, the WKUP pin works like that. If you really need standby state, you pretty much have no other choice left to wake up the device. You can, however, put a simple inverting transistor in front the the WKUP pin like this:


simulate this circuit – Schematic created using CircuitLab

Check the data sheet, you might be able to spare R2 if a proper pull-down resistor can be switched on for WKUP inside the chip.

  • \$\begingroup\$ I have made some tests thinking "if the line is high, goes low then high again" surely the STM32 interrupt configured as rising could pick the rise following the fall and indeed, it worked. Is this maybe luck or frowned upon ? Thanks \$\endgroup\$ – davew Dec 15 '13 at 3:59
  • \$\begingroup\$ It should be a proper way of operating. The only thing to watch for is how long the low state has to be. Usually, there's a specification somewhere in the data sheet describing the minimum required length of the low state so that the chip surely recognizes it as low (and then may surely recognize the rising edge). I'd expect this to be on the magnitude of 10-100 nanoseconds so if you keep the signal low for at least 1us, that should probably be enough. \$\endgroup\$ – Laszlo Valko Dec 15 '13 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.