In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: If you need both (a regularly running interrupt and edge detection) it is probably easier to just do the former, and within the regularly scheduled interrupt you can check for edges, i.e.: [code] pulseDivider VAR Byte edges VAR Byte oldEdges VAR Byte INTERRUPT 100_000 DEC pulseDivider IF pulseDivider = 0 THEN pulseDivider = 10 ' do your regular pulse work. for example this would run 100000/10 or 10000x second pin = ~pin ' or whatever ENDIF ' now check for edge detect changes 1000000x per second edges = RB ' or whereever pins are IF edges.0 <> oldEdges.0 THEN ' it's different, must be an edge ' do some stuff ENDIF IF edges.1 <> oldEdges.1 THEN ' it's different, must be an edge IF edges.1 = 1 THEN ' high going edge, for example ' do some stuff ELSE ' low going edge ' do some stuff ENDIF ENDIF oldEdges = edges RETURNINT [/code] There are much more efficient ways to do this, but hopefully the above is clear enough that you get the basic idea. Others may have much cleverer suggestions as well. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=250718#m250723 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)