How to connect a keyboard to a laptop in different ways. How to connect a keyboard to a computer: Step-by-step instructions Connect the PS 2 keyboard

Keyboard is an integral component personal computerperforming information entry function. At the time of buying this device Some users have a question about how to connect it correctly. This article will help you figure it out.

The method of connecting the keyboard depends on the type of its interface. There are four of them: PS / 2, USB, USB Receiver and Bluetooth. Below together S. detailed leadership Images will also be presented to determine the necessary connector.

Option 1: USB port

This option is the most common, the reason for this is simple - in each modern computer There are several USB ports. In the free connector, you must connect the cable from the keyboard.

Windows will install the necessary drivers and then show a message that the device is ready to use. Otherwise, OS issuing alert about the unwillingness of the device to work, which happens extremely rarely.

Option 2: PS / 2

Before connecting the keyboard to the PS / 2 connector, it should be noted that there are two similar connectors that differ only in color: one purple, another green. IN this case We are interested in the first, since it is it that is intended for the keyboard (the second is needed to connect computer mouse). To connect the keyboard with a cable to the PS / 2 connector, you must perform the following:

On the back system Block You need to find the PS / 2 connector - a round hole with six small holes and a lock, where and you need to insert a cable from the keyboard.

Option 3: USB receiver

If the keyboard is wireless, a special receiver should be included with it. Usually this small device with a USB connector. The keyboard connection algorithm with such an adapter is as follows:

You just need to insert this adapter into a computer USB port. A successful connection should be evidenced by the lightned LED (but it is not always) or notification from the operating system.

Option 4: Bluetooth

If the computer and keyboard are equipped with a Bluetooth module, then it is necessary to activate to connect this type Communication on a computer in any available way (links below contain instructions for including this function) and activate it on the keyboard by pressing the power button (usually located on the back side or in some of the edges of the device). They mate, after which it will be possible to use their device.

Fact # 1: On the modern motherboard, the desktop PC interface is no longer found, and in modern laptops - is not found at all.
Fact number 2: if USB keyboard Or the mouse can be connected to the PS / 2 connector with a simple passive adapter, then this focus does not pass in the opposite direction.

How to get out of the situation when you need to connect the old input device to USB?

To do this, there are special converters that convert the PS / 2 protocol signal (and actually - i2c) to USB. One of these - today on the analysis.
The device is packed in a simple plastic bag with a snatch.


After extracting from the package it can be fixed in full length. Disk with drivers and software package is not not possible.


Product length 318 mm at the ends of the connector. In the middle there is a box with a converter.


With a flat pumping, the box is easily divided into two halves.


Converter board closeup.


It contains chickens and SMD condenser. Silkographic contacts are applied to contacts, no more information fee carries. The material of its foundation is Getinax.


For testing the converter there was a keyboard with built-in trackball.


The keyboard and trackball are combined with a common housing and a shell of an interface cable, their electronics is completely independent.
Fact number 3: Keyboard and mouse connections are not interchangeable!
Connect the cable connectors to the converter.


And connect the converter itself to the laptop.


The operating system determines it as "composite USB device"And the driver puts automatically. After that, you can use the keyboard and trackball.
But it was too simple, right?
Find in a box with an old iron mouse.


We unscrew the screws, holding the parts of the case, disassemble the mouse and pull out the cable from it.


Then we think a little, stick the cable back in the connector and get it out of the board.


In the same box we find a touchpad. As a rule, they are also connected via the PS / 2 interface, you can read about its implementation.


We harvest the segments of the thin wire MGTF ...


... and solder the connector according to the pinout:


We connect the design to the laptop, we are convinced of its performance and are in the box further.

It is a touchpad from Dell Latitude CPX.


A rather brain-cooled design, in which the conductors to the touchpad, the trackpoint, buttons, speakers and the microphone are pulled into one loop.


Touchpad released by Alps


On the pinout, it differs from Synaptics.


Soldering.


We connect to the laptop and surprise the sensitivity of the trackpoint.


Taking into account the cost of the finished USB touchpad, the price of the converter and the easiability of the connection to the sensor from the laptop do quite justified independent assembly Designs. For example, this is:


