Control via lpt port by an external device. Graphic LCD indicator - connection via LPT port. Working WndLpt as a Winamp, AIMP2, WMP visualization plugin

The problem of connecting the machine to the CNC system via LPT is a set of difficulties that arise when connecting machine tools with numerical control to a computer or laptop. Without a solution to the problem, the device cannot be used in standalone or semi-standalone mode. The solution is carried out in several ways of different levels of complexity.

What is LPT

People who do not have experience with CNC machines or computer technology often do not know what an LPT port is and how to use it. An LPT port, also known as a parallel port and a printer port, is a connector on a computer device designed to connect various devices. This port is performed according to the international standard, therefore it is universal.

With it, you can connect to your computer:

  • a printer;
  • scanner;
  • external storage devices.

The listed options are among the most popular. But the LPT port is also used for other purposes. Thanks to its features, you can synchronize the operation of two computers, set up telecontrol, or control machine equipment. The port standard is based on the Centronics interface. Modern devices have extended versions of ECP and EPP.

But due to the great popularity of USB ports, the relevance of LPT is gradually declining.

Machine control via laptop LPT port

On modern laptops, it is not always possible to find an LPT port. In this regard, inexperienced people often have a problem connecting equipment. In order for the operator to connect the unit to a laptop system, models with this connector are required. LPT-ports are mandatory equipped with industrial laptops. They have the functionality sufficient to control the machine tool.

To control the device via a laptop, you will need special programs. One of the most popular is the Mach program. The USB adapter cannot replace the LPT port. It creates a virtual drive that is not designed to be compatible with CNC tool control programs. The working option is to connect the machine to a computer and remote control via a laptop using a WiFi adapter.

This method allows you to control the work remotely, but the laptop should be at a distance of no more than 3 - 4 meters from the tool. In this case, stationary computers should be located in close proximity to the machines.

The most successful solution to the problem is USB adapters in the form of a board, and options created in the form of an adapter cord. Both adapters are quite expensive, but they allow not only to connect a working tool, but also its peripherals. The devices are equipped with plug-ins through which control commands are transmitted. Adapters have their own drivers, thanks to which commands are transmitted without interruption.

The advantage of inputs and outputs is buffering. It provides a protective function if one of the drivers overloads the processor. If there is a need to control the device from the network, you will need to purchase a controller. Thanks to his help and the driver, the computer can be placed at a great distance from the machine equipment. But the cost of such a solution is higher.

Proper start of the CNC machine

A significant percentage of problems occur when CNC equipment is not started correctly. If you make a mistake when connecting the device to the LPT, there is a high risk that it will not start, or it will malfunction.

The launch is carried out step by step:

  • a stepper motor controller is connected to the device (pay attention to the marking of wires and compliance with the plates);
  • the same controller is connected to the computer;
  • an adapter is installed (if required).

Before starting, it is necessary to prepare the spindle and PC. The spindle is prepared according to the instructions that follow in the package with the purchased machine, and is able to answer basic questions. PC preparation is more challenging task in which a number of factors must be taken into account:

  • multi-core Intel processors not suitable for controlling the device via LPT (this problem is associated with a change in the processor frequency, which negatively affects the working tool on the machine);
  • it is recommended to use single-core processors from Intel and AMD;
  • PC must be 32-bit operating system windows;
  • Linux operating system can be installed on a PC;
  • the adapter must be equipped with a special driver;
  • no third-party programs should be installed on the computer;
  • there should be no antiviruses on the computer;
  • a computer will not work if it has: less than 1 gigabyte random access memory, a processor with a frequency of less than 1 GHz.

First of all, the antivirus and firewall are turned off on the computer. Then a program is installed on it to control the machine tool. When using a USB-LPT adapter, driver and plug-in installation is required. The program is launched by a shortcut on the desktop. Then, in the program itself, the CNC machine and the control source are selected. After installation and preparation, the program starts and the machines begin processing.

If the processing did not start, or if it is not performed correctly, an error has been made in the preparation and connection of the computer to the machine. Actions should be reviewed and re-executed.

Ways to solve problems

One of the main problems of connecting CNC machines through LPT is the use of inappropriate programs. If the software is not compatible with the port, then it cannot be used even if it calls the drivers.

