PC keyboard

ZXNet echo conference «code.zx»

From Roman Moiseev To All 28 May 1997

* Message from gate SpbZxNet<=>FidoNet. Hello, All! Here in 82 online there was information about the controller PC keyboards on turbo 2+, and more specifically, I was interested in that it can be controlled programmatically. Here it is: ======================kut================ Starting with version 7.00, ms appeared on the computer. 8031 what radically changed the operation of the #FE port and made it possible to connect Read IBM XT keyboard. When trying to read the contents of the keyboard, the processor gives command IN A,(#FE), special is cocked. trigger and processor stopped is indicated by the WAIT signal. At the same time, the microcontroller has 8031 generation The interrupt is fired. After the necessary translation procedures, the address lines, the microcontroller outputs a co- keyboard freezes, the WAIT signal is reset and the processor continues despises his work. The presence of 8031 and an extended keyboard (101 keys) allows How to simplify keyboard polling in CP/M to just reading code keys, however, this required the introduction of additional commands to control the 8031, and since the only possible way transfer data to 8031, this is the state of the high half of the ad bus res Z80 at the time of reading the #FE port, this method is used. Keyboard control sequences: _#55_ - indicates that the next byte is a code keyboard commands. In response, the keyboardrotates code #AA - this can be used to checking the presence of 8031. LD A,#55 IN A,(#FE) CP#AA JR NZ,NO_XT LD A,COMM ;command (see below) IN A,(#FE) LD A,ARG1 ;additional parameters (may be missing) IN A,(#FE) LD A,ARG2 ;additional parameters (may be missing) IN A,(#FE) _#00_ - Reads the code of the pressed key. XOR A IN A,(#FE) ;in the battery there is a key code (the list of codes is given below) _#80_ - reads the 1st byte of keyboard flags LD A,#80 IN A,(#FE) _#40_ - reads the 2nd byte of keyboard flags LD A,#40 IN A,(#FE) Command codes (Attention! Before writing the command code, you must give ex. code _#55_ to put 8031 into command input mode): 1 get 1 byte of the program version number #41 get 2 bytes of the program version number #81 get 3 bytes of the program version number #C1 get 4 bytes of the program version number 7 Erase the keyboard buffer and all flags 8 DATA operating mode setting: bit 0.1 - operating mode is set 0 - Sinclair keyboard emulation 1 - read key code (flags are not processed) 2 - CP/M mode 3 - direct reading of code from the serial port of the keyboard viaturesbit 7 - mode 0-lat 1-rus (only for CP/M) 9 get the contents of memory location 1 #49 get the contents of memory location 2 #89 get the contents of memory location 3 #C9 get the contents of memory location 4 #0A will switch to Russian letter input mode #0B will switch to Latin letter input mode #0C program pause #0D restarting the computer #10 get seconds #50 get minutes #90 get a watch #11 DATA set seconds #51 DATA set minutes #91 DATA set clock #12 get a number #52 get a month #92 get a year #13 DATA set number #53 DATA set month #93 DATA set year #14 DATA forces some signals (set occurs if the corresponding bit is 1) bit 0 = 0 bit 1 = 0 bit 2 = 0 bit 3 DTR bit 4 RTI bit 5 = 0 bit 6 = 0 bit 7 = 0 #15 DATA forcefully resets some signals (reset occurs if the corresponding bit is 1 (see com #14) #16 read the contents of port P3 bit 0 - bit 1 - bit 2 - bit 3 - bit 4 VE1 bit 5 - bit 6 - bit 7 - #17 read RS232 status bit 0 CDbit 1 CTS bit 2 RI bit 3 - bit 4 - bit 5 - bit 6 - bit 7 - ========================kut============ So I’m interested in the question: is this really possible on Scorpio? or not? I mean software control of the single chip in the keyboard controller?? -+- Is-Dos v4.5 + Origin: Pack Camel (812/04.00)