This will make rid of pain in the wrist, as it is not necessary to keep the forearm constantly twisted by 90 degrees, as when working with the usual mouse.
Conclusion: If you have been lying on a touchpad or time-tested, the mechanical keyboard is a device for you.

I plan to buy +46. Add to favourites I liked the review +67 +117

In this article, I will show you how to connect a keyboard and a mouse to a computer or laptop using devices with a wireless interface via Bluetooth or wired, with PS / 2 and USB connectors. I will tell about all the features of the connection and explain how to do it, without damaging anything.

How to connect a keyboard and a mouse with a USB interface

Such a connection is perhaps the simplest one. And recently, the USB interface on keyboards and mice is often found. In laptops and other portable PCs such a connection is predominantly.

There is nothing complicated here. Just take the wire from the mouse or keyboard and stick it into one of the available USB ports (the most you caught the flash drives). The computer can be left included.

After you connect the mouse or keyboard via USB, your operating system Be starting to install drivers for the device (all this happens automatically, you do not need to do anything). And when the drivers are installed, a message appears about it. Now you can use.

How to connect the keyboard and mouse with PS / 2 interface

PS / 2 connectors are a slightly outdated keyboard and mouse connection method, and not even on all modern motherboards There are such sockets. It occurs on stationary PCs or old laptops. The mouse and keyboard PS / 2 are a round plug with six legs and a lock.

PS / 2 connections for the keyboard and mouse of the same form. Therefore, not to confuse what and where to connect, they are made in different colors. The plug at the mouse is usually green, it needs to be connected to the green connector on the computer. The keyboard has a purple plug, it, respectively, in purple. Correct the device correctly will help you the lock - here it is represented as a plastic leg. Everything should get into place.

PS / 2 connectors on the computer are usually in the rear wall of the case.

When connecting the mouse and keyboard through PS / 2, be careful. First, do not confuse the colors of the nest and connector. Secondly, do not use strength, do not press, otherwise you riskaming the legs, then it is difficult to straighten them. Or at all you can break them. Thirdly, turn off the computer with this operation.

There are also combined sockets of two colors. This means that you can connect and the mouse and keyboard.

How to connect a keyboard and a mouse with a bluetooth interface

If you need to connect a wireless keyboard or mouse, then you most likely come with a special Bluetooth module that is inserted into USB. You must connect this module to the computer, and install the driver for it (or it will be installed automatically). After that you can use the device.

Connect the wireless keyboard or mouse can be through the built-in Bluetooth module in the computer. To do this, you just need to ensure that they see each other in their radio.

If, after connecting the nobble keyboard and the mouse, they do not work, make sure the batteries are inserted into them, and they are charged. If you connect the device via the built-in Bluetooth module, and it does not work, then it is probably due to the fact that the driver's external Bluetooth driver was installed, which was complete to the mouse or keyboard. You just need to delete this driver or apply an external Bluetooth module.

Such a connection can be implemented as on stationary computerand on the portable.

The keyboard is the most common device for entering information into a computer. Therefore, it is important to know the principle of operation and the keyboard communication interface.

This article describes a device that allows you to receive data from the keyboard and display the pressed keys on the output device. As an example, we will develop the simplest device using the PS / 2 keyboard, a PIC microcontroller and a seven-step indicator.

Idea:

The main purpose of this project is to create a device that can work with PS / 2 devices, and specifically with PS / 2 keyboard. The keyboard will be connected to the PIC microcontroller, which in turn will process the codes of the pressed keys and display the keys to the seven indicator. PS / 2 is a serial interface with a clock signal of 10-16 kHz, so in PIC we need to use interrupts, to detect the rear edge of the pulses.

List of radio elements used:

  • Microcontroller
  • - POSITING Voltage Regulator
  • Quartz resonator 20 MHz
  • PS / 2 Connector (Mom)
  • 7 segment indicator
  • Resistors
  • Additionally, you will need a programmer for firmware PIC, a batch board and jumpers (well, or etched printed circuit board).

Circuitry:

As can be seen concept Below, the device is very simple and the main details of this: 78L05, PIC18F452 and PS / 2 connector.

