Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

AT Keyboard and initialization

Status
Not open for further replies.

alunaro

Member level 5
Joined
Jan 15, 2002
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Another world
Activity points
768
hi

I need information about commands that PC sends to Keyboard in initialization process (when booting), or anothers configuration commands, and their sequence.
I need then to interfacing with pic


thanks!!

bulkman@eresmas.com
 

barny

Member level 1
Joined
Apr 6, 2002
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
415
AT keyboard interface

Try hxxp://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/atkeyboard.html which seems to have a good description of how it all works.

I did a google search for "PC keyboard interface ps/2 command".

I used to work for a keyboard manufacturer, and we worked out how to do it by unsoldering the mask-programmed micro on kbd and motherboard, and reverse-engineering them. The IBM AT reference manual (if you can get your hands on it - at least 15yrs old now!) has some timing diagrams and interface descriptions too.

It's an interesting bidirectional interface, fun to code a controller for, and quite hard to get right, so good luck!

HTH
Barny
 

alunaro

Member level 5
Joined
Jan 15, 2002
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Another world
Activity points
768
IBM top secret!

mmmh I have read that web some time ago, and have some obscure points.

maybe, I could get IBM's AT keyb manual xD, buf... I will be a hard work.

The principal problem is.. timmings, and comands that host sends to keyboard and what it response: usually only simple responses are showed, as typematic, rate.. but nothing about anothers commands.. xD

IBM manual... I gotcha U!!

Thaaaaaanks
 

socketz

Junior Member level 3
Joined
Dec 22, 2001
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
148
No big timing problems, PS/2 keyboard is syncronous, the interface uses 4 pins: 5V, GND, DATA (bidir) and CLOCK. The interface uses open collector with pullups. Never DRIVE this pins or you'll blow something. Best way is to keep the port LOW and invert it form input (HIGH via pullup) to outpt (LOW). It's not easy to do what you intend to, took me 2 months to have a fully working keybord emulator (code is copyrighted, sorry)
 

alunaro

Member level 5
Joined
Jan 15, 2002
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Another world
Activity points
768
mmh yes, I know that interface, doing ports input or output.

I've got engouh information about timings, but sometimes it says opposite things!!. Now timings are't problem... but commands and their responses are.

mmmh www!!! I'm coming again!!

Thanks for your advisory. xD

mmmh what was most dificult for you when coding your keyb emulator?
 

s_a_r_a

Junior Member level 2
Joined
Jul 4, 2002
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
176
Dear Alunaro,
you wrote:

>I need information about commands that PC sends to Keyboard in >initialization process (when booting), or anothers configuration >commands, and their sequence.
>I need then to interfacing with pic

What you need is on the August 2002 issue of 'Electronics World':
"Interfacing an AT keyboard to a PIC microcontroller".

Best Regards,

s_a_r_a
 

alunaro

Member level 5
Joined
Jan 15, 2002
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Another world
Activity points
768
mmh do u know if there is some web with this magazine in electronico format? xDD I think it could be a little hard to find here xDD

hahahaha :roll:

Thank u.
 

alunaro

Member level 5
Joined
Jan 15, 2002
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Another world
Activity points
768
help wit some questions.... if you can

Hi again.. xD

I have some questions and I have several responses to them, but sometimes the information contradict itself:

1. keyb have a buffer of 16 bytes, and when it generates an buffer-overrun, some docs say that the error code must be placed in 17th byte of buffer!!! (amazing! if it only has 16 byte!!). Any body knows how it works? :? I know that error code must be sent to host if buffer-overrum happen, but I dont know if I must simply send the error code in next transmition or I must place the error code byte in the buffer (pos 17th) and when host tries to read the buffer, it will read only the 17th byte of buffer (error code).
I have read answers of all flavours about it xD

2. The have 2 docs: one says that keyboard latches data from host (host send data to keyb) when clock pulse is in high level. The other, says in the rising edge of clock pulse. :?: <-- my face when I read it!

anybody can help me with this questions? I'll be very pleased xD
:lol: <-- my face if I resolve these questions


mmmh I love this forum :D <-- my face when I read this forum

Thanks for all.
 

barny

Member level 1
Joined
Apr 6, 2002
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
415
Re: help wit some questions.... if you can

1. 16-byte buffer with overflow
Be realistic; after all if you've got overflows, whether you actually lose the 15th or 16th isn't going to make any real difference, so if some data has to be sent when the buffer is full, write the error code over what was in the 16th location. If you don't like the idea of losing anything, unnecessarily, you could define 'full' as having 14 codes in the buffer, write the 15th which is the overflow and add the error code in the 16th location.

2. What it's saying is that the value has to be stable at the sender while the clock is high (i.e. change before it goes high and not change until clock has gone low), and the receiver should read it as soon as the clock goes high.

HTH
Barny
 

alunaro

Member level 5
Joined
Jan 15, 2002
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Another world
Activity points
768
yeah.. xD I thought that idea about buffer, but as I want to make a realistic keyb emulator.. I only wanted to understand how real key works, but docs aren't very clean sometimes xD

and about data stable.. I found out some docs about it, this afternoom... data must be stable at least 1us after the high level, and keyb usually latches data in rising edge of clock signal. But really, it doesn't matter because timings aren't too much strict about this xD

aah I forgot to tell that i'm makin a manual of keyb protocol but in spanish, so sometimes I need exact information and not the things that I have found xDDD English, sometimes is hard to me, and translating techinical documents about protocols, need a exact translation xD

Thank 4 u time xDD I hope don't disturb u too much !!
 

s_a_r_a

Junior Member level 2
Joined
Jul 4, 2002
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
176
Dear Alunaro,
I hope I can help you a little bit.
I try to read something about the connection between
a keyboard and an host microcontroller (a pic in the example).
I found this information:

1- When serial data is sent from keyboard to PIC, data is read on the falling clock edge.

2-Sending commands to the keyboard, data is set on the falling clock edge and read by the keyboard on the rising clock edge.

The communication protocol is bidirectional, but as there are only two lines the handshaking between keyboard and PIC is more complicated. The keyboard communication is a strange mix with elements of both synchronous(separate data and clock) and asynchronous (start/stop bits)data transmission.

Ciao
 

Mr_Programmer

Full Member level 3
Joined
Feb 21, 2002
Messages
153
Helped
9
Reputation
18
Reaction score
5
Trophy points
1,298
Activity points
1,424
Hey Guys,
I had to programm a keyboard controller some time ago. No paper told me that time, that you have to wait some hundret's of milliseconds before you have to send BAT complete. Timing is no problem because it's really edge triggered. To see working code go to www.cypress.com and look for some keyboard reference designs (section USB).
 

fireplus

Full Member level 3
Joined
Oct 31, 2003
Messages
182
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
1,633
look at www.8052.com
there are a routine for ps2 at keybord i test it and it works fine
 

mcs51

Newbie level 6
Joined
Jan 27, 2004
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
164
i have converted the bascom code to assembly and it works prefectly
 

HSAMS

Member level 1
Joined
Jan 10, 2004
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
229
It is very simple if you search on Yahoo ,i don't remember detail however i know a pdf file that give information about interface between HC6805 and AT keyboard.Try your best ! Good luck
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top