Quantcast
Channel: Wardy's Projects
Viewing all articles
Browse latest Browse all 70

Propeller Hacking: WAITPEQ timeout

$
0
0
Random thought of the day:

If you're using either the WAITPE (or WAITPNE) instructions on the Parallax Propeller (P8X32A) chip then you can add a high resolution configurable timeout to it in the following way...

Set up your WAITPEQ instruction like normal but also configure your mask and state values to include an additional IO pin (call it PIN X).  Then configure either CTRA or CTRB to use "NCO single-ended" mode on PIN X with a duration that makes sense for your project.

Since CTRA (or CTRB) are running in the background autonomously then they will be able to cause a pin transition even the cog is still blocked by a WAITPEQ (or WAITPNE) instruction.  Thus you can set up your chip so that it never spends more than a certain amount of time in a WAITxxx state.

I'll throw together a quick code sample shortly to demonstrate this.

Viewing all articles
Browse latest Browse all 70

Trending Articles