In PS / 2 connector, Pina 2 and 6 connector are not used, 4th PIN - power + 5V, 3-pin - common. 5th PIN - clock signal, and 1st pin - data. The 7th segment indicator I used with a shared cathode.

A bit of the theory of PS / 2:

As already mentioned above, the PS / 2 uses a serial information transfer protocol with two lines: a clock signal and data line.

PURPOSE OF POINTS 6-PIN MINI-DIN (PS / 2):

  1. Data
  2. Not used
  3. General (Earth)
  4. Meals (+ 5V)
  5. Clock signal
  6. Not used

The figure above shows the PS / 2 dad connectors (left) and mom (right). Usually, the "dad" type connector is used on the device side - mouse, keyboard, and the "Mom" type connector on the computer. In our case (because we have a reception party) We will use the Mom Connector (you can cut from some burnt motherboard).

PS / 2 Signal Chart:

The figure above shows the standard temporal output diagram for PS / 2 devices. The sequence is as follows:

1. Data output is set to a low logical level.
2. Output of the clock signal is set to a low level.
3. Data output continues to be low (starting bits)
4. The clock signal goes to a high logical level.
5. The transmission of eight bits with data begins
6. Next is the parity control bit
7. And behind him stop bits

All data is accepted by the decay of the positive synchropulse.

Scan codes of keys:

Each keyboard key contains its unique code, so-called. Scan code.

As can be seen from the pictures above, most keyboard keys contain 8 bit values \u200b\u200b(1 byte), but some keys contain a multibyte sequence.

Consider an example of how the scan codes of the keys occurs. If some key is pressed on the keyboard, then the scan code has a keystroke keypad. When the key is pressed, then the output is generated code 0xF0 and scan code pressed key. So You can determine if the key is kept pressed or not, but it is not necessary for us yet.


Figure above shows the PS / 2 oscillogram with the "J" key. Channel 1 (yellow) on an oscillogram is such a signal. Channel 2 (Blue) is a data signal. For clarity, I inflicted the auxiliary lines to detect the decline in the sync signal.

With this oscillogram, you can easily determine the scan code by pressing the key. We do not forget that the lower bit is located on the left (i.e. 0), and on the right senior (7 bits). So In binary code it turned out 0011 1011, which in hexadecimal is 0x3b, i.e. This scan key code "J".

Transmission of data to the keyboard:

Another PS / 2 feature of the protocol is to transfer data back to the keyboard, for example, you can file a command to enable / disable the CAPS LOCK LED, Num Lock. et al. But we will not catch up on it, because This is the topic of another article.

The collected scheme on the batch looks as follows:

The software consists of two main parts: Main Loop main loop cycle and interrupt handler.
Main Loop receives data and their processing to display the indicator. Well, the actual data output itself.
Main Loop Code:

#Include.
#Include.
#Include.
#Include.
// 7-Segment Display Output
#Define Number_0 0B01111110
..
...
..
#Define Letter_a 0B11101110
#Define Letter_b 0b11111110
..
...
..
Void Main (Void) (
Trisc \u003d 0xFF;
Trisd \u003d 0x01;
Portb \u003d 0x00;
Portc \u003d 0x00;
// 7-SEG LED IS REVERSE POLARITY
Portd \u003d 0x00 ^ 0xFF;
Delay10KTCYX (10);
Intcon \u003d 0b11000000;
OpenCapture1 (C1_Every_Fall_Edge & Capture_int_on);
OpenTimer1 (Timer_int_on & T1_Source_int & T1_PS_1_1 & T1_16BIT_RW);
Writetimer1 (0x0000);
While (1)
{
if (buf_ready \u003d\u003d 1) (
Switch (scan_code_buf) (
Case 0x1c: portd \u003d (Letter_a ^ 0xFF);
Break;
...
....
..
Break;
Case 0x45: portd \u003d (Number_0 ^ 0xFF);
Break;
Case 0x66: portd \u003d (delete ^ 0xFF);
Break;
Default:
Break;
}
// SHIFT Buffer Forward

scan_code_buf \u003d scan_code_buf;
scan_code_buf \u003d scan_code_buf;
scan_code_buf \u003d scan_code_buf;
scan_code_buf \u003d scan_code_buf;
scan_code_buf \u003d scan_code_buf;
scan_code_buf \u003d scan_code_buf;
scan_code_buf_cnt--;
if (scan_code_buf_cnt \u003d\u003d 0)
buf_ready \u003d 0;
}
DELAY10KTCYX (1);
}
}

