In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: Sorry not to get back on this thread sooner... Where are you getting 3 cycles? A pin-edge interrupt will take 5 cycles, possibly 6 [quote=""] The SX chip will activate the interrupt routine exactly 5 clock cycles in Turbo mode or exactly 10 clock cycles in compatible mode after a Wake-Up Edge Detection event occurs. This deterministic feature allows for nearly jitter-free interrupt response. Latency may vary by as much as +1 instruction cycle when interrupting on external asynchronous events, thus a high clock speed may be necessary to lessen the effects.[/quote] Second, these instructions in SX/B are actually many more assembly instructions than you think: [code] Int_Check = WKPND_B If Int_Check <>%00000001 Then ISR_Exit 'Check to make sure that interrupt due to pin RB.0 SX_CLK = 1 SX_CLK = 0 [/code] Look at the list file (view list) and you'll see. If NOCODE isn't used, then you'll see even more. Now, if you are ONLY checking for ONE possible pin on interrupt, and you've turned RTCC interrupts off, then you don't need to actually check WKPND_B, only clear it (the interrupt won't happen except on that one pin change): [code] W = WKPND_B ' 4 cycles SX_CLK = 1 ' 1 cycle NOP ' 1 cycle SX_CLK = 0 ' 1 cycle [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=446826#m448551 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2010 (http://www.dotNetBB.com)