Shop OBEX P1 Docs P2 Docs Learn Events
BS2p40 and ADNS optical mouse sensor — Parallax Forums

BS2p40 and ADNS optical mouse sensor

ArchiverArchiver Posts: 46,084
edited 2004-05-16 22:21 in General Discussion
I am trying to interface my BS2p40 directly with an ADNS-2051 optical
mouse sensor to measure linear displacement. I have removed the
existing microcontroller from the mouse and I have referred to the
ADNS data sheet. After experimenting with the shiftin and shiftout
commands, the synchronous serial communications seem to be over my
head. Has anyone used this optical sensor before? I would greatly
appreciate any help.
Thanks, Bill

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-05-14 20:59
    It just so happens, I too am interfacing this same part to a Stamp! I am using a BS2, and plan on using the quadrature outputs (Xa,Xb,Ya,Yb) and PULSIN. If it works, this will be easier than the serial data route.

    Have you hacked the optical part of the mouse, also? How close do you have to get to the object to get good data?

    Dave

    bmcd29 <wm@e...> wrote:
    I am trying to interface my BS2p40 directly with an ADNS-2051 optical
    mouse sensor to measure linear displacement. I have removed the
    existing microcontroller from the mouse and I have referred to the
    ADNS data sheet. After experimenting with the shiftin and shiftout
    commands, the synchronous serial communications seem to be over my
    head. Has anyone used this optical sensor before? I would greatly
    appreciate any help.
    Thanks, Bill




    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.

    Yahoo! Groups Links






    Do you Yahoo!?
    SBC Yahoo! - Internet access at a great low price.

    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-16 15:58
    Hi Dave
    With little success using the serial communication, I am now
    considering the quadrature outputs from the ADNS as well. One
    problem I am running into is how to measure the relative timing of
    the two (Xa, Xb - I only need one direction) signals by the stamp.
    Pulsin measures it only on one pin and it seems that the relative
    timing of high/low changes between the channels is the important
    factor for determining the amount of motion. Is this right? Have
    you gotten this to work yet?

    As for the optical part, fortunately I am keeping the rest of the
    mouse as is and mounting it just about touching the moving surface.
    I am not sure of how close you have to be for good data. If you need
    to go further, there is an article in the May 2004 Nuts & Volts (p86)
    that describes modifying lenses for this sensor - it may be helpful.

    Bill



    --- In basicstamps@yahoogroups.com, David Anderson
    <dersonquilter2@y...> wrote:
    > It just so happens, I too am interfacing this same part to a Stamp!
    I am using a BS2, and plan on using the quadrature outputs
    (Xa,Xb,Ya,Yb) and PULSIN. If it works, this will be easier than the
    serial data route.
    >
    > Have you hacked the optical part of the mouse, also? How close do
    you have to get to the object to get good data?
    >
    > Dave
    >
    > bmcd29 <wm@e...> wrote:
    > I am trying to interface my BS2p40 directly with an ADNS-2051
    optical
    > mouse sensor to measure linear displacement. I have removed the
    > existing microcontroller from the mouse and I have referred to the
    > ADNS data sheet. After experimenting with the shiftin and shiftout
    > commands, the synchronous serial communications seem to be over my
    > head. Has anyone used this optical sensor before? I would greatly
    > appreciate any help.
    > Thanks, Bill
    >
    >
    >
    >
    > 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.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! - Internet access at a great low price.
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-16 22:21
    Bill

    Referring to "Basic Stamp Commands, Features, and Projects", page 279, section 6.4, you will see a project that uses PULSIN on two pins simultaneously. This can be found under "Downloads/Documentation". For my application, I am only interested in relative speed of the movement, I don't care what the direction is. Therefore, I intend to use only the pin that has the shortest pulse width, "and throw the other one away". Thanks for the tip about the N&V article.

    Dave

    bmcd29 <wm@e...> wrote:
    Hi Dave
    With little success using the serial communication, I am now
    considering the quadrature outputs from the ADNS as well. One
    problem I am running into is how to measure the relative timing of
    the two (Xa, Xb - I only need one direction) signals by the stamp.
    Pulsin measures it only on one pin and it seems that the relative
    timing of high/low changes between the channels is the important
    factor for determining the amount of motion. Is this right? Have
    you gotten this to work yet?

    As for the optical part, fortunately I am keeping the rest of the
    mouse as is and mounting it just about touching the moving surface.
    I am not sure of how close you have to be for good data. If you need
    to go further, there is an article in the May 2004 Nuts & Volts (p86)
    that describes modifying lenses for this sensor - it may be helpful.

    Bill



    --- In basicstamps@yahoogroups.com, David Anderson
    wrote:
    > It just so happens, I too am interfacing this same part to a Stamp!
    I am using a BS2, and plan on using the quadrature outputs
    (Xa,Xb,Ya,Yb) and PULSIN. If it works, this will be easier than the
    serial data route.
    >
    > Have you hacked the optical part of the mouse, also? How close do
    you have to get to the object to get good data?
    >
    > Dave
    >
    > bmcd29 wrote:
    > I am trying to interface my BS2p40 directly with an ADNS-2051
    optical
    > mouse sensor to measure linear displacement. I have removed the
    > existing microcontroller from the mouse and I have referred to the
    > ADNS data sheet. After experimenting with the shiftin and shiftout
    > commands, the synchronous serial communications seem to be over my
    > head. Has anyone used this optical sensor before? I would greatly
    > appreciate any help.
    > Thanks, Bill
    >
    >
    >
    >
    > 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.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! - Internet access at a great low price.
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]



    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.

    Yahoo! Groups Links






    Do you Yahoo!?
    SBC Yahoo! - Internet access at a great low price.

    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.