fpga(field programmable gate array) ppt 1(2).pptx

99220041819 8 views 10 slides Jul 24, 2024
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

field programmable gate array


Slide Content

PS/2 keyboard Interface FPGA b.Manikanta

PS/2 keyboard INTERFACE Understanding PS/2 Protocol Study the PS/2 protocol specifications to understand the communication between the PS/2 keyboard and the host (FPGA). PS/2 protocol involves bidirectional serial communication with clock and data lines, similar to the PS/2 mouse protocol. Designing the Interface Module: Develop the interface module in HDL (Hardware Description Language) such as Verilog or VHDL. The module should handle timing requirements, bidirectional data exchange, and protocol adherence. Clock Generation: Generate clock signals required for PS/2 communication. The PS/2 protocol typically operates at a standard frequency (usually 10-16 kHz).

PS/2 keyboard Commands Key Press Scan Codes: These are essential for detecting when keys are pressed on the keyboard. Each key press generates a unique scan code that corresponds to the pressed key. Key Release Scan Codes: Similarly important are the release scan codes, which indicate when keys are released after being pressed. They are crucial for correctly interpreting the sequence of key events. Reset Command: The reset command allows for initializing communication with the keyboard or recovering from errors. It ensures proper synchronization between the keyboard and the host device. Special Function Keys: Special function keys include essential keys like function keys (F1-F12), arrow keys, and modifier keys (Ctrl, Alt, Shift). Proper handling of these keys is crucial for supporting various keyboard functionalities.

PS/2 keyboard Data Packets Serial Transmission: PS/2 keyboards communicate with the host device (such as an FPGA) using a serial communication protocol. Data packets are sent serially over two lines: the clock line (CLK) and the data line (DATA). Start Bit: Each PS/2 data packet begins with a start bit, which is always logic low (0). This start bit indicates the beginning of a new data packet transmission. 8-Bit Data: Following the start bit, the keyboard sends 8 bits of data representing the scan code of the key being pressed or released. These 8 bits contain information about the key event, key identifier, and any associated modifiers. Parity Bit: After the 8 data bits, a parity bit is included for error detection. The parity bit ensures that the total number of logic high bits (1s) in the data packet is always odd or even, depending on the chosen parity scheme (usually odd parity). Stop Bit: Finally, each data packet ends with a stop bit, which is always logic high (1). This stop bit marks the end of the data packet transmission and prepares the interface for the next transmission.

PS/2 Operation Modes Scan Code Set 1 (Standard Mode): This mode is the default operation mode for PS/2 keyboards. It utilizes scan code set 1, where each key press generates a unique scan code representing the pressed key. This mode is widely supported by operating systems and applications. Scan Code Set 2 (Typematic Mode): In this mode, the keyboard can generate typematic key events, allowing for automatic repetition of key presses when a key is held down for a certain period. It supports additional functionality such as adjusting the typematic rate and delay. Keyboard Identification Mode: PS/2 keyboards can enter an identification mode where they provide information about their model, manufacturer, and supported features. This mode allows the host device to query the keyboard for identification data and adjust its behavior accordingly. Disable Key Mode: Some PS/2 keyboards support a mode where specific keys can be disabled or remapped. This mode is useful for customizing keyboard behavior or handling keys that may have become non-functional.

Basic PS/2 Mouse Handler VHDL

Modified PS/2 keyboard Handler VHDL

This modified version of the VHDL code includes a complete state machine to handle PS/2 keyboard data packets. It correctly captures start, data, parity, and stop bits, and verifies parity and stop bit integrity before processing the received data. This ensures robust and error-free communication with the PS/2 keyboard.