Shop OBEX P1 Docs P2 Docs Learn Events
No Keyboard! — Parallax Forums

No Keyboard!

NewzedNewzed Posts: 2,503
edited 2006-07-14 14:15 in Propeller 1
I am absolutely baffled.· Day before yesterday both the keyboard and mouse were working perfectly.· Yesterday and today neither will work.

Here are the keyboard connections:

keyboard pins 24 and 25· 'Both verified for input and output
Power - 5VDC
Ground - Vss
Clock and Data pullted high with 10K to 3.3VDC
Data to pin 24
Clock to pin 25
Keyboard is OK - checked on another computer

When the board is powered up all three little LEDs flash rapidly.· When the program is loaded the three LEDs stop flashing.

I have attached copies of my Keyboard Demo.spin and of keyboard.spin.

Can someone please help.· I'm going mad!!

Sid

Comments

  • dandreaedandreae Posts: 1,375
    edited 2006-06-22 00:01
    Sid,

    Try this code that I have attached and let me know if it works?

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com
  • NewzedNewzed Posts: 2,503
    edited 2006-06-22 00:22
    Doesn't work, Dave.· Does it work on your propeller?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • cgraceycgracey Posts: 14,133
    edited 2006-06-22 00:57
    Dave's gone for the day, but he was using the Propeller Demo Board Rev C, for your information. I'll attach a schematic of that for you to look at.
    Newzed said...

    Doesn't work, Dave.· Does it work on your propeller?

    Sid

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


    Chip Gracey
    Parallax, Inc.
  • El PaisaEl Paisa Posts: 375
    edited 2006-06-22 02:11
    Seems you have problems with your breadboard from day one.
    The Keyboard_Demo.spin·(above works just fine in my setup my own breadboard, Propstick and Parallax demo board))
  • NewzedNewzed Posts: 2,503
    edited 2006-06-22 12:38
    Chip/Dave, I already have a schematic of the Demo board, thanks.

    Here is the problem.· Sunday, both the mouse and the keyboard were working perfectly. Since Monday morning, neither will work.· I have a
    breadboard with two PS2 jacks, one for the mouse and one for the keyboard.· I have indicated the connections in my original post above.· I do n ot think there is anything wrong with my Propeller.· I have run many of the examples Dave Scanlan posted.· Every program works fine as long as it does not have a keyboard or mouse object.

    My question is:· What single thing could have happened that rendered both the keyboard and mouse inoperative?· Why do the three little keyboard LEDs flash rapidly when the keyboard is powered up, then go off when the program is loaded?· I can't use my scope because it is on the workbench attached to a computer that has ME and the Propeller Tool won't run on ME.· Is there anything I can look at or test that might tell me where the problem is.· The two pins for the keyboard, 24 and 25, have been checked to make sure they work both as an input and an output.

    I'm going to strip my PS/2 breadboard and rebuild it.· We'll see what happens.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-06-22 14:39
    I rebuilt the PS/2 breadboard and the TV still said "Keyboard not connected".

    The program said:

    · 'start the keyboard
    · kb.start(24, 25)

    · If KB.Present·····················
    ··· term.str(string("KEYBOARD CONNECTED"))
    ··· term.Out(13)
    ··· Repeat
    ····· term.out(KB.GetKey)
    · Else
    ··· term.str(string("ERROR: KEYBOARD NOT CONNECTED"))
    Then.......I deleted the If/Else statements.· Now the screen displays just the title string and the keyboard works.

    I would like to use the If/Else statements if someone can tell me what I'm doing wrong.

    Sid



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • NewzedNewzed Posts: 2,503
    edited 2006-06-22 14:48
    If anyone knows where I can find "keyboard_iso.spin" I would like to run Example 08.

    Sid
  • cgraceycgracey Posts: 14,133
    edited 2006-06-22 17:09
    Sid,

    I think you've run into your first multi-processing bug! The keyboard isn't 'present' until about 150ms AFTER it is started. That's how long it takes to receive the reset command and clear its head. Meanwhile, it shows 'not-present'. You could add a line after the kb.start to fix this:

    waitcnt(clkfreq/5 + cnt)· 'wait for 1/5 second (200ms)

    I periodically forget to allow for things like this and I've been really stumped on several occasions.
    Newzed said...

    I rebuilt the PS/2 breadboard and the TV still said "Keyboard not connected".

    The program said:

    · 'start the keyboard
    · kb.start(24, 25)

    · If KB.Present·····················
    ··· term.str(string("KEYBOARD CONNECTED"))
    ··· term.Out(13)
    ··· Repeat
    ····· term.out(KB.GetKey)
    · Else
    ··· term.str(string("ERROR: KEYBOARD NOT CONNECTED"))
    Then.......I deleted the If/Else statements.· Now the screen displays just the title string and the keyboard works.

    I would like to use the If/Else statements if someone can tell me what I'm doing wrong.

    Sid



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


    Chip Gracey
    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-06-22 17:23
    Chip, I added the line and the TV still says "Keyboard not connected".

    Sid
  • cgraceycgracey Posts: 14,133
    edited 2006-06-22 17:40
    Sid,
    Sorry. It might need more time than that. Try this:
    waitcnt(clkfreq * 2 + cnt)···· 'wait for 2 seconds
    This may not even be the problem, afterall, but I think it is.
    Newzed said...

    Chip, I added the line and the TV still says "Keyboard not connected".

    Sid

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


    Chip Gracey
    Parallax, Inc.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-06-22 18:24
    Ummm, it might sound silly, but is kb.present returning true/false or maybe something else?
    Just to prove your sanity...

    term.out(kb.present)
    If it's there, it should return a -1, otherwise a 0
    ...
    Next, you said that if you remove the if then, it works, correct?
    Lastly, One of my favorite debuggin tools is to remove "implied" and specify.

    IF KB.Present == True
    ...
    ...
    ELSE
    ...


    I tried... [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • NewzedNewzed Posts: 2,503
    edited 2006-06-22 19:20
    Chip and KaosKidd

    term.out(kb.present) won't work.· If it is a 1, the TV will do nothing.· If it is a 0, it is the same as saying term.out(0), which clears the screen.

    I tried

    if kb.present == True

    and that worked.· Screen said "Keyboard connected".· Chip, I kept reducting the pause after kb.start.· "waitcnt(clkfreq/2 + cnt)" was as short as I could go and stll make it work··- that's 500ms..

    I wrote

    if kb.present
    .....
    ,,,,
    else

    and it still worked so the problem was the lack of a suitable pause after· kb.start.

    Thanks to both of you.· Now the "kb.present" check routine works fine.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-06-23 14:09
    As an after thought...
    While writing a keyboard handler I was running into the numeric outputs being used as control codes (ie clear, color, etc)
    So what I did was force it into the ascii numeric range (48..57), so I could actually see what was getting returned.
    For example, something like Term.out(49+KB.present)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • edited 2006-07-14 14:15
    My keyboard wasn't working either. The sample Keyboard_Demo posted earlier worked - and the difference is "kb.start(26, 27)" which if pasted into the Keyboad_Demo that comes with the Propeller Tool makes my keyboard start working. I'm a newbie, so I don't know what the difference in the numbers means yet, but I thought I'd post this for others having the same issue. BTW, the original Keyboard_Demo has the line as "kb.start(24, 25)".
Sign In or Register to comment.