Shop OBEX P1 Docs P2 Docs Learn Events
AW: [basicstamps] Connect BS2 to Keyboard port — Parallax Forums

AW: [basicstamps] Connect BS2 to Keyboard port

ArchiverArchiver Posts: 46,084
edited 2002-07-08 12:58 in General Discussion
Hi Folks,

first thing is it seems that bs2 is too slow for the job, BSx works fine
though. PS 2-code is easy to find in the web, also the hardware connections.

Here is the code that I used, just the bit that does the actual shifting of
data into the PC.

One more important thing: when booting the PC you should have a Keyboard
connected to the PC because they do a confusing handshake before they start
working and that is not easy to simulate. One guy sent me a code once that
he said would do the job but it didn't work for me...

The bad thing about me is, taht I keep forgetting how I did things... sorry.
Hope it still works.

I also collected all the Mails when I first asked the group, so if anybody
wants me to forward all of them, just let me know.

Ok, here is the shifting code that works with BSX:


___________________________________________________-

hexen:
einszaehler=0 'counter used for parity bit
gosub nullschieben 'send a 0 as startbit
z1 = zeichen.bit0
gosub rausschicken 'send databits
z1 = zeichen.bit1
gosub rausschicken
z1 = zeichen.bit2
gosub rausschicken
z1 = zeichen.bit3
gosub rausschicken
z1 = zeichen.bit4
gosub rausschicken
z1 = zeichen.bit5
gosub rausschicken
z1 = zeichen.bit6
gosub rausschicken
z1 = zeichen.bit7
gosub rausschicken

gosub parity 'send parity-bit
gosub nullschieben 'send stopbit


return

rausschicken:

branch z1,[noparse][[/noparse]nullschieben,einsschieben] 'decide to send 0 or 1


nullschieben:

low daten
low clock 'clock out
input clock
return

einsschieben:

einszaehler=einszaehler+1 'parity-counter
input daten
low clock 'see above
input clock
return

parity:

if einszaehler.lowbit=0 then hopp
gosub nullschieben 'if number of ones odd then
return 'send zero
hopp:
gosub einsschieben 'if even send one
return


____________________________________________________________________________
__

Urspr

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-07-08 12:58
    Have you tried www.milinst.com ?

    They have a plug and play version...

    Greetings, Uli



    Urspr
Sign In or Register to comment.