The list of compatible programs includes:

  • K-cam;
  • Mach;
  • CNC Turbo.

In the listed programs, the control is designed for the LPT interface.


Another issue is how the port circuitry works. It functions through:

  • USB connector of the computer;
  • separate block;
  • machine stabilizer.

If one of the options fails, the correct operation of the circuit will be disrupted. Interruptions may occur, or the system may cease to function. To properly connect the instrument to a computer device, refer to the RS-232 standards. They can be used to individually set the communication program and the characteristics of the numerical control.

The CNC system must be in command transmission/reception mode. Otherwise, the equipment may not work because the data transmission will be interrupted. Factory-made devices have instructions for setting up the unit.

The following problem may occur in complex processing. Complex machining involves large amounts of NC transfer that the CNC memory cannot handle. Solving this problem will require the use of a DNC system. It increases the technological capabilities of the device, and allows you to process workpieces with various shapes.

On modern units, the use of local networks is provided. They are a faster and more convenient way to transfer the necessary data. In this case, an Internet connection is required for control.

Per last years, appetizing recipes in pictures , informative . The section is updated daily. Always up-to-date versions of the best free programs for everyday use in the Essential programs section. Almost everything you need is there daily work. Start to gradually abandon pirated versions in favor of more convenient and functional free counterparts. If you still do not use our chat, we strongly advise you to get acquainted with it. You will find many new friends there. It is also the fastest and most efficient way to contact project administrators. The Antivirus Updates section continues to work - always up-to-date free updates for Dr Web and NOD. Didn't have time to read something? The full content of the ticker can be found at this link.

Graphic LCD indicator - connection via LPT port

Graphic LCD indicator 128x64 pixels Fordata FDCG12864B (KS0108B) - connection to a computer via LPT port. We connected it.

- How to connect the LCD panel?
- In the outlet!
- You don't understand, I mean the LCD monitor!
- In the socket and to the computer!


The liquid crystal display in the computer looks fashionable and stylish, but it will look most useful in a media center. Especially when it's graphic. There is already a place to practice the art of information ergonomics and monochrome pixel art. Shall we work?
Decided unanimously: - "Yes, we will!".
What we got: a pair of Fordata FDCG12864B (KS0108B) 128x64 pixel LCDs, and we had the rest.
And here's what happened: Centronics LPT cables, 10 kΩ trimmer resistors, regular 10 ohm resistors (0.25 W), molex connectors - "daddy".
Logical question: Why two LCD indicators?
Answer: The number of indicators is equal to the number of co-authors.



After acquiring the indicator, the first thing we decided to do was find out what kind of animal it is? It turned out that he is a purebred "Chinese", his "fathers" live on the site fordata.cn, from there we extracted his modest description in the amount of 1 page in .pdf format.
However, the "fathers" - the creators on one page managed to place a lot useful information: device dimensions, block diagram, features, pinout, mechanical specifications, power ranges and electronic characteristics.
The scheme for connecting an LCD indicator to an LPT port is quite simple, but it requires care, perseverance and, of course, the ability to solder (wires to contacts).
It is important to note that the contacts on the LPT connector are numbered, you just need to look carefully, and they will become noticeable, the same applies to the LCD indicator, on the opposite side of the screen you can see a marking similar to the one shown in the diagram:


Scheme of connecting the LCD indicator to the LPT port.

LPT port

LCD indicator

GND 1 (Vcc) Common output
+5V 2 (Vdd) Supply voltage
contrast 3 (V0) Contrast
17 4 (RS) Select: command/data
GND 5 (R/W) Select: Read/Write
1 6 (E) Data Gating
2 7 (DB0) Data bus
3 8 (DB1) Data bus
4 9 (DB2) Data bus
5 10 (DB3) Data bus
6 11 (DB4) Data bus
7 12 (DB5) Data bus
8 13 (DB6) Data bus
9 14 (DB7) Data bus
14 15 (CS1) Crystal selection 1
16 16 (CS2) Crystal selection 2
+5V 17 (RST) Initial setting
contrast 18 (Vee) DC-DC converter output
+5V+10Ohm 19 (A) + backlight power
GND 20 (K) - backlight power

