In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: Hi all, tacho pulses are kinda asynchronous. Using an ISR to catch them, means that the ISR must be executetd often enough in order not to miss anya tacho pulse transition, so the ISR would act as a "fast poller" on the tacho input line. As the SX is faster than many oher controllers, this may, or may be not a problem. Nevertheless, please don't forget another great SX feature: The "wake-up" capability of the port B inputs. What is called the "wake-up capability" is actually a endge-capture feature available on the port B inputs. You can configure each of them to capture a rising or falling input signal edge, using the WKPED_B configuration register. You may configure the individual port B inputs to issue an interrupt, or a wake-up event using the WKEN_B configuration register. But even without enabling interrupts/wakeups on port B transitions, you can always "read" the WKPND_B register to find out if the input has changed to the configured direction since the last read. Actually, you do an exchange between W and the WKPND_B registers, so the instruction sequence mov w, #0 mode $09 mov !rb, w copies the current status of the wakeup pending bits into w, and clears them for the next run. This feature is especially handy when you have to deal with very short pulses. Let's assume that the pulses look like to this: _______________-_______________-_____________ and you poll the input at times shown here: ____|____|____|____|____|____|____|____|____|____ So, you will miss all the low-high transitions, although you are polling the input faster than the pulse period. The status of a WKPND_B register bit would look like this (assuming that it is cleared whenever it is read): ______________-----____________----____________ i.e. it goes high on a rising input signal, and low again when it is read by the SX program, so you won't miss any input transition using this feature. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=147881#m148038 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)