Shop OBEX P1 Docs P2 Docs Learn Events
Processor Speed - Pulsout — Parallax Forums

Processor Speed - Pulsout

curious1curious1 Posts: 104
edited 2007-03-03 17:46 in BASIC Stamp
Here's an easy one:
Does the processor speed·affect the PULSOUT ?
If the BS2 at 20MHz is running a stepper driver with:
··· FOR counter = 1 TO 1200
··· PULSOUT 14,1
··· Pause 0··········
would the motot run at a higher RPM if the BS2sx at 50MHz·ran the same code ?
I wouldnt think so, but..............? I also noticed that if I PULSOUT without the counter it runs substantially faster, I guess because it doesnt have to count the pulses. So if I did this with both stamps, would one run faster than the other ?
····· DO
··········· PULSOUT 14

······LOOP

Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-03 16:38
    If you read the section in the PBasic manual about PULSOUT, you'll see that the time unit depends on the processor. There's a table there that lists the time/unit for each processor. Also, the statements themselves take less time to execute on the faster processors. In your example with the PULSOUT 14, the loop and the PULSOUT statement would run faster and the time per unit (of 14) would be less as well.
  • curious1curious1 Posts: 104
    edited 2007-03-03 17:46
    Thanks Mike, I see it now. I should have looked a little more before posting.
    Duration dropping from 2us to 0.8us would be substantial if the drivers were capable.

    Please bear with me, I'm learning.
    Regards
    Appreciative
Sign In or Register to comment.