We explain the presence of a resistor in the backlight node. According to the electronic characteristics of the device (i.e. LCD indicator), its nominal backlight supply voltage is 4.2V, the maximum is 4.5V, and with this same resistor we calm down the “power supply units” a little. In the photo of the rear side of the indicator, you can see the contact pads from the CD-ROM, carefully soldered by Albert.



front side of the indicator.


Back side of the indicator.

Soldered? Before connecting, we once again check the correspondence of the soldered and the circuit. If everything is correct, be patient! We do not connect! We assume that you have already connected, but there is nothing visible except for the backlight. :-).
In order to display any information on the indicator, a program serving the indicator is needed, therefore..

The second part is software-software.

First you need to allow programs that interact with LCD indicators to work directly with the LPT port. To do this, you need to install the driver for direct access to ports (Port I / O Driver), which is here - port95nt. You will then need to restart your computer.
After that, you can install a program that will serve our LCD indicator. There were many of them, the most persistent remained. One is script-oriented (supports a huge number of indicators), the other is mouse-clicky (reminiscent of the interfaces of OOP environments). The name of the first is LCDHype , and the second is LCDStudio (requires .NET components in the system). Everyone chooses the one that is more to their liking.
Below are the results of running the indicator on the stand with the LCDStudio program. The screens were made by the authors in the process of mastering this program:



Clock and date.


Some system information.


Logo.


Another logo.

Summary: As we can see, LCD indicators manufactured by Fordata are perfectly connected to the LPT port of the computer. By choosing a convenient software, you can draw anything on this indicator and even display some useful information.

Observations: It is noted that their image in LCDHype is not "buggy" from runtime 1, like some indicators of the domestic company MELT, which we could not find in stock at local dealers. By no means do we attribute this fact to the shortcomings of the indicators, and it is even worth noting that the maintenance and information content of the documentation of the MELT website itself at the time of writing the article is at a fairly high level.

If suddenly, as a result of manipulations with the equipment, you receive a message from the driver of the following plan: dlportio.sys device driver not loaded. Port I/O will have no effect. No need to panic! This problem is corrected as follows: Run regedit. We go in the registry to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ branch. In the dlportio folder, change the value of the Start parameter to 1. Reboot the computer.

We wish you success when connecting LCD indicators!

Start:

It all started with the fact that I accidentally stumbled upon an unusual surge protector from our Chinese brothers. It was an ordinary surge protector, but with control of each outlet separately and through a software shell from a PC via the LPT port.

I was interested in the very idea of ​​controlling powerful loads from a PC. Then it was decided to create something similar. Having rummaged on the Internet, I found many schemes that allow me to implement a similar task. As a result, it remained only to correlate the collected material and combine it into a single whole to create a working prototype of the circuit.

A few words about the LPT port. This port has many pins. We will only be interested in data registers, because their management is simple and you can set a log on their outputs. "1" or log. "0". Which are easily converted to other waveforms.

Figure 1 - LPT - port

Scheme:

One of the found schemes, which has the following form, was taken as the initial one:

Figure 2 - View of the original circuit

As can be seen from the above diagram, for the galvanic isolation of the port, an optocoupler of the type 4N25(DD1), it provides protection for the PC port.

In fact, it would be possible to connect directly, but it would not be safe for the port and the PC itself, and any power surge or breakdown could lead to unpredictable consequences.

A transistor of the type KT 815G(VT 1), but you can use similar brands. Any actuator can be connected to its output.

A number of changes were made to the existing scheme to improve the reliability of its operation and safety.

First, between the 1st pin of the optocoupler 4N25(DD1) and a resistor was added to the pin of the LPT port 390 Ohm (R1), also added LED KIPD 21(HL 2) with current limiting resistor on 100 Ohm (R3), to indicate the presence of a signal on a specific port pin. A protection diode has also been added 1N4007(VD1) from the reverse pulse of the relay coil. The relay coil is an inductance, and the inductance tries to keep the current flowing through it constant. Therefore, when the relay is turned off, the coil will be discharged by a reverse surge of high voltage, which can reach several sonnet volts, and in powerful relays up to kilovolts. Transistors from such pulses can burn out, and other devices connected to the power supply can also burn out (pulses penetrate the power supply), and with special luck, an optocoupler can break through and then everything will burn out, including PC ports. Therefore, this diode will not be superfluous.

