In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: In Assembly: mode $09 clr w mov !RB, w With the MODE register set to $09, the mov !RB, w actually swaps the contents of w and the wake-up pending register, so after this instruction, all bits in the register are cleared, and in w, the bit is set which caused the recent. It is important to execute this sequence somewhere inside the interrupt routine before returning. If you don't do it, the interrupt will be immediately re-triggered again, no matter if a new edge at the rb port was detected or not. It is also a good idea to execute this code once before the WKPEN_B register is configured, just to make sure that no "glitches" have set bits in the WKPND_B register. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205456#m206392 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)