Communication between touch screen and single chip microcomputer

As touch screen applications and production increase, prices drop. Therefore, it is possible to use the touch screen as a keyboard and display device of the single-chip control device to improve the grade of the single-chip control device. When the touch screen is used in conjunction with the PLC, the main functions of the touch screen are:

1 Display the PLC input, output 13 or auxiliary relay switch status.

2 Use the touch button to force the PLC input, output port or auxiliary relay on/off.

3 Display the contents of the timer, counter and data register in the PLC.

4 Use the touch screen keyboard to send the setting data to the data register of the PLC.

Can be adjusted into a touch screen and PLC to ask the corresponding address of the data bit, word read and write. Therefore, the MOD-BUS communication protocol can be used to realize the communication and control between the touch screen and the single-chip microcomputer, or the touch screen communicates with multiple single-chip microcomputers to form a distributed control system.

1 touch screen and hardware connection of single chip microcomputer

One-to-one communication with the AT89C52 microcontroller using the MT500 touch screen. Connect the PLC232 9-pin socket of the touch screen to the AT89C52 microcontroller with RS232 interface. As shown in Figure 1. Note: The communication cable DB9 is 2-2, 3-3, 5-5.

This type of cable can also be used to communicate with a PC or to communicate. When communicating as a PC, the DB9 connected to the PC is shorted 4-6, 7-8. Since the AT89C52 microcontroller does not have an RS232 interface, it is necessary to expand a MAx232 to convert the TTL level of RXD, T&TImes; D to RS232 level.

Figure 1 touch screen and single chip communication connection method

2 Establish the correspondence between the touch screen and the internal memory address of the microcontroller

Open the touch screen configuration software, select [System Parameters] from the [Edit] drop-down menu, and the parameter setting dialog box shown in Figure 2 will pop up. The PLc type of the touch screen system parameter is set to MODBUS RTU, and the communication parameter setting must be consistent with the MCU communication parameter setting. The communication port type is set to RS232, the data bit is set to 8 bits, 1 stop bit, the baud rate is 9600, the check digit setting is consistent with the one-chip computer programming, the PLC station number is the station address defined by the single-chip microcomputer, the station number needs to start from 1 . After the parameter setting is completed, press the OK key.

Figure 2 parameter settings dialog

At this time, the address range of the touch screen is as shown in Table 1.

Table 1 The address range can be operated when the touch screen is set to MODBUS RTU mode.

Ox1—Ox9999, 1&TImes; 1-1x9999 memory for bit operations, 3xl-3x9999, 4xl-4x9999 memory for word operations. Lxl-1x9999 acts as a memory for the input node (read-only) bit operation and is used as a bit status indicator on the touch screen. Oxl~oX9999 is readable and writable, and can be used as a status indicator, a button, a trigger control position, and the like. As an input data memory, 3xl-3x9999 can be used as a numerical display component and multi-state indicator light in the touch screen. 4xl-4x9999 is readable and writable, and can be used as a numerical input component and a multi-state setting component in a touch screen. Its address is expressed in decimal numbers. OxO, lx0, 3xO, 4x0 are not available, otherwise an error will occur during compilation.

The register address corresponding to the touch screen can be freely defined in the microcontroller.

Assume that P2 and P3 are input ports, and P0 and P1 are output ports. In order to facilitate the programming of the single chip, the pin states of the P2 and P3 ports can be mapped to 20H, 21H, corresponding to the touch screen lxl-1x16. The P0, P1 output port data is stored in the registers 22H, 23H, corresponding to the touch screen 0xl - 0x16. 24H-28H is used as a bit operation storage area corresponding to the touch screen 0x16-1x56. Set 30H-3F:H to 8 data display registers, corresponding to touch screens 3xl-3x8. Set 40H to 4FH to 8 data setting registers, corresponding to touch screens 4x1-4x8. This can list the correspondence table between the touch screen and the MCU communication address. The bit address is shown in Table 2. The word address is shown in Table 3.

Table 2 touch screen and MCU communication bit address correspondence table

Table 3 touch screen and single-chip communication word address correspondence table

With a light output of up to 16,800 lumens, our Outdoor Led Wall Light Fixtures will light up any area to create a more secure environment. Outdoor Led Wall Pack is perfect for outdoor perimeter and area lighting. Features wide lateral spacing. And Outdoor Led Wall Light Fixtures will save you up to 85% on your energy bill. Bbier Outdoor Wall Lights come with a silicone gasket which PREVENTS LEAKAGE from the outside. It is also HEAT AND IMPACT RESISTANT. Comes in a standard dark bronze finish to match any area. Made of Glass or PC Lens. Glass will not degrade or change colors from sunlight exposure.


We uphold the highest standards for all our products by testing each product for optimal performance and safety. Bbier Outside Wall Lights are non toxic, unlike traditional HID wall packs, and will not fade over time, so you can enjoy a consistent high output light. The IP65 weatherproof rating ensures our Led Wall Pack can stand up to the elements. Outdoor Led Wall Light Fixtures is ideal for outdoor spaces such as building exteriors, parkings lots, street/alleyways, paraking lots and garages.


Outdoor Led Wall Light Fixtures






Outdoor Led Wall Light Fixtures

Outdoor Led Wall Pack,Outdoor Led Wall Light Fixtures,Outdoor Wall Lights,Outside Wall Lights

Shenzhen Bbier Lighting Co., Ltd , https://www.chinabbier.com