Shop OBEX P1 Docs P2 Docs Learn Events
Programming delay less than 1ms w/BS2 - ANSWERED & CLOSED — Parallax Forums

Programming delay less than 1ms w/BS2 - ANSWERED & CLOSED

davejamesdavejames Posts: 4,047
edited 2009-08-21 05:29 in BASIC Stamp
Hi All,

I'm in need of programming a delay less than 1ms using a BS2.

The interval of delay for the PAUSE command is milli seconds with the range being between 0 - 65535.

That 'zero value' I'm guessing means "wait as long as it takes to execute the PAUSE command".· If so, does anyone know the value of that time?

Granted all timing with this beastie is based off a resonator with +/- 1% tolerance.· I'm not looking for anything exact, but I do need something smaller than 1ms.


Thanks much,

DJ


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Instead of:

"Those who can, do.· Those who can't, teach." (Shaw)
I prefer:
"Those who know, do.· Those who understand, teach." (Aristotle)


Post Edited (davejames) : 8/12/2009 10:40:07 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-12 18:34
    Tracy Allen ([noparse][[/noparse]url]http://www.emesystems.com[noparse][[/noparse]/url] under "app-notes") has a nice discussion of Stamp statement execution time.· You should be able to use his numbers to estimate how long a loop should last, then you can adjust the number of loops for your delay as needed.
  • davejamesdavejames Posts: 4,047
    edited 2009-08-12 19:29
    Mr. Green - got it, thanks.

    A bunch o'stuff tucked away here at Mr. Allen's site there is!

    This timing info should be in the Stamp Programming Reference...


    DJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Instead of:

    "Those who can, do.· Those who can't, teach." (Shaw)
    I prefer:
    "Those who know, do.· Those who understand, teach." (Aristotle)
    ·
  • TRAVIS12TRAVIS12 Posts: 2
    edited 2009-08-12 20:02
    I am working· on···a keypress circuit· in the circuit there· are to 7447· and i was wonder· how· do u tie them together . Second· question i am using one· 74147· and i know·· that the output· pins are 9 6 7 14 i connected them to· my stamp· to 0 through 3 but when i take my logic probe to measure it· i read all highs· but i am not getting· anything from the other pins· that i connected to the 74147
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-12 20:26
    TRAVIS12,
    Please do not hijack an unrelated forum thread. If you have a question, please start a thread in the appropriate forum. For questions related to Stamps, use the Stamp forum. For general questions, use the Sandbox forum. If you can draw a schematic using a schematic drawing program, please do so and post a PDF file of the printout as an attachment to your message (use the Post Reply button or New Topic button and the Attachment Manager). If you can hand draw a schematic and scan it in, that would be a good alternative. The more information you provide about what you're trying to do and what you've tried, the better. If you have an uppercase / lowercase keyboard, use both rather than all uppercase. It's easier to read.
  • ercoerco Posts: 20,256
    edited 2009-08-12 22:14
    davejames: I have used dummy pulsouts to effect pauses less than 1 ms to generate IR control codes. Some sample code and useful comments in the PDF (see page 7 of 19) at http://www.parallax.com/dl/docs/prod/robo/FasterQtiSubroutineV1.1.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • davejamesdavejames Posts: 4,047
    edited 2009-08-12 22:30
    Erco - thanks for the tip and reference; I'll check it out tonight.

    DJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Instead of:

    "Those who can, do.· Those who can't, teach." (Shaw)
    I prefer:
    "Those who know, do.· Those who understand, teach." (Aristotle)
    ·
  • davejamesdavejames Posts: 4,047
    edited 2009-08-12 22:42
    Hi All,

    With the information Erco provided, I found that for a BS2 the PAUSE command with a value of 0 will generate a 230us delay. This will definitely be different on the other versions of Stamps.

    Also, a "dummy" PULSEOUT with a value of 0 takes about 208us to execute, again for a BS2.

    Good stuff!


    I'm calling this thread answered and closed.

    DJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Instead of:

    "Those who can, do.· Those who can't, teach." (Shaw)
    I prefer:
    "Those who know, do.· Those who understand, teach." (Aristotle)
    ·
  • ercoerco Posts: 20,256
    edited 2009-08-21 00:12
    davejames: If you're still checking in, I found the older thread where I was using fake pulsouts as delays shorter than "Pause 1" would allow. This was to·send Sony IR control codes·through an external 38kHz oscillator (555 timer circuit driving an LED). FYI: http://forums.parallax.com/showthread.php?p=759751


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • davejamesdavejames Posts: 4,047
    edited 2009-08-21 05:29
    Erco - thanks!

    I've saved the link to my favorites for reference.

    DJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Instead of:

    "Those who can, do.· Those who can't, teach." (Shaw)
    I prefer:
    "Those who know, do.· Those who understand, teach." (Aristotle)
    ·
Sign In or Register to comment.