PS2 MouseKeyboard Port Lecture L 9 4 PS2
PS/2 Mouse/Keyboard Port Lecture L 9. 4
PS/2 Port
PS/2 Port Timing
Keyboard
Make and Break Codes http: //www. Computer-Engineering. org Keyboard Scan Codes – Set 2
PS/2 Port Timing ~25 Kh. Z clock Scan code = 15 h (Q)
Filter clock and data signals from PS/2 port --Flip Flops used to condition signals coming from PS 2 -Process (pclk, clr, KC, KD) begin if(clr = '1') then DFF 1 <= '0'; DFF 2 <= '0'; KDI <= '0'; KCI <= '0'; else if (pclk = '1' and pclk'Event) then DFF 1 <= KD; KDI <= DFF 1; DFF 2 <= KC; KCI <= DFF 2; end if; end process; KD DFF 1 KDI KC DFF 2 pclk <= clkdiv(3); -- 3. 125 MHz 0. 32 us period KCI
--Shift Registers used to clock in scan codes from PS 2 -Process(KDI, KCI, RST) begin if (RST = '1') then Shift. Reg. Sig 1 <= "000000"; Shift. Reg. Sig 2 <= "00000"; else if (KCI = '0' and KCI'Event) then Shift. Reg. Sig 1(10 downto 0) <= KDI & Shift. Reg. Sig 1(10 downto 1); Shift. Reg. Sig 2(10 downto 1) <= Shift. Reg. Sig 1(0) & Shift. Reg. Sig 2(10 downto 2); end if; end process; KDI 10 1 P D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 Shift. Reg. Sig 1 0 10 0 1 1 P D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 Shift. Reg. Sig 2 0
--Wait Register process(Shift. Reg. Sig 1, Shift. Reg. Sig 2, RST, KCI) begin if(RST = '1')then Wait. Reg <= "0000"; else if(KCI'event and KCI = '1' and Shift. Reg. Sig 2(8 downto 1) = "11110000")then Wait. Reg <= Shift. Reg. Sig 1(8 downto 1); F 0 end if; end Process;
Host-to-Device Communication
Host-to-Device Communication 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 http: //www. Computer-Engineering. org
Mouse sign overflow pressing left & right button Speed of mouse
- Slides: 12