In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mhubers wrote: Can you mix periodic interrupts with port interrupts? What I mean by this is that I need to track time using interrupts and to watch for a button. Maybe it would be easier to just state what I am trying to do... 1) Program starts up and gets some things setup. 2) Goes to sleep and waits for a button to get tapped. But this tapping of the button needs to know if it has been tapped or if it has been held down for a few seconds. 3- a) If it was just tapped then get out of sleep mode. Start a countdown and keep monitoring the button to see if it has been tapped again, then add some time to the countdown counter. As it is doing this, it needs to monitor some others tasks too... 3-b) If it has been held down for a few seconds, just get out of sleep mode and do some functions. So I was thinking of the only way to pull that off if the interrupts can do both periodic interrupts with port interrupts. The periodic would be dealing with the countdown as it is still doing other tasks outside the interrupt. The port triggered interrupts would moniter the button and wakeup the program if in sleep. Can this be done using interrupts and if so, is there something to look at to get a idea how to do this? Thanks for any help! Mark ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=314793 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)