Presentation is loading. Please wait.

Presentation is loading. Please wait.

PS/2 Mouse/Keyboard Port Lecture L9.4. PS/2 Port.

Similar presentations


Presentation on theme: "PS/2 Mouse/Keyboard Port Lecture L9.4. PS/2 Port."— Presentation transcript:

1 PS/2 Mouse/Keyboard Port Lecture L9.4

2 PS/2 Port

3 PS/2 Port Timing

4 Keyboard

5 Make and Break Codes Keyboard Scan Codes – Set 2 http://www.Computer-Engineering.org

6 Scan code = 15h (Q) PS/2 Port Timing ~25 KhZ clock

7 --Flip Flops used to condition signals coming from PS2-- Process (pclk, clr, KC, KD) begin if(clr = '1') then DFF1 <= '0'; DFF2 <= '0'; KDI <= '0'; KCI <= '0'; else if (pclk = '1' and pclk'Event) then DFF1 <= KD; KDI <= DFF1; DFF2 <= KC; KCI <= DFF2; end if; end process; Filter clock and data signals from PS/2 port pclk KD DFF1 KDI pclk KC DFF2 KCI pclk <= clkdiv(3);-- 3.125 MHz0.32 us period

8 --Shift Registers used to clock in scan codes from PS2-- Process(KDI, KCI, RST) begin if (RST = '1') then ShiftRegSig1 <= "00000000000"; ShiftRegSig2 <= "0000000000"; else if (KCI = '0' and KCI'Event) then ShiftRegSig1(10 downto 0) <= KDI & ShiftRegSig1(10 downto 1); ShiftRegSig2(10 downto 1) <= ShiftRegSig1(0) & ShiftRegSig2(10 downto 2); end if; end process; ShiftRegSig1 ShiftRegSig2 KDI 1 10 0 0 D7D6D5D4D3D2D1D0P1 0 D7D6D5D4D3D2D1D0P1

9 --Wait Register process(ShiftRegSig1, ShiftRegSig2, RST, KCI) begin if(RST = '1')then WaitReg <= "00000000"; else if(KCI'event and KCI = '1' and ShiftRegSig2(8 downto 1) = "11110000")then WaitReg <= ShiftRegSig1(8 downto 1); end if; end Process; F0

10 Host-to-Device Communication

11 1) Bring the Clock line low for at least 100 microseconds. 2) Bring the Data line low. 3) Release the Clock line. 4) Wait for the device to bring the Clock line low. 5) Set/reset the Data line to send the first data bit 6) Wait for the device to bring Clock high. 7) Wait for the device to bring Clock low. 8) Repeat steps 5-7 for the other seven data bits and the parity bit 9) Release the Data line. 10) Wait for the device to bring Data low. 11) Wait for the device to bring Clock low. 12) Wait for the device to release Data and Clock Host-to-Device Communication http://www.Computer-Engineering.org

12 Mouse Speed of mouse pressing left & right button sign overflow


Download ppt "PS/2 Mouse/Keyboard Port Lecture L9.4. PS/2 Port."

Similar presentations


Ads by Google