Shop OBEX P1 Docs P2 Docs Learn Events
interfacing BS2 with serial mouse? — Parallax Forums

interfacing BS2 with serial mouse?

Mike VSMike VS Posts: 1
edited 2006-07-11 13:53 in BASIC Stamp
I'm trying to interface my BS2 with an old serial mouse, but I·can't figure out the serial comminications.·(I'm hoping to hook the x and y axis encoders·up to the wheels of my boe-bot kit to do dead reckoning.) The docs I've found for serial mice indicates that they communicate 1200 baud, 7N1 (see http://www.cs.net/lucid/mouse.htm). I cooked up a little program on my computer that validates this, and I can see the mouse data coming back correctly.

I tried to read the mouse data with my BS2, however I seem to be stuck, because·the·docs for SERIN don't show how to do 7 bits with no parity. It seems like I can only either use 8 bits, no parity or 7 bits even parity. Any way to do this, or should I find a different way to add wheel encoders?

thanks!
Mike.

·

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-07-09 01:19
  • Oper8r AlOper8r Al Posts: 98
    edited 2006-07-09 07:54
    Mike,
    This may also work for you.

    http://www.multilabs.net/ezMOUSE.html

    Alan
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-07-09 10:21
    The serial communications is quite complex. 11 bits in one direction and 12 bits in the other. Al Williams and several others have created PICs to modify it to RS-232 and 8bits/byte.

    Alternatively, Parallax's Propeller will handle all this and the code to support the mouse is already written as an object. With the Propeller, you can have Video as well and 32 pins of I/O to play with. At $25 for the 40pin DIP version, it is competative with a lot more growth options.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • MarcelMarcel Posts: 32
    edited 2006-07-11 13:53
    Mike VS said...
    I'm trying to interface my BS2 with an old serial mouse, but I·can't figure out the serial comminications.·(I'm hoping to hook the x and y axis encoders·up to the wheels of my boe-bot kit to do dead reckoning.) The docs I've found for serial mice indicates that they communicate 1200 baud, 7N1 (see http://www.cs.net/lucid/mouse.htm). I cooked up a little program on my computer that validates this, and I can see the mouse data coming back correctly.

    I tried to read the mouse data with my BS2, however I seem to be stuck, because·the·docs for SERIN don't show how to do 7 bits with no parity. It seems like I can only either use 8 bits, no parity or 7 bits even parity. Any way to do this, or should I find a different way to add wheel encoders?

    thanks!
    Mike.

    It won't solve your problem with the BS2 7 bits, no parity but it has a lot of technical information of the serial mouse.

    http://www.epanorama.net/documents/pc/mouse.html

    At the moment I'm sniffing at an old·Logitech mouse that I·want to·abuse lol.gif· as·a pulse counter to count the kW pulses of my home 230V system. If the·light·flashes 1000 times 1 KwH has been consumed.

    I'll try first to manage this via the serial port. when this work I'll think of buying a BS2 and a PINK device. In the same closed/cabinet the router is located so this is a first step up to some Home Domotica.

    Regards,

    Marcel

    Post Edited (Simplemind) : 7/11/2006 2:12:31 PM GMT
Sign In or Register to comment.