So, in the Main Loop cycle, data is processing that enroll in the FIFO buffer. In the code, which is presented below, receive data PS / 2 by interrupt, after which they are placed in the FIFO buffer. The code 0xF0 is ignored, we are only interested in keystrokes. Interrupt code Next:

Void InterrupThandlerHigh (Void) // Declaration of InterruptHandler
{
// Check If TMR1 Interrupt Flag Is Set
if (pir1bits.ccp1if) (
If (bit_counter.< 10){
current_scan_code \u003d current_scan_code \u003e\u003e 1;
current_scan_code + \u003d (portdbits.rd0 * 0b10000000000);
bit_counter ++;
}
ELSE if (bit_counter \u003d\u003d 10) (
scan_code_buf \u003d (Current_scan_code \u003e\u003e 2)
scan_code_buf_cnt ++;
buf_ready \u003d 1;
bit_counter \u003d 0;
}
Writetimer1 (0x0000);
// Clear CCP1 Overflow Flag Bit
Pir1bits.ccp1if \u003d 0;
}
// Check If CCP1 Interrupt Flag Is Set
ELSE If (pir1bits.tmr1if) (
// Clear Timer1 Overflow Flag Bit
bit_counter \u003d 0;
Pir1bits.tmr1if \u003d 0;
}
Intconbits.gie \u003d 1;
}

As can be seen from the code above, the interruption of the capture of the code scan and the interrupt Timer1 is used together to ensure "capture" 8 bits, because We do not need start-up, stop bits and parity control bits. The only thing I did not show the keys as w, n, etc., because At the seven indicator, this is not real. In the archive

Laptop item is useful and comfortable, but sometimes there is a need or just want to additionally connect a large monitor to it and external keyboard, and even the mouse.

If the keyboard or multiple keys do not work on the laptop, then this option will help you to leave the position. About how to connect another we have already spoken to the laptop, and today we will consider several options for connecting an external keyboard.

Let's start with the fact that the keyboard can be wired, wireless and bluetooth. TO modern laptop You can connect any of them, the main thing is to know how to do it.

How to connect wiredUSB-Klaviatura To laptop

We take a wired USB keyboard, we find the USB connector on the laptop and connect both devices.

there is special keyboard For laptops. They are usually more compact and they have special keys, as well as the keyboard on a laptop and even a touchpad (built-in mouse).


Usually immediately after connecting the keyboard at the bottom of the monitor, a message appears about its readiness to work. If the laptop did not find the driver to it, then you will have to install it yourself.

To do this, you need to enter Control Panel computer, find there Device Manager,find it in it Keyboard, open it, click on the inscription Keyboard right mouse button and choose item Refresh Driver.

After reinstalling the driver, restart the laptop and enjoy the work on the new keyboard.

How to connect wirelessUSB- Laptop the laptop

It is even more convenient to use the wireless USB keyboard. This keyboard can be controlled by a computer even at a distance, and no wires are confused at hand.

In this case, you need to insert a battery keyboard and connect a small radio transmitter to a USB connector of a laptop, which comes with a wireless USB keyboard.

How to connectBluetooth- Laptop the laptop

There is another way to connect the keyboard - this is a Bluetooth connection. Moreover, all the modern Bluetooth laptops are already built-in and no additional devices Nevermind. But even if there is no such function in your laptop, then Bluetooth itself can be bought and connect to the USB connector. He looks like a small flash drive.

Such keyboards have a special switch to be enabled. Well, if a drive with drivers are supplied with the keyboard, and if not, the installation may be very problematic. And there may be many such problems, the operating system does not give it to do, then the laptop brand with its "cockroaches", then the drivers are not installed.

There may be a lot of such reasons, so in this article I will not consider them.

How to connect wiredPS./ 2 keyboard to laptop

If you have an old keyboard with a cable and PS / 2 connector, it can also be connected to a USB laptop connector using a special adapter that is sold in a computer store. No problems such a connection causes.