Shop OBEX P1 Docs P2 Docs Learn Events
serial in command — Parallax Forums

serial in command

neaorneaor Posts: 4
edited 2005-11-28 14:29 in BASIC Stamp
Hi, i was wondering if there is any way to have the stamp check for serial input commands while executing a pulse width modulation command. ie do the pulse width modulation command until the serial input says to stop. currently, i only know how to set the stamp to do the pulse width modulation for a set amount of time, not until the user inputs something serially. Thanks.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-11-25 06:40
    neaor -

    Fundamentally, the PBASIC Stamp is a single tasking processor, and as such can only perform one task at a time. However, if the PWM process were done by a separate off-board co-processor (as is often done) then you CAN do both.

    Parallax offers two different co-processors, for performing just such tasks. Here they are for your perusal:

    PWMPAL: http://www.parallax.com/detail.asp?product_id=28020

    PSC: http://www.parallax.com/detail.asp?product_id=28023

    As you can see by the descriptions of each, on the Parallax web site above, the PSC is more geared to the specific task of driving R/C servos, which is a common application for the Basic Stamps.

    There are also others who offer PWM co-processors: http://www.awce.com/pak5.htm .

    Regards,

    Bruce Bates
  • Tom WalkerTom Walker Posts: 509
    edited 2005-11-28 14:29
    And, depending on the needed frequency and pulse width, you could actually "roll your own" PWM routine around a "serial with timeout". Be advised, this could only be done if you needed EXTREMELY SLOW PWM... I just present the idea to emphasize that clever programming can overcome percieved limitations (single-tasking, for example) of a microcontroller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
Sign In or Register to comment.