Shop OBEX P1 Docs P2 Docs Learn Events
Mouse with PropStick — Parallax Forums

Mouse with PropStick

Jim CJim C Posts: 76
edited 2006-05-11 12:52 in Propeller 1
My way of learning about systems is from the hardward first, which leads inevitably to the software. Current status of the PropStick start-up: It's running smoothly, and almost all of the examples work without problem, including the TV with Graphics_Demo.

Next part of the hardware check out was the mouse. Carefully following the Demo Schematic, I wired the mouse data line to A24 and clock line to A25. However when attempting to run the Graphics_Palette, there was no movement of the mouse cursor. First step was to confirm the mouse worked on another computer. The Parallax mouse actually didn't work on another machine, so I used the PS/2 mouse that was working and tried it on the PropStick. Again, no movement of the cursor in the Palette routine.

Not sure where to go from here. As a simple double check of the Propeller, I was able to confirm A24 and A25 work correctly as inputs and outputs, using Example 7 (ReadingAnInputPort) and Example 1 (Flashing LEDs).

Suggestions on how to debug mouse operation?

Jim C

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-08 20:24
    You might want to just put it into a loop and output the position values -- if you've got video output working you can use the TV_Terminal object to write values to that display.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Jim CJim C Posts: 76
    edited 2006-05-08 21:06
    Well, I got it. I figured it was going to be obvious, and it was indeed staring me in the face.

    I was using the drawing for the demo board called "Propeller Demo Board, Rev B". Turns out it is wrong. According to a reference online, the data line and the clock line indicated on the Rev B drawing are switched. Attached is a mirror image of the correct wiring. (Note this drawing is from the perspective of the plug, which is a mirror image of the recepticle)

    Changing the wires going to A24 and A25 to correct this error got the mouse going.
    280 x 171 - 11K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-10 12:16
    It is not really wrong, just un-numbered.

    I am not surprised by this, the web is full of mirror images of these plugs without the proper notation about 'looking into' or 'looking out of'. At first glance, everyone assumes one or the other without thinking.

    I think it is worth mentioning that there are older mice and keyboards with the 5 pin plug [noparse][[/noparse]and larger]. The arrangement is not the same and either one should carefully get good info OR just use an adapter.

    'Propeller Demo Board, Rev. C' schematic is available.
    But, it still appears to be the mirror image of yours.

    I still don't understand what you are saying though. Is this looking 'down into the recepticle's holes' or 'looking into the plug's pins'?
    As you can see, it becomes tricky to convey the meaning.

    I would offer up the answer, but I can't locate

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 5/11/2006 5:36:12 AM GMT
  • JamesxJamesx Posts: 132
    edited 2006-05-10 13:51
    These connectors and drawings and orientations get a little tangled up. Seems to me the drawing of the connector in the Rev B/C schematic has a drawing of the recepticle on the board, looking at it from its front, such that we're looking into the holes. The drawing attached to the earlier note shows the plug (the part you hold in your hand), looking at the pins. If you're looking at both of these part from the 'front' end, it would make sense that they are mirror images. When you bring them together, they line up.

    So, use the 5V pin for orientation. The clock and data lines are on the other side of the circle from the 5V pin with both the plug and the recepticle. BUT, note that on the plug drawing the clock pin is on top-left and the data pin in on bottom-left, and on the recepticle drawing (Rev B/C) it shows the data and clock pin/hole reversed, such that the data pin/hole is on top and the clock pin/hole is on the bottom.

    If the wiring to these two pins is mixed up, it doesn't really matter, as it can also be fixed on the mouse driver, Mouse.Spin. The first command there is: PUB start(dpin, cpin) : okay Just switch the values of dpin and cpin.

    Eventually, I suppose we'll all have Parallax Propeller Demo Boards, and this business will be all worked out. But while I'm at the breadboard stage, I wind up having to drill all the way down to get things to work. And speaking of the actual Demo board, comparing the picture of the board layout with the schematic, it looks to me like they don't match. Won't be able to tell for sure until there's a wired up one to test, but it looks like on the layout, Pin A24 on the Propeller goes to pin 1 on the PS/2 connector like it's supposed to, and on the schematic, pin A24 goes to pin 5 on the connector.


    (Picture of Rev C. Schematic is at http://forums.parallax.com/forums/attach.aspx?a=7248)
    (Picture of Demo Board layout: http://forums.parallax.com/forums/default.aspx?f=25&p=1&m=120897)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-11 05:39
    In short, JamesSX says the Parallax documents have the image as if you were 'Looking into the holes' of the plug/ recepticle'.

    Don't confuse the backside with the frontside and all will be well.
    Obviously to have to reverse the image in your mind to properly solder wires to the backside.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 5/11/2006 4:41:36 PM GMT
  • inakiinaki Posts: 262
    edited 2006-05-11 12:52
    I am trying to connect a mouse to the Propstick but I get no response from the Propeller.
    The mouse lights up so it is powered.
    I have even tried to flip the Data and Clock signals to test a possible mismatch between both.

    Anyone has a scope picture to see the shape of the signals CLOCK and DATA ?
    I get in both signals a similar shape but inverted.
    Pulses are 11ms appart and are 128us wide.

    Update: Problem solved. The pull up resistors were not making contact with VDD.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (inaki) : 5/11/2006 7:17:58 PM GMT
Sign In or Register to comment.