Shop OBEX P1 Docs P2 Docs Learn Events
Delay loops — Parallax Forums

Delay loops

ArchiverArchiver Posts: 46,084
edited 2000-04-13 00:02 in General Discussion
I need to add some delays more shorter than the 1 ms pause offers. I am
thinking that I'll use for next. Is there a rule of thumb on how long it
takes to execute an empty for next loop?

/
\
\/\/\/\/\/\/\/\/\/\/\/\/\/\ Michael L. Morgan /\/\/\/\/\/\/\/\/\/\/\/\/\/
/ Email: mlmorgan@o... | WWW: http://home.olemiss.edu/~mlmorgan/ \
\
/

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-04-12 17:04
    If you have spare pins, use a PULSOUT to a pin you don't use. Don't forget
    that there is a significant delay as the Stamp pulls instructions from the
    serial EEPROM. So a 100uS pulse won't really delay 100uS -- it will be more
    because of the overhead.

    Beyond that Tracy Allen's site has some individual timings for instructions.

    Regards,

    Al Williams
    AWC
    * Tax special from now to April 17th. Order a copy of Microcontroller
    Projects with Basic Stamps and get an ASP-II free.
    http://www.al-williams.com/awce/sbook.htm



    >
    Original Message
    > From: Michael Land Morgan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=rkqxOenuMpLg8QlMRM-yUI3in_ICih3Ss-yGOkRyKZn9bPAuBefIIx5QoNGLZ4W8BeLLEMvUWPfL1Ee2fnSwnO4NNBVRRUmnJpiP_9E]mlmorgan@s...[/url
    > Sent: Wednesday, April 12, 2000 10:59 AM
    > To: basicstamps@egroups.com
    > Subject: [noparse][[/noparse]basicstamps] Delay loops
    >
    >
    > I need to add some delays more shorter than the 1 ms pause offers. I am
    > thinking that I'll use for next. Is there a rule of thumb on how long it
    > takes to execute an empty for next loop?
    >
    > /
    \
    > \/\/\/\/\/\/\/\/\/\/\/\/\/\ Michael L. Morgan /\/\/\/\/\/\/\/\/\/\/\/\/\/
    > / Email: mlmorgan@o... | WWW: http://home.olemiss.edu/~mlmorgan/ \
    > \
    /
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-04-12 18:24
    > I need to add some delays more shorter than the 1 ms pause offers. I am
    > thinking that I'll use for next. Is there a rule of thumb on how long it
    > takes to execute an empty for next loop?

    One way to get quite precise delays is to use the pulsout command, directed
    to an unused pin. Then you get a resolution of 2 microseconds, plus the
    220 microsecond interpreter time. I have some timings posted at
    http://www.emesystems.com/BS2misc.htm


    regards,
    -- Tracy Allen
    Electronically Monitored Ecosystems
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2000-04-13 00:02
    I timed this once with a scope. It depends. My usual average was
    about 200us. BUT, it depends on the type of loop, how far the jump is and what
    you are comparing to make the jump.

    DLC

    > I need to add some delays more shorter than the 1 ms pause offers. I am
    > thinking that I'll use for next. Is there a rule of thumb on how long it
    > takes to execute an empty for next loop?
    >
    > /
    \
    > \/\/\/\/\/\/\/\/\/\/\/\/\/\ Michael L. Morgan /\/\/\/\/\/\/\/\/\/\/\/\/\/
    > / Email: mlmorgan@o... | WWW: http://home.olemiss.edu/~mlmorgan/ \
    > \
    /
    >
    >
    >
    >
Sign In or Register to comment.