Resolving two near-simultaneous triggers
![John Kauffman](https://forums.parallax.com/uploads/userpics/555/nZBNEPT0B6FMD.jpg)
I am trying to figure out the time resolution for resolving two near-simultaneous triggers on two pins of an SX.
·
As I understand a B pin trigger, the following sequence occurs:
Pin has WKEN=0 set at start
Pin is triggered
SX changes its WKPND to 1
SX immediately shuts off any other pin from being set to WKPND=1
SX begins ISR
·
I am wondering about the timing of “immediately” in the above sequence.
Does that shut-off occur on the very next clock cycle?
If yes, when using the internal 4Mhz clock that would mean a second trigger would be locked out provided it was at later by at least 1 / 4,000,000 seconds = 250 nanoSeconds?
·
Thanks.
·
As I understand a B pin trigger, the following sequence occurs:
Pin has WKEN=0 set at start
Pin is triggered
SX changes its WKPND to 1
SX immediately shuts off any other pin from being set to WKPND=1
SX begins ISR
·
I am wondering about the timing of “immediately” in the above sequence.
Does that shut-off occur on the very next clock cycle?
If yes, when using the internal 4Mhz clock that would mean a second trigger would be locked out provided it was at later by at least 1 / 4,000,000 seconds = 250 nanoSeconds?
·
Thanks.
Comments
I'm pretty sure the SX does not disable the other pins after one pin has WKPND set to 1.
In the interrupt routine you can check for what bit of WKPND is set and only clear that one pin (here is where an interrupt can be missed, if it occurs right at the instruction where you are writing back to the WKPND register.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
·