Shop OBEX P1 Docs P2 Docs Learn Events
Interrupts — Parallax Forums

Interrupts

ArchiverArchiver Posts: 46,084
edited 2001-10-02 14:41 in General Discussion
Hi all,

I am putting together a robot using a bs2 module. The robot will have
various sensors and servos. One of the sensor systems I would like to
implement consists of two wheel-encoders. The setup will probably consists
of a photoreflector pointing to a striped disk attached to each wheel. As a
wheel spins, I want to count the stripes and determine how far the wheel has
gone. I need to be able to count the stripes on both wheels at the same
time and monitor various other sensors. How do I code this without
interrupts? Are there some basic tricks for this kind of coding?

Rafe

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-10-02 14:26
    A PAK-VII will do this while the Stamp is busy doing something else. Also,
    check out the Stamp project of the month -- it uses a PAK-VI to read a
    mouse -- which oddly enough has two optical encoders (if you can figure out
    the mechanics to couple it to your robot motion).

    Without interrupts you'd have to be sure to poll the sensors at least twice
    as fast as the wheel is moving (the Nyquist limit). Barring that you could
    wire up a counter but then you need a way to read it (maybe a shift
    register) whereas a PAK-VII would read 8 channels at once with one IC. The
    PAK-VI and a mouse would only read two but that's all you need and the mouse
    encoders are already there.

    Regards,

    Al Williams
    AWC
    *Easy RS-232 prototyping: http://www.al-williams.com/awce/rs1.htm


    >
    Original Message
    > From: Rafe [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=HkYfX43w1aXtlYodhOLLYRT4wrMerP_rjO72dNywb8l38CLSNp8t5KtDFknhR_RPQ5tBK0WVT2hZBloDFwKv]rafe00@e...[/url
    > Sent: Monday, October 01, 2001 3:58 AM
    > To: Basicstamps@Yahoogroups. Com
    > Subject: [noparse][[/noparse]basicstamps] Interrupts
    >
    >
    > Hi all,
    >
    > I am putting together a robot using a bs2 module. The robot will have
    > various sensors and servos. One of the sensor systems I would like to
    > implement consists of two wheel-encoders. The setup will
    > probably consists
    > of a photoreflector pointing to a striped disk attached to each
    > wheel. As a
    > wheel spins, I want to count the stripes and determine how far
    > the wheel has
    > gone. I need to be able to count the stripes on both wheels at the same
    > time and monitor various other sensors. How do I code this without
    > interrupts? Are there some basic tricks for this kind of coding?
    >
    > Rafe
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-02 14:41
    Rafe,

    One method you can use would implement stand-alone separate modules for the
    sensors. Tie the powersupplies together. Use latching outputs on the
    sensors. When you poll - send a reset to the sensor (this assumes necessary
    processor speed of course).


    Original Message
    From: "Rafe" <rafe00@e...>
    To: "Basicstamps@Yahoogroups. Com" <basicstamps@yahoogroups.com>
    Sent: Monday, October 01, 2001 3:57 AM
    Subject: [noparse][[/noparse]basicstamps] Interrupts


    > Hi all,
    >
    > I am putting together a robot using a bs2 module. The robot will have
    > various sensors and servos. One of the sensor systems I would like to
    > implement consists of two wheel-encoders. The setup will probably
    consists
    > of a photoreflector pointing to a striped disk attached to each wheel. As
    a
    > wheel spins, I want to count the stripes and determine how far the wheel
    has
    > gone. I need to be able to count the stripes on both wheels at the same
    > time and monitor various other sensors. How do I code this without
    > interrupts? Are there some basic tricks for this kind of coding?
    >
    > Rafe
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >


    _________________________________________________________
    Do You Yahoo!?
    Get your free @yahoo.com address at http://mail.yahoo.com
Sign In or Register to comment.