Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard and Mouse still not working AND Keyboard.spin ERROR ??? — Parallax Forums

Keyboard and Mouse still not working AND Keyboard.spin ERROR ???

T&E EngineerT&E Engineer Posts: 1,396
edited 2006-07-21 00:17 in Propeller 1
I have looked over all of my PS2 connections many times going to my Prop stick and checked them with a meter many times. I can't get any keyboard or mouse programs to work. I get no response. Yes, I have looked for the 24, 25 for the mouse and 26, 27 for the keyboard and I still get nothing. I have seen others that can't get it working either. Are we doing something different? What is the secret? Sorry just getting a bit fustrated as I have been looking at this for 2 days and don't see anything wrong. I have tried 2 different mouses and 2 different keyboards. PLEASE HELP!!!


On another note when I try to run the Keyboard_demo.spin which then calls the Keyboard.spin object I get an error in the assembly code.

SOURCE REGISTER/CONSTANT CANNOT EXCEED $1FF

and then the Keyboard.spin assembly code below is highlighted on the

rev·· data,#-3

line of code (the "-3" is what is highlighted - see last statement)

·Configure keyboard
'
configure·············· mov···· data,#$F3·············· 'set keyboard auto-repeat
······················· call··· #transmit
······················· mov···· data,_auto
······················· and···· data,#%11_11111
······················· call··· #transmit
······················· mov···· data,#$ED·············· 'set keyboard lock-leds
······················· call··· #transmit
······················· mov···· data,_locks
······················· rev···· data,#-3


It does not mater if the mouse or keyboard is plugged into the PS2 cables or not. Every connection electrically is correct as seen with an ohm and continuity meter all the way back to the A24-A27 pins going all the way to the PS2 cable ends.

Please help if you can. It must be something simple but I don't see it.

Thanks.

Post Edited (T&E Engineer) : 7/20/2006 10:33:41 PM GMT

Comments

  • NewzedNewzed Posts: 2,503
    edited 2006-07-20 23:05
    On your error, change the "rev" instruction to:

    ·rev···· data,#-3 & $1F··

    That will take care of that.

    On your keyboard, let's review:

    Keyboard to 5VDC and Gnd
    Pullups on data and clock pins to 3.3V

    Your program should say - kb.start(26) and your keyboard data line must be connected to pin 26.

    When you power up, do the little LEDs on the keyboard flash one time then go off?

    Sid
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2006-07-20 23:51
    OK. I checked the pins again and I did have the 10K resistors going to 5v not 3.3v. I changed them and still nothing.

    I do have the Keyboard data wire (orange) going through a 100 ohm resistor to A26 and clock wire (brown) going through a 100 ohm resistor to A27. Both have the 10K resistors each now going to 3.3v pin on the Propeller chip. The +5v wire (red) is going to +5v and the·ground wire (black) is going to ground.

    Likewise on the mouse·is going in the same fashion·of resistor networks·to A24 and A25.

    However, the 3 LEDs on the keyboard (num lock, caps lock and scroll lock) stay on now but the pulse or flicker off every 1/2 second or so but for the most part they look like they are on.

    I did add the "& $1F" code to the Keyboard.spin line and at least now it compiles. All I see on the screen is:

    Keyboard Demo...

    No key pushes seem to do anything.

    I tried other keyboard programs and the keyboard does not respond.



    When I tried running Example 8 - Keyboard input:

    The TV screen says "ERROR: KEYBOARD NOT CONNECTED"

    ????

    Post Edited (T&E Engineer) : 7/20/2006 11:58:05 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2006-07-21 00:17
    WORKING.

    I swapped the Data and Clock lines and both the mouse and the keyboard work now.

    The PS2 connectors on the Propellor Demo Board Rev C schematic probably need to have a NOTE updated on them. Are they incorrectly labeled?

    If I did have them reversed then I would see +5v where the ground is. I have them wired as per the schematic which makes it look like the DATA wire is where the CLOCK wire should be and vice versa.

    This is an important note to let everyone know that if you are having problems getting the mouse and keyboard to work try the following:

    1. Make sure that the 10K resistors are going to 3.3v not 5v.

    2. Try swapping the DATA and CLOCK lines.

    I hope this helps others as I spent 2 days trying to figure this out.

    Thanks again.
Sign In or Register to comment.