OFF
MIKROE-1576
35 g
Status:
PS/2 Click is an adapter Click board™ that interfaces keyboard and mouse connectivity to your application. This board features the standard 6-pin Mini-DIN PS/2 connector. Even though somewhat superseded by USB, PS/2 connectors are still used. PS/2 click is especially suited for connecting vintage or certain modern high-end keyboards and mouse. One of the fundamental benefits of PS/2 Click is that it supports full n-key rollover. It’s the ability of the keyboard to handle any number of simultaneous keystrokes. This Click board™ makes the perfect solution for connecting PS/2 keyboards and mice to your target device.
PS/2 Click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
This product is no longer in stock
Availability date:
PS/2 Click is an adapter Click board™ based on the standard 6-pin Mini-DIN PS/2 connector. It is an alternative to the USB connector for modern peripherals and implements a bidirectional synchronous serial protocol. The PS/2 Click supports a standard PS/2 keyboard or a standard PS/2 mouse as a device, and it should be noted that it is not recommended to hot-plug any of the devices to the host microcontroller.
To communicate with the host microcontroller, this Click board™ uses the CLK, the SCLK or the clock line, and the DAT, the SDATA or data line. The PS/2 mouse and keyboard implement a bidirectional synchronous serial protocol. The bus is "Idle" when both lines are high (open-collector). The idle state is the only state where the keyboard/mouse is allowed to begin transmitting data. The host has ultimate control over the bus and may inhibit communication anytime by pulling the clock line low.
The PS/2 device generates all clock signals on the SCLK pin for both host-to-device and device-to-host transfers. During device-to-host transfers, the device controls both SCLK and SDATA. The device maintains a consistent SCLK cycle between 10kHz and 14.6kHz, updates SDATA while SCLK is high, and the host sample SDATA when SCLK is low. If the host wants to send data, it must first inhibit communication from the device by pulling the clock low. The host then pulls data low and releases the clock. This is the "Request-to-Send" state and signals the device to start generating clock pulses.
This Click board™ can only be operated with a 5V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
Type
Adapter
Applications
Can be used for connecting PS/2 keyboards and mouse to your target device
Key Features
5V power supply according to the PS/2 standard, supports both keyboards and mouse connection, two main signal lines: data and clock, not recommended to hot-plug, and more
Interface
GPIO
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
5V
This table shows how the pinout on PS/2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | - | 5 | - | V |
We provide a library for the PS 2 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control PS/2 click board.
Key functions:
void ps2_gpioDriverInit(T_PS2_P gpioObj)
- Function initializes GPIO driver for the desired MIKROBUS1.Examples description
The application is composed of three sections :
void applicationTask() { char logText; if ( Ps2_Key_Read( &logText, &specialFlag, &pressedState ) ) { if ( pressedState ) { if ( logText == _PS2_BACKSPACE ) { mikrobus_logWrite( " <- Backspace", _LOG_LINE ); } if ( logText == _PS2_ENTER ) { mikrobus_logWrite( "", _LOG_LINE ); } if ( !specialFlag && logText ) { mikrobus_logWrite( &logText, _LOG_BYTE ); } } } Delay_1ms(); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
This Click board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.
NOTE: Please be advised that any peripheral devices or accessories shown connected to the Click board™ are not included in the package. Check their availability in our shop or in the YMAN section below.