CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Some PS2 keyboard interfacing problems

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
water_river



Joined: 17 Feb 2004
Posts: 16

View user's profile Send private message

Some PS2 keyboard interfacing problems
PostPosted: Wed Mar 03, 2004 4:19 am     Reply with quote

hi,all
I am doing a PS2 keyboard interfacing project with the microcontroller but meet some strange problems:


1. It usually sends out two or three bytes when a key is pressed, but none of them is the value in the keyboard translation table.

2. When connecting the keyboard to a pc at the same time, the bytes sent out are different from those without connection to pc. And they are always changing. However, the pc can get the input without any error.

3. The clock input ususally seems causing 12 cycles when a byte is being sent, but according to the sources online it should be 11 cycles.


Could anyone give some thoughts on those problems to me ??
I am also wondering whether we need to do some initializations to the keyboard. Do anyone have any ideas about that??
Thanks in advance
Hans
Guest







PostPosted: Wed Mar 03, 2004 5:10 am     Reply with quote

maybe this can start you going ...
http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/PS2/ps2.htm

best regards
Ttelmah
Guest







PostPosted: Wed Mar 03, 2004 6:06 am     Reply with quote

Hans wrote:
maybe this can start you going ...
http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/PS2/ps2.htm

best regards


Seperately, the 'codes' involved, are not the key numbers expected. The codes returned, are the keyboard 'scan code' (which is distinct from the keyboard number).
If you look at:
<http://www.opencores.org/cvsweb.shtml/ps2/misc/scancode_translation_values>
The code for this contains the translation table for these values.

Best Wishes
JimFranklin



Joined: 03 Mar 2004
Posts: 2
Location: Warrington, England

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Mar 03, 2004 6:48 pm     Reply with quote

Quote:
I am doing a PS2 keyboard interfacing project with the microcontroller but meet some strange problems:


Me too, I grabbed the PS/2 connector diagram from the 'net, wired it to the pic and smoked the keyboard....

ah, when they connector as viewed from "pin end" they didn't actually mean the "pin end", they meant the wire end.. :(

Jim.
[currently working on keyboard No. 2]
_________________
The good thing about being mad, is that you always have someone to talk to, even if it is yourself.
water_river



Joined: 17 Feb 2004
Posts: 16

View user's profile Send private message

PostPosted: Thu Mar 04, 2004 1:16 am     Reply with quote

hi,all,
Thank you ver much. I found that some clock cycles were missed as too many things were done inside the interrupt function. Now I can get the data correctly. But when I try using another keyboard, which is relatively new, the bytes gotten seem different, for example, "1c" becomes "8c". I can still get the break code "F0". Does anyone know why??
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group