An LED has also been added to indicate KIPD 21(HL1) the presence of the supply voltage of the circuit with resistor R2 (1k, is selected experimentally depending on the supply voltage of the circuit).

The final version of the modified scheme is shown below:

Figure 3 - View of the modified prototype scheme

Device and PCB:

It was decided to make a device to control 4 loads.

Although the port itself will allow you to implement more. According to the above principle, it was possible to implement 8 devices, but so far it was decided to stop at 4.

Implement printed circuit board, from experience and due to simplicity and clarity, it was decided in sprint layout 5 (hereinafter SL5).
I won’t describe the creation process itself much, because if you wish, you can figure it out.

For convenience, the device was divided into several blocks. This article describes the main block of the device (controller), the remaining blocks are not of great interest, because they can change depending on the specific tasks.

Below is a block diagram of the entire device:

Figure 4 - Block diagram of the device


where:
PC - personal computer;
UU - control device;
BP - power supply;
IU is an executive device.

A standard (ready-made) power supply with an output voltage of 12V 2A was used as a power supply unit (PSU).

The parameters of the execution unit can be different.
In my version, this is a relay block for 12V and with contact pairs capable of switching 220V.

Let's move on to the circuit board. It was implemented in SL5. The board was conceived taking into account the connection of other blocks.

Figure 5 - Device board in SL5

The board and its description are shown below in Figure 6:

Figure 6 - Device board in SL5

The board shows that there are jumpers marked in red.
The input from the LPT port is marked in orange with the required pins.
Exit specified yellow. The output has four control signals for a relay or other actuator and a common wire for them.
A commonly used connector has been used for the Power Inlet, but any one can be used as needed.

The etching of this board was carried out according to the so-called "laser-ironing" method, which I will not describe in detail. If necessary, information about it can be found.

Control:

To control this device, at first, cumbersome system programs designed for the LPT port test were used. Then it was decided to write my own soft, simple and reliable, without unnecessary functions, which was later done:

Figure 7 - Software interface

The program has a convenient and informative interface. There is an indication of the switched on device. As well as a button that turns off all devices.

The program is on the dedicated page.

The program is reliable and simple and performs its functions. At the time of this writing, there were ideas to make a WEB-interface for management. What would be more relevant and convenient, because if this device put on a server that does not have a visual shell, then this would be more relevant.

Epilogue:

As a result, a completely ready-made and functional device was created that is capable of switching a powerful load, the power is limited only by the parameters of the actuating elements. Also, the number of controlled elements also varies from 1 to 8 and, if desired, you can do as many as necessary to complete a specific task.

PS: all pictures are clickable with zoom

One of my friends, having seen the article http://habrahabr.ru/blogs/DIY/92655/, wanted a device to control the load on the LPT port. But he wanted to manage not one device, but ash 8!
In the image and likeness of the device in the article, this piece of iron was made, with slight differences, firstly, I connected a relay to each output of the LPT port (8 pcs.), And secondly, I made a human printed circuit board. About everything in order.
The described device allows you to control from a computer through the lpt port any devices, such as lighting lamps, a fan, and many others, the power of which, when powered from a 220V network, should not exceed 1 kW. When writing the appropriate software, and having an Internet connection, you can control your devices from anywhere in the world.

The scheme of the device for controlling the load through the LPT port is the simplest.


The PC program can control the logic levels at the outputs D0..D7 of the LPT port. The logical unit level in the LPT port is 5V, which is very convenient for further operation with executive devices. Since the current from the LPT output is not enough to control the relay, we use an amplifier based on the VT1 transistor. Resistor R1 limits the current in the base circuit of the transistor. The transistor switches power to the relay winding, and it turns on the powerful load that you want to control, for example, a light bulb, a motor, and others. The board is wired for the HJR-3FF-S-Z relay (12V winding, contact-switched current 5A at 230V AC). The diode VD1 protects the transistor VT1 from the release of reverse voltage at the moment the relay is turned off. The diagram shows one node, for the D0 line of the LPT port, but the control for the other lines is identical.
This is the simplest device, anyone, even a beginner radio amateur, can assemble it. But if you are going to use it to control devices with a rated supply voltage of 220V, then before turning on, pay special attention to the installation, especially the installation of 220V circuits, so that there is no connection between these circuits and low-voltage circuits, for example, due to snot or lack of poison. I recommend that you carefully ring everything with an ohmmeter before turning it on to detect unwanted connections. With unsuccessful installation, you risk not only ruining your computer, but also endangering your life!
For this device, I developed a single-sided printed circuit board in the Sprint Layout program.

