PS2
Transcript of PS2
![Page 1: PS2](https://reader036.fdocuments.in/reader036/viewer/2022081719/5456c9d6b1af9fe6448b4605/html5/thumbnails/1.jpg)
Subject: PS/2 Connector
Author: Ali Damirchy –Shahed Univ
G-mail: [email protected]
From Wikipedia, the free encyclopedia
The color-coded PS/2 connection ports
(purple for keyboards and green for mice)
Type Keyboard and computer mouse data connector
Production history
Designer IBM
Designed 1987
Superseded DIN connector and DE-9 connector
Superseded by Universal Serial Bus
General specifications
Pins 6
Connector Mini-DIN
Data
Data
signal
Serial data at 10 to 16 kHz with 1 stop bit, 1 start bit,
1 parity bit (odd)
Pin out
Female connector from the front
Pin 1 +DATA Data
Pin 2 NC Not connected*
Pin 3 GND Ground
Pin 4 Vcc +5 V DC at 275 mA
Pin 5 +CLK Clock
Pin 6 NC Not connected**
* On some computers mouse data for splitter cable.
** On some computers mouse clock for splitter cable.
Color Description
Purple Keyboard
Green Mouse
![Page 2: PS2](https://reader036.fdocuments.in/reader036/viewer/2022081719/5456c9d6b1af9fe6448b4605/html5/thumbnails/2.jpg)
How to CONFIG KEYBOARD in Bascom:
Action
Configure the GETATKBD () function and tell which port pins to use.
Syntax
CONFIG KEYBOARD = PINX.y , DATA = PINX.y , KEYDATA = table
![Page 3: PS2](https://reader036.fdocuments.in/reader036/viewer/2022081719/5456c9d6b1af9fe6448b4605/html5/thumbnails/3.jpg)
ک:يسيکرو به زبان بيبروامه م
:مختصر حيتوض
GetatkbdA
Select Case
توضيح تک تک خطوط:
تعييه ووع ميکرو و فرکاوس کاری آن$regfile = "m8def.dat" $crystal = 8000000
و معرفی پایه های اتصال آن به ميکرو LCDتعييه ووع Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portb.6 , Db5 = Portb.7 , Db6 = Portd.5 , _ Db7 = Portd.6 , Rs = Portd.7 , E = Portb.0
تعریف دو کاراکتر ویصه
Deflcdchar 0 , 32 , 16 , 8 , 4 , 2 , 1 , 32 , 32 Deflcdchar 1 , 32 , 32 , 32 , 13 , 22 , 32 , 32 , 32
تعریف پایه های اتصال کيبورد و جذول مورد استفاده
Config Keyboard = Pind.0 , Data = Pind.1 , Keydata = Key
آماده سازی و تعریف متغير های مورد وياز
Dim A As Word Dim I As Integer Waitms 500 Esc: Cls Home Shiftcursor Right Shiftcursor Right Shiftcursor Right Shiftcursor Right Lcd "Welcome!" Lowerline Shiftcursor Right Shiftcursor Right Lcd "Ali Damirchy" Wait 1 Cls Home
Aدریافت مقذار از کيبورد و رخيره مقذار معادل ان از جذول و رخيره آن در متغيير
Main: A = Getatkbd()
Aری در مورد مقذار يتصميم گ
Select Case A: Case &H05: Cls Home Lcd "F1" Lowerline Lcd "Help!"
![Page 4: PS2](https://reader036.fdocuments.in/reader036/viewer/2022081719/5456c9d6b1af9fe6448b4605/html5/thumbnails/4.jpg)
Case &H06: Cls Home Lcd "F2" Case &H04: Cls Home Lcd "F3" Case &H0C: Cls Home Lcd "F4" Case &H03: Cls Home Lcd "F5" Case &H0B: Cls Home Lcd "F6" Case &H83: Cls Home Lcd "F7" Case &H0A: Cls Home Lcd "F8" Case &H01: Cls Home Lcd "F9" Case &H09: Cls Home Lcd "F10" Case &HF1: Cls Home Lcd "F11" Case &H07: Cls Home Lcd "F12" Case &H0E: Lcd "`" 'Case 50: ' Lowerline Case &HEE: Lowerline 'Case 55: ' Home Case &HDE: Cls Home 'Case 52: ' Shiftcursor Left 'Case 54: ' Shiftcursor Right
![Page 5: PS2](https://reader036.fdocuments.in/reader036/viewer/2022081719/5456c9d6b1af9fe6448b4605/html5/thumbnails/5.jpg)
Case &H0D: Shiftcursor Right Shiftcursor Right Shiftcursor Right Shiftcursor Right Case 92: Lcd Chr(0) Case &HF9: Lcd Chr(1) Case &HCA: Cls Home Lcd "Caps Lock" Case &H14: Cls Home Lcd "Ctrl" Case &HF5: Cls Home Lcd "Alt" Case &HED: Cls Home Lcd "Scroll Lock" Case &HEC: Goto Esc Case 8: Shiftcursor Left Lcd " " Shiftcursor Left Case Else Lcd String(1 , A) End Select jmp main End
تعریف جذول و مقادیر آنKey:
عادیمقادیر جذول در حالت ورمال و
Data 3 , &H01 , 3 , &H03 , &H04 , &H05 , &H06 , &H07 , 3 , &H09 , &H0A , &H0B , &H0C , &H0D , &H0E , 3 Data 0 , &HF5 , 0 , 0 , &H14 , 113 , 49 , 0 , 0 , 0 , 122 , 115 , 97 , 119 , 50 , 0 Data 0 , 99 , 120 , 100 , 101 , 52 , 51 , 0 , 0 , 32 , 118 , 102 , 116 , 114 , 53 , 0 Data 0 , 110 , 98 , 104 , 103 , 121 , 54 , 7 , 8 , 44 , 109 , 106 , 117 , 55 , 56 , 0 Data 0 , 44 , 107 , 105 , 111 , 48 , 57 , 0 , 0 , 46 , 47 , 108 , 59 , 112 , 45 , 0 Data 0 , 0 , 39 , 0 , 91 , 43 , 0 , 0 , &HCA , 0 , &HEE , 93 , 0 , 92 , 0 , 0 Data 0 , 92 , 0 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0 Data 48 , &HDE , 50 , 53 , 54 , 56 , &HEC , 0 , &HF1 , 43 , 51 , 45 , 42 , 57 , &HED , 0
ويس فشرده شذه باشذ Shiftمقادیر جذول در حالتی که دکمهData 0 , 0 , 0 , &H83 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , &HF9 , 0 Data 0 , 0 , 0 , 0 , 0 , 81 , 33 , 0 , 0 , 0 , 90 , 83 , 65 , 87 , 64 , 0 Data 0 , 67 , 88 , 68 , 69 , 36 , 35 , 0 , 0 , 32 , 86 , 70 , 84 , 82 , 37 , 0 Data 0 , 78 , 66 , 72 , 71 , 89 , 94 , 0 , 0 , 76 , 77 , 74 , 85 , 38 , 42 , 0 Data 0 , 60 , 75 , 73 , 79 , 41 , 40 , 0 , 0 , 62 , 63 , 76 , 58 , 80 , 95 , 0 Data 0 , 0 , 34 , 0 , 123 , 61 , 0 , 0 , 0 , 0 , &HEE , 125 , 0 , 124 , 0 , 0 Data 0 , 124 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0 , 0 Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0
![Page 6: PS2](https://reader036.fdocuments.in/reader036/viewer/2022081719/5456c9d6b1af9fe6448b4605/html5/thumbnails/6.jpg)
تصویری از پروشه:
Author: Ali Damirchy –Shahed Universities 7 Oct. 2012
G-mail: [email protected]
Website: www.Encoding.mihanblog.com