Shop OBEX P1 Docs P2 Docs Learn Events
Forcing exit of 'waitpeq' if no match occurs - Page 2 — Parallax Forums

Forcing exit of 'waitpeq' if no match occurs

2»

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-12-22 23:57
    Phil,
    excuse my quibble, but I still cannot see much advantage over my three instruction loop smile.gif
    In both cases we have an inaccuracy of 4 ticks worst case. My aditional insruction can easily be compensated for after reading cnt (if you are interested in the phase). Mirror's example has opened my eyes for the extremely specific and limited usefulness of being able to re-act within 150 ns rather than 200 ns to a rising slope of a much longer signal...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-23 00:20
    deSilva,

    Yup, yours is also an eight-clock loop. One (not terribly significant) difference between our approaches is the extra instruction yours requires to react to the pin change. OTOH, mine requires more instructions to "rearm" the tests after a change and uses up a local counter.

    Had I taken more time to examine your routine in detail, I probably wouldn't have gone to the trouble to develop mine! smile.gif

    -Phil
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-23 00:30
    But it wasn't in vain! I love to see applications for these timers/counters of the Propeller. They are definitely underused and to little understood. Just think of the fast shift-out exploit!
    Which is a pity as they can be used even from SPIN in many situations. When I wrote the sequence of my PWM examples, I was astonished how precise the timing was...
Sign In or Register to comment.