Serial port testing method and system
By periodically sending identification characters in the main program of the touch chip and parsing them on the serial port tool, the problems of device dependence and low efficiency in UART serial port testing are solved, realizing simple and efficient serial port testing.
Patent Information
- Application Number
- CN202111631876.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2041-12-29
AI Technical Summary
Existing UART serial port testing methods require KTV-compatible motherboards and touch sensors, which are slow to plug and unplug, costly, and inefficient, and manual marking leads to low production capacity.
By applying a timer in the main program of the touch chip, identification characters are periodically sent, and the serial port tool is used to determine whether these characters are received and parsed, thus determining the normal working status of the serial port components.
It enables serial port testing without the need for additional equipment, reducing testing costs and improving testing efficiency and productivity.
Smart Images

Figure CN114579372B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of serial port testing, specifically a serial port testing method and system. Background Technology
[0002] Common touch control panels have two interfaces: a USB interface and a UART serial port. The UART serial port is mainly used for touch screens in KTVs. The industry standard for the UART serial port is three valid lines: a 5V Vdd line, a GND ground line, and a TX signal line. The TX signal line is used to transmit touch coordinate signals from the touch control panel to the KTV system motherboard.
[0003] There are two main testing methods for UART serial ports: one is to test directly on the serial port, and the other is to test by drawing lines on a KTV monitor. For the line drawing test, the sensor is first plugged into the touch control panel. A KTV motherboard and monitor are then used, and lines are drawn by hand to check for signal output on the monitor, thus determining if the UART serial port is working properly. This method requires a KTV motherboard and a touch sensor. The sensor's ribbon cable has over 60 pins or multiple ribbon cables, making plugging and unplugging extremely slow. The ribbon cables also have a limited lifespan, increasing testing costs and reducing efficiency. Furthermore, the need to connect the connector and perform the manual line drawing action results in low production capacity. Summary of the Invention
[0004] The purpose of this invention is to provide a serial port testing method to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A serial port testing method, comprising the following steps:
[0007] S1. Connect the TX signal line to the serial port interface;
[0008] S2. In the main program of the touch chip, a timer is requested, and the timer periodically sends a recognition character from the TX signal line at predetermined intervals.
[0009] S3. Design a serial port tool. When the serial port is plugged in, determine whether the identified character is received and parsed within a preset period. If yes, it is determined that the three lines from the touch chip to the TX port and the components in the transmission process are working normally. If no, it is determined that there is an abnormality in the three lines from the touch chip to the TX port and the components in the transmission process.
[0010] As a further scheme of the present application, the step S3 further comprises the step of: when it is determined that the components in the process of transmission from the touch control chip to the TX port three lines are normal, and the touch screen has no real touch in the idle time, the steps S2-S3 are cycled, and it is determined whether the identification character is received and parsed in a preset period, if yes, it is determined that the components in the process of transmission from the touch control chip to the TX port three lines are normal, and if no, it is determined that the components in the process of transmission from the touch control chip to the TX port three lines are abnormal.
[0011] As a further scheme of the present application, the step S2 comprises the step of:
[0012] The main program of the touch control chip periodically sends the head identification character as a test interface signal according to a preset time, and transmits the head identification character in a touch data mode on the link line.
[0013] As a further scheme of the present application, the preset period is twice or more than twice of the preset time.
[0014] A serial port test system comprises:
[0015] A TX port is used for connecting a TX signal line on a serial port interface.
[0016] An identification character sending module is used for periodically sending an identification character from the TX signal line according to a preset time period by using a timer.
[0017] A judging module is used for judging whether the identification character is received and parsed in a preset period, and determining that the components in the process of transmission from the touch control chip to the TX port three lines are abnormal when the identification character is not received or parsed in the preset period.
[0018] As a further scheme of the present application, the judging module further comprises a cycle judging unit, which is used for cycling the judging module when it is determined that the components in the process of transmission from the touch control chip to the TX port three lines are normal, and the touch screen has no real touch in the idle time, and determining that the components in the process of transmission from the touch control chip to the TX port three lines are abnormal when the identification character is not received or parsed in the preset period.
[0019] As a further scheme of the present application, the identification character sending module comprises a specific identification character sending unit, which is used for periodically sending the head identification character as a test interface signal according to a preset time, and transmitting the head identification character in a touch data mode on the link line.
[0020] Compared with the prior art, the application has the beneficial effects that the application sends the identification character to the computer end at a fixed time, and the identification character can be set according to the use condition, so that the real-time monitoring of whether the serial port can normally work is ensured, and the original connection mode is used for detection, so that the process is simple, no other test supporting devices are needed, and test cost is saved. BRIEF DESCRIPTION OF DRAWINGS
[0021] Fig. 1 It is a serial port test method diagram.
[0022] Fig. 2 It is a connection diagram of the serial port test method.
[0023] Fig. 3 It is a test control diagram in the serial port test method. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.
[0025] Please refer to Figs. 1-3 In the embodiments of the application, a serial port test method and system include the following steps.
[0026] S1, a TX signal line outwardly sent by a serial port interface is connected, because there is basically only one TX signal line outwardly sent by a serial port interface, only touch data is transmitted, and the coordinates of the touch position of the touch sensor can be inductively transmitted, when the coordinates of the touch position are transmitted, in order to realize the test of the serial port, a string of invalid characters can be sent for identification when the coordinates are sent, so step S2 is included.
[0027] S2, in order to realize the test of the serial port, a timer one is applied in the main program of the touch control chip, a period of identification characters is outwardly sent from the TX signal line under the control of the timer one, and the period T0 can be set to about 50 ms, in this step, the normal reporting of the coordinates signal and the efficiency problem during the test can be adjusted by the period T0 adjustment, if T0 is too short, the transmission frequency is too high, and some computers run slowly, if T0 is too long, the test end waits for a too long acceptance time, and the efficiency is low, and it is recommended that T0 is selected as any value between 10 ms and 200 ms. The set time T0 adopts a cyclic sending mode, so that the control board one can be tested without a related start signal after power-on, because only the TX signal line can be sent in this scene, and cannot accept signals.
[0028] S3, the design of serial port tool, when plugged in serial port, in a certain period of time to determine whether to receive and parse the identification character, that is, in this embodiment, with 2T0 or 2T0 above time as a period, if the identification character is received and parsed, it is determined that the touch chip, TX signal line and the process of the device are working normally, if not, it is determined that there is an abnormality from the touch chip, TX signal line and the process of the device, and the test result is OK on the test tool.
[0029] As a further embodiment of the present application, please refer to Fig. 1 and Fig. 2 , step S3 further comprises the steps of: when it is determined that the touch chip to the TX port three lines and the process of the device are working normally, and the idle time of the touch screen without real touch, the steps S2-S3 are cycled, and it is determined whether the identification character is received and parsed in a predetermined period, if yes, it is determined that the touch chip to the TX port three lines and the process of the device are working normally, if not, it is determined that there is an abnormality from the touch chip to the TX three lines and the process of the device.
[0030] As a further embodiment of the present application, please refer to Fig. 1 and Fig. 2 , the identification character in step S2 is the head identification character, which is "TWSC", and the character "TWSC" is an invalid character relative to the KTV host, because the content is very little, so it does not affect the normal communication. Through the mcu program of the touch chip, a segment of "invalid character" which does not affect the work of the KTV host is sent as a test tool interface signal, which is transmitted on the link line in a manner similar to normal touch data.
[0031] A serial port test system comprises a TX port for connecting a TX signal line on a serial port interface, so as to enable the transmission of information; an identification character sending module for sending a segment of identification character from the TX signal line periodically according to a predetermined time period by using a timer; a judgment module for judging whether the identification character is received and parsed in a predetermined period, and determining that there is an abnormality from the touch chip to the TX three lines and the process of the device when the identification character is not received or parsed in the predetermined period.
[0032] As a further embodiment of the present application, the judgment module further comprises a cycle judgment unit for cycling the judgment module when it is determined that the touch chip to the TX port three lines and the process of the device are working normally, and the idle time of the touch screen without real touch, and determining that there is an abnormality from the touch chip to the TX three lines and the process of the device when the identification character is not received or parsed in the predetermined period.
[0033] As a further embodiment of this application, the character recognition sending module includes a specific character recognition sending unit for periodically sending head recognition characters as test interface signals at preset times, and transmitting them on the link line in the form of touch data, thereby enabling the transmission of specific data.
[0034] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0035] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A serial port testing method, characterized in that, Including the following steps: S1. Connect the TX signal line to the serial port interface; S2. In the main program of the touch chip, a timer is requested, and the timer periodically sends a recognition character from the TX signal line at predetermined intervals. S3. Design a serial port tool. When the serial port is plugged in, determine whether the identified character is received and parsed within a preset period. If yes, it is determined that the three lines from the touch chip to the TX port and the components in the transmission process are working normally. If no, it is determined that there is an abnormality in the three lines from the touch chip to the TX port and the components in the transmission process. Step S3 further includes the following steps: when it is determined that the three lines from the touch chip to the TX port and the components in the transmission process are working normally, and during the idle time when the touch screen is not actually touched, steps S2-S3 are repeated, and it is determined whether the identification character is received and parsed within a preset period. If yes, it is determined that the three lines from the touch chip to the TX port and the components in the transmission process are working normally; if no, it is determined that there is an abnormality in the three lines from the touch chip to the TX port and the components in the transmission process.
2. The serial port testing method according to claim 1, characterized in that, Step S2 includes the following steps: The main program of the touch chip sends head recognition characters as test interface signals at preset times, and transmits them on the link line in the form of touch data; the head recognition characters are invalid characters.
3. The serial port testing method according to claim 2, characterized in that, The preset period is twice or more than the preset time.
4. A serial port testing system, characterized in that, include: The TX port is used to connect the TX signal line to the serial port interface. The character recognition and transmission module is used to periodically transmit a segment of recognition character from the TX signal line at predetermined intervals using a timer. The judgment module is used to determine whether the identification character is received and parsed within a preset period, and to determine that there is an abnormality in the three lines from the touch chip to TX and the components in the transmission process if the identification character is not received or parsed within the preset period. The judgment module also includes a loop judgment unit, which is used to loop the judgment module during the idle time when the three lines from the touch chip to the TX port and the components in the transmission process are working normally and the touch screen is not actually touched. If the recognition character is not received or parsed within a preset period, it is determined that there is an abnormality in the three lines from the touch chip to the TX port and the components in the transmission process.
5. The serial port testing system according to claim 4, characterized in that, The character recognition sending module includes a specific character recognition sending unit, which is used to send the head recognition character as a test interface signal at preset times, and transmit it on the link line in the form of touch data.
Citation Information
Patent Citations
Test approach for debugging serial port function with single board and system thereof
CN101110051A