Shop OBEX P1 Docs P2 Docs Learn Events
why is pulsout so far out — Parallax Forums

why is pulsout so far out

davidsdavids Posts: 64
edited 2005-06-25 07:25 in BASIC Stamp
I have been using the pulsout command to drive servos As one would, But I have failed to understand why if I·use a scope on the command that the scope shows me a value far less than the calucated pulse width that I ment to use.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-06-23 12:47
    Perhaps because the pulse width for the BS2 is 2 uS per 'Tick' -- thus a 750 pulse width is actually 1.5 mSec wide.

    Other BS2 variants (BS2sx, BS2p) have different 'Tick' sizes.

    Otherwise, I don't know why the pulse widths would vary -- what are the numbers you're finding? (In other words, you would say, "I set it to 750, but I see a 1 mSec pulse, which is far less than the 1.5 mSec pulse I would expect.")

    Those are the kind of questions we can answer more accurately. Are your servo's working, by the way?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-23 12:56
    Davids,

    Which Stamp module are you using? What is the value in your PULSOUT statement? What are you seeing on your 'scope?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-06-23 14:48
    Oh, yes, and how are you triggering your scope? Hopefully, a good scope will let you trigger on the start of the signal, while still letting you see the end of the signal. If you trigger on the 'wrong' edge, though, you may be seeing the 'idle' time (which could be much shorter than the actual 'pulse' time).
  • davidsdavids Posts: 64
    edited 2005-06-24 00:03
    The basic stamp I'm using is a BS2p. The scope is a pico ADC212 16 bit resolution and yes it does have two triggers. Now for a pause 20 you would expect the spoce to read close to 20 us, but reads about 17 - 18.8us depending on were I set the triggers
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 00:41
    davids,

    ·· Perhaps there is something wrong with the scope?· PAUSE 20 should give a delay of 20mS, not 17-18.8uS.· And if the scope has two triggers, what is triggering the channel you're reading, what level is the trigger and is it rising or falling edge triggered?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 01:29
    davids,

    ·· Your picture did not come out.· Remember that JPG and GIF are universal formats, PSD is not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • davidsdavids Posts: 64
    edited 2005-06-24 01:38
    Chris,

    ·this the reading that the scope gives at pulsout 1300.
    693 x 299 - 25K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 01:57
    davids,

    ·· I would try some other settings on your scope.· The whole waveform isn't even being shown.· What resolution do you have the scope set to?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • davidsdavids Posts: 64
    edited 2005-06-24 03:40
    Chris,

    Hopfully this on will be easier to read,· the pause is 20ms

    David
    1281 x 846 - 63K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 03:55
    davids,
    ·· Again, I must say it must be something with your scope, as here's a screenshot from mine, and it all looks fine on a BS2p, with the following code.
    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}
    DO
      PULSOUT 15, 1300
      PAUSE 20
    LOOP
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    800 x 597 - 102K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 03:59
    Almost forgot...This one shows the pause working correctly...Remember, there is also a small delay during loading of the next instructions...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    858 x 630 - 131K
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-24 04:00
    Not bad ... 1300 x 0.8 is 1040 and your 'scope shows 1041. I'd say it works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 04:02
    Jon,

    ·· Yeah, it's got to be something with his scope...Ol' Faithful (Parallax USB O'Scope) tells it like it is!· =)· Anyway, back to the original subject...davids, is there some problem that you are having that you feel is related to the timing of the BS2p PULSOUT and PAUSE commands?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • davidsdavids Posts: 64
    edited 2005-06-24 05:41
    Chris,

    your scope is it 8 bit 12bit 16 bit or 32 bit. I ask because the results will vary greatly between the three different types of scopes. I have used my scope in past to calabrate a Spectro scope, then compared the calabration with the calabration book suppied with the spectro scope.

    PERFECT RESULT
  • davidsdavids Posts: 64
    edited 2005-06-24 06:25
    Jon,

    As always you hit the nail on the head. Problem solved I haven't done my math properly
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-24 14:16
    davids,

    ·· I think the scope information is irrelevant.· If I connect our Tektronix TDS 1012 here at Parallax I get the same results.· The point is, you didn't answer the question, which is, what is the problem you are having with the BS2p that prompted you to investigate the timing?· Perhaps there is a code error or something else.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • davidsdavids Posts: 64
    edited 2005-06-25 07:25
    I investigate every thing it's in the nature for a developer to know everything about what they are working with and discuss what they need to do. Jon Williams has already satified my Qeustion with an answer which I can understand. I simply don't do the right math to work out the problem. There is nothing wrong with the pulsout command.. The subject is now terminated.

    The 8 bit to 16 bit scope, started with the blind leading the blind ( His scope must be wrong)

    The answer I was looking for was( 1300 * 0.8= ?) Problem solved, it was my mistake.

    Post Edited By Moderator (Chris Savage (Parallax)) : 6/25/2005 9:28:19 PM GMT
Sign In or Register to comment.