Share this

Touchscreen Implementation Scheme Based on 80C186 Processor

2026-04-06 08:49:47 · · #1
Currently, the most commonly used touchscreens are resistive touchscreens with a resolution of 4096×4096. While the resistive touchscreen described in this article operates on the same principle, it has a resolution of 20×12 and is a thin board measuring 140mm long, 105mm wide, and approximately 1.5mm thick, suitable for use with a 5.7-inch LCD screen. Although its resolution is significantly lower than that of ordinary resistive touchscreens, in industrial applications where only a few buttons are typically needed and the touch area is limited, this touchscreen fully meets practical requirements, fulfilling the required functions while ensuring the specified stability and reliability. The system design addresses the increasing demand for LCD screen displays in industrial settings. Sometimes, a single screen is insufficient, requiring page turning and control via LCD screen buttons. Using expensive industrial control computers to control LCD touchscreens is inefficient and wasteful. Therefore, this paper selects the SOM-2386 embedded control module based on the 80C186 processor and designs and develops a baseboard based on this module to control the LCD touchscreen. I. Hardware Introduction The SOM-2386 module implements almost all the functions required by an industrial computer on a board smaller than a business card. This module features an embedded high-performance 16-bit processor with a 32-bit RISC architecture, compatible with the 80C186 processor, and a 100MHz clock speed; it supports 1MB of SDRAM; has a 10/100M high-speed Ethernet interface; supports a standard IDE interface and two serial ports; and integrates a system BIOS and a 1.44MB flash floppy disk on a single flash memory chip. The BIOS is compatible with standard PC specifications and can directly run DOS software. It also integrates virtual display technology, providing users with an experience completely similar to a local PC's DOS environment. However, although this module has many functions, developing custom programs requires designing a development board and creating a development environment that meets additional application system requirements, such as adding LCD screen interfaces, serial ports, IDE interfaces, and touchscreen interfaces. II. Hardware Design and Driver Development During the baseboard design process, the LCD screen interface, serial port, and IDE interface only need to be connected and designed according to the bus definition of the SOM-2386 module. The touchscreen interface needs to be designed according to the structure of the selected touchscreen. Since the touchscreen used has a resolution of 20×12 and (20+12) address/data lines, the corresponding interfaces should also be designed accordingly. Furthermore, the touchscreen driver also needs to be written separately. To facilitate program writing, attention should be paid to relevant details during the design process. Regarding the touchscreen driver, a row-column scanning method is used to determine the pressed position. First, a low level "0" is sent to each of the 20 rows, and then the 12 columns are scanned sequentially. When a row and column intersection is pressed, a low level "0" is sent to that row, and a low level "0" will be obtained when the column is scanned; if no press is received, a high level "1" will be obtained. When scanning 20 rows, the data sent by the CPU is first latched by a 74LS273 latch before being output; the scanned result is first passed through an octet bidirectional buffer 74LS245 before being returned to the CPU. The address for row and column scanning is controlled by a logic chip. In circuit design, the 20/12 data/address lines of the touchscreen should be connected sequentially to the latch/octet bidirectional buffer before being connected to the data/address bus. This avoids sequential confusion during key press detection, preventing processing difficulties. Simultaneously, during the determination of the pressed position, debouncing should be performed, similar to keyboard key presses, to eliminate interference. III. Application Development, Debugging, and Application After the system development baseboard is designed, application development and debugging can begin. 1. Application Development and Debugging Many application development software programs exist, such as TC, Bc3.1, and Bc4.5. This paper uses Bc4.5, which allows for convenient input of Chinese characters and text. After selecting the software development environment, you can create your own project and start writing and debugging the program. During this process, you must pay attention to the following points: (1) The program type must be selected as DOS (standard) and floating-point simulation (emulation). (2) The project's compiler processor type must be set to 80C186. Other processors cannot be selected. (3) If the memory mode is not set properly, errors may occur during the compilation and linking of the program. If many linking errors occur during the debugging of the program, and most of them are related to calling functions in the function library you wrote, you should consider the memory mode setting. Generally, if the memory mode is set to small mode at the beginning, changing it to large mode can solve the problem and prevent similar linking errors from occurring again. After setting all the options of the project and compiling the program without errors, you can download the program to the development board for remote debugging. The program can be downloaded and remotely debugged via serial port. After setting the serial port parameters through TDConfiguration (Start—Programs—Borland C++ 4.5—TDConfiguration), click the menu Tool—TurboDebugger in the Borland C++ 4.5 development environment to start it. Once the program is downloaded to the target board, remote debugging can begin. You can run the program step-by-step or at full speed, set breakpoints, observe variables, etc., just as conveniently as local debugging. It is important to note that while program writing and compilation can be done under any Windows operating system, if running on a development board based on the SOM-2386 control module, then program downloading and remote debugging must be performed under Windows 98. It generally cannot run normally and quickly under other Windows operating systems. 2. Application Application After developing and downloading the program to the target board, you can use the virtual display technology in the system BIOS integrated in the SOM-2386 control module to copy the program from the IDE device used during development to a flash drive. Simultaneously, modify the target board's batch file autoexec.bat and remove the IDE device. After powering on, the developed application will automatically run from the flash drive. Once the development base plate, LCD screen, and touch screen are connected and fixed, it can be used in the required industrial environment to realize its display, page turning, and control functions. IV. Conclusion The LCD touch screen and its development and control system introduced in this article have good stability and low cost. Different sizes of LCD screens and corresponding specifications of touch screens can be selected as needed. Its functions fully meet the required display and button control functions and have been successfully applied in multiple industrial environments.
Read next

CATDOLL 123CM Laura (TPE Body with Hard Silicone Head)

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL Diana Soft Silicone Head

CATDOLL Diana Soft Silicone Head

Articles
2026-02-22
CATDOLL 146CM Jing TPE

CATDOLL 146CM Jing TPE

Articles
2026-02-22