OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 23, 2017 3:46 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: The keyboard typing rate
PostPosted: Mon Jul 19, 2004 1:41 am 
Hello,
How do you change the keyboard typing rate (what ports and what data must be sent to them)?
Thanks for any help.


Top
  
 
 Post subject: Re:The keyboard typing rate
PostPosted: Mon Jul 19, 2004 2:01 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 7821
Location: At his keyboard!
Hi,

ManOfSteel wrote:
How do you change the keyboard typing rate (what ports and what data must be sent to them)?


You'd send the command 0xF3 to the keyboard controller chip, followed by a byte containing the repeat rate and delay:

Code:
   mov al,0xf3
   call sendData
   jc .exit
   mov al,[keydevArate]            ;al = default repeat rate and delay
   call sendData


Code:
%define STATUSPORT   0x64
%define COMMANDPORT   0x64
%define DATAPORT   0x60

;Send data to controller or device A
;_______________________________________________________________________________

sendData:
   pushes ebx,ecx
   push eax
   mov ebx,[SIBtickHigh]
   mov ecx,[SIBtickOver]
   add ebx,1
   adc ecx,0
   OSCALL 0x39           ;Sleep for 1 mS

   mov ebx,[SIBtickHigh]
   mov ecx,[SIBtickOver]
   add ebx,100         ;100 mS timout
   adc ecx,0
.sd1   in al,STATUSPORT
   test al,controllerInputFull
   je .sd2
   cmp [SIBtickOver],ecx
   jb .sd1
   cmp [SIBtickHigh],ebx
   jbe .sd1
   pop eax
   pops ebx,ecx
   stc
   ret

.sd2   pop eax
   out DATAPORT,al
   pops ebx,ecx
   clc
   ret


The repeat rate and delay values are avaliable at:
http://panda.cs.ndsu.nodak.edu/%7Eachap ... board.html

The keyboard should send an "ACK" (0xFA) in response.


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Gigasoft, Google [Bot] and 11 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group