The board was made using laser printer and iron. I overexposed the board a little in the solution, and the protective pattern turned out to be not of very high quality, it can be seen that the ferric chloride solution, in some places, went through the tracks through the protective coating. Yes, this is not a very successful board, but since the tracks are wide, and I then tinned them, everything worked out. All connections in place

A practically assembled device is shown in the following photo. It can be seen that I soldered the diodes to the board from the side of the tracks directly to the relay outputs going to the winding.

In the original article (link at the beginning of the article), there are programs for LPT controls port and their description.

One of the simplest AVR programmers is the LPT port programmer. This is due to the fact that the signal levels of the LPT port are compatible with the signal levels required for ATS programming. Therefore, signals from the LPT port can be directly fed to the microcontroller (resistors are only needed to protect the port from accidental short circuits). Such a programmer can be assembled from improvised materials in just 5 minutes!


As you can see, the LPT programmer circuit for AVR is extremely simple:

To make an LPT programmer, we need:


Resistors can be used any you find in the range from 100 to 150 ohms. You can assemble the programmer without any resistors at all, but then it will become even easier to burn the port. As a loop, you can use an IDE loop. When connecting a loop, for more stable operation of the programmer, each "signal" wire must alternate with a "ground" wire. This will reduce the level of noise induced in the lines and thereby increase the length of the programming wire. The length of the cable should be within 50 cm. You also need a connector for connecting to a programmable device.
For in-circuit programming, Atmel recommends standard connectors:


If you plan to get serious about microcontrollers, make the connectors standard. For one-time programming of the device, I recommend using it on the programmer (the buttons and LEDs of the computer case are connected to the motherboard with such connectors) and the PLS pins of the “dad” on the board. This allows you to simplify the layout of the device board as much as possible, since the pins for the programmer are installed in close proximity near the legs of the microcontroller. The MOSI, MISO, SCK legs of AVR microcontrollers are always located together, so a built-in connector can be used for them. Separately, we make a connection for the "ground" -GND and "reset" -Reset.


Assembling the LPT programmer in 5 steps:


Jumpers between connector pins 2-12 and 3-11 are needed in order for our programmer to be visible to programs as the STK200/300 programmer (STK200/300 is a kind of standard and therefore our programmer will become visible to many programs).

In order for our LPT programmer to work needed, to which we will connect the programmer and for the microcontroller.

General recommendations:
- The LPT port is quite delicate - it is very easy to "shoot" it, so be careful when working with the port.
- I would recommend making a separate connection for the "ground" in all programmers. This is necessary so that the “ground” can be connected first and equalize the potentials of the “ground” of the programmable device and the computer. (For those who do not know - if your computer is plugged into a regular outlet without a ground contact, then due to the features of the filter of the computer's power supply, there is always a potential of 110V on the computer case. With a "successful" connection of the programmer, this is quite enough to burn microcontroller or LPT port of a computer.

Conclusion:
-If you decide to assemble your first programmer and your computer has an LPT port, then the “5 wires” programmer the best way! It is extremely simple and it will not be difficult to repeat it. In addition, the programmer is compatible with classic STK200/300 programmers, which means it will be supported by many AVR programming software.
-If you plan to program quite often, in order to secure the LPT port, I recommend assembling an LPT programmer with buffer elements (you can look at easyelectronics for a good version of the LPT programmer) or assembling a simple one (COM port is much more durable and harder to burn).

(Visited 66 789 times, 19 visits today)

Similar articles

2022 my-cross.ru. Cats and dogs. Little animals. Health. Medicine.