Serial communication circuit and wearable device
By using analog switches and voltage dividers in the serial port communication circuit, we ensure that the serial port path is pulled up or lowered when the upper computer is connected, preventing interference, solving the problem of easy interference in the serial port communication and realizing the connection in the upper computer normal communication.
Patent Information
- Application Number
- CN201910027945.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-11
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2039-01-11
AI Technical Summary
When serial communication is not communicated, it is easily affected by external interference signals, affecting the normal operation of the equipment.
A serial communication circuit is designed, using analog switches and power interfaces to form a voltage divider circuit through pull-down resistors and pull-up resistors, ensuring that the serial data path is forced to be pulled up or lowered when the upper computer is connected, and preventing interference signals from being disturbed. , serial communication is only allowed when the upper computer is connected.
It effectively prevents the influence of interference signals during serial port communication, ensures that the device is not disturbed when the upper computer is connected, and only allows serial port communication when the upper computer is connected, ensuring the normal operation of the device.
Smart Images

Figure CN109522261B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular, relates to a serial port communication circuit and a wearable device. Background Art
[0002] For wristband-type wearable products, when the main chip does not support USB communication, serial communication is generally used to communicate with the host computer.
[0003] When the serial port is not communicating, it is easily affected by external interference signals, which will generate interference signals on the serial port data line, which will affect the normal operation of the device. Summary of the invention
[0004] The present application provides a serial port communication circuit and a wearable device, which solve the technical problem that the existing serial port is easily interfered during non-communication period.
[0005] In order to solve the above technical problems, this application adopts the following technical solutions:
[0006] A serial communication circuit is proposed, comprising a main chip, wherein the main chip comprises a main chip serial port data pin; further comprising a serial port interface, a power interface and an analog switch; the serial port interface comprises a host computer serial port data pin; the power interface comprises a power supply pin; the main chip serial port data pin is connected to the host computer serial port data pin; the power supply pin is grounded through a pull-down resistor; the enable pin of the analog switch is connected to the power supply pin, the output end of the analog switch is connected to the main chip serial port data pin, the first input end of the analog switch is pulled high or grounded, and the second input end of the analog switch is left empty.
[0007] Furthermore, the power interface is a USB power interface.
[0008] Furthermore, when the enable pin of the analog switch is at a low level, the analog switch switches to the channel of the first input end; when the enable pin of the analog switch is at a high level, the analog switch switches to the channel of the second input end.
[0009] Furthermore, the enable pin of the analog switch is connected to the power supply pin via a pull-up resistor, and the pull-up resistor and the pull-down resistor form a voltage divider circuit.
[0010] Furthermore, the analog switch is a single-pole double-throw switch.
[0011] Furthermore, the main chip serial port data pin includes a main chip serial port sending data pin and a main chip serial port receiving data pin, and the host computer serial port data pin includes a host computer serial port sending data pin and a serial port receiving data pin; the analog switch includes a first analog switch and a second analog switch; the main chip serial port sending data pin is connected to the host computer serial port receiving data pin; the main chip serial port receiving data pin is connected to the host computer serial port sending data pin; the enable pin of the first analog switch is connected to the power supply pin of the serial port interface, the output end of the first analog switch is connected to the main chip serial port sending data pin, the first input end of the first analog switch is pulled high or grounded, and the second input end of the first analog switch is empty; the enable pin of the second analog switch is connected to the power supply pin of the serial port interface, the output end of the second analog switch is connected to the main chip serial port receiving data pin, the first input end of the second analog switch is pulled high or grounded, and the second input end of the second analog switch is empty.
[0012] A wearable device is proposed, comprising the above-mentioned serial port communication circuit.
[0013] Furthermore, the wearable device is a wristband device.
[0014] Compared with the prior art, the advantages and positive effects of the present application are as follows: the serial communication circuit proposed in the present application includes an analog switch, the enable end of the analog switch is connected to the power supply pin of the power interface, the first input end thereof is pulled high or grounded, the second input end is empty, and the output end is connected to the serial data pin of the main chip; after the power interface is connected to the host computer, the power supply of the host computer makes the power supply pin of the power interface a high level, so that the analog switch switches to the path of the second input end. Since the second input end of the analog switch is empty, the serial data path will not be introduced into other signals, and normal communication can be achieved; if the power interface is not connected When the host computer is connected to the power interface, the power supply pin of the power interface is pulled low by the resistor, so that the analog switch switches to the path of the first input terminal. Since the first input terminal of the analog switch is pulled high or grounded, the serial port data path is also pulled high or grounded, and serial communication cannot be carried out. In this way, it is ensured that when there is no host computer connected to the power interface, the serial port path is forced to be pulled high or low and serial communication cannot be carried out. Even if there is interference, it will not cause serial communication and affect the normal operation of the equipment. Only when the power interface is connected to the host computer, can serial communication be effectively carried out, which solves the technical problem that the existing serial port is easily interfered during non-communication.
[0015] After reading the detailed description of the embodiments of the present application in conjunction with the accompanying drawings, other features and advantages of the present application will become more clear. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a circuit architecture diagram of the serial communication circuit proposed in this application;
[0017] Figure 2 This is a circuit architecture diagram of the serial communication circuit proposed in this application;
[0018] Figure 3 This is a circuit architecture diagram of the serial communication circuit proposed in this application;
[0019] Figure 4 This is a circuit architecture diagram of the serial communication circuit proposed in this application. DETAILED DESCRIPTION
[0020] The specific implementation of the present application is further described in detail below with reference to the accompanying drawings.
[0021] The serial communication circuit proposed in this application is as follows: Figure 1 As shown, it includes a main chip U1, a serial port interface J1, a power interface J2 and an analog switch U2. The main chip U1 includes a main chip serial port data pin UART; the serial port interface J1 includes a host computer serial port data pin uart; the power interface J2 includes a power supply pin VBUS; the main chip serial port data pin UART is connected to the host computer serial port data pin uart; the power supply pin VBUS is grounded through a pull-down resistor R1; the enable pin en of the analog switch U2 is connected to the power supply pin VBUS, the output terminal com of the analog switch U2 is connected to the main chip serial port data pin UART, the first input terminal NC of the analog switch U2 is pulled high or grounded, and the second input terminal NO of the analog switch U2 is left empty; here, the power supply VCC for the connected device is pulled high.
[0022] After the power interface J2 is connected to the host computer, the power supply of the host computer makes the power supply pin VBUS of the power interface J2 high, so that the analog switch U2 switches to the path of the second input end. Since the second input end of the analog switch U2 is empty, no other signals will be introduced into the serial port data path, and normal communication can be achieved; if the power interface J2 is not connected to the host computer, the enable pin en of the analog switch is grounded through the pull-down resistor R1, so that the analog switch U2 switches to the path of the first input end. Since the first input end of the analog switch U2 is pulled high or grounded, the serial port data path is forced to be pulled high or grounded, and serial port communication cannot be performed; in this way, it is ensured that when there is no host computer connected to the power interface, the serial port path is forced to be pulled high or low and serial port communication cannot be performed. Even if there is interference, it will not cause serial port communication and affect the normal operation of the device. Only when the power interface is connected to the host computer, serial port communication can be effectively performed, which solves the technical problem that the existing serial port is easily interfered during non-communication.
[0023] In a specific application, the analog switch is a single-pole double-throw switch, and the power interface is a USB power interface; Figure 2As shown, the enable pin en of the analog switch U2 is connected to the power pin VBUS through the pull-up resistor R2. The pull-up resistor R2 and the pull-down resistor R1 form a voltage divider circuit. The connection end of the pull-up resistor R2 and the pull-down resistor R1, that is, the voltage divider output end is connected to the enable pin of the analog switch U2. When the host computer is connected to the USB power interface J2, the power provided by the power pin VBUS is divided and applied to the enable pin en of the analog switch U2. The specific values of the pull-up resistor R2 and the pull-down resistor R1 are determined according to the requirements of the analog switch U2 for enabling the high level.
[0024] like Figure 3 and Figure 4 In a specific embodiment, the serial port data pin of the main chip includes a main chip serial port data sending pin UART_TX and a main chip serial port receiving data pin UART_RX, and the host computer serial port data pin includes a host computer serial port data sending pin uart_tx and a serial port receiving data pin uart_rx; the analog switch includes a first analog switch U21 and a second analog switch U22; the main chip serial port data sending pin UART_TX is connected to the host computer serial port receiving data pin uart_rx; the main chip serial port receiving data pin UART_RX is connected to the host computer serial port sending data pin uart_tx; the enable pin of the first analog switch U21 is connected to the power supply pin VBUS through a voltage divider circuit, the output end of the first analog switch U21 is connected to the main chip serial port sending data pin UART_TX, and the first input end of the first analog switch U21 is pulled high (such as Figure 3 as shown) or grounded (as Figure 4 As shown), the second input terminal of the first analog switch U21 is set to empty; the enable pin of the second analog switch U22 is connected to the power supply pin VBUS through a voltage divider circuit, the output terminal of the second analog switch U22 is connected to the main chip serial port receiving data pin UART_RX, the first input terminal of the second analog switch U22 is pulled high or grounded, and the second input terminal of the second analog switch is set to empty.
[0025] When there is no host computer connected to the USB power interface J2, the enable pins of the first analog switch U21 and the second analog switch U22 are at a low level, so that the main chip serial port data sending pin and the main chip serial port receiving data pin are forced to be pulled high or grounded, thereby failing to achieve serial communication. At this time, even if there is interference, the normal operation of the device will not be affected by the existence of serial communication. When the USB power interface J2 is connected to the host computer, the enable pins of the first analog switch U21 and the second analog switch U22 are at a high level, so that the main chip serial port data sending pin and the main chip serial port receiving data pin are released, so that serial communication can be performed normally.
[0026] Based on the above-mentioned serial communication circuit, the present application proposes a wearable device, such as a wrist-worn device, an earphone device, a head-worn device, etc., which is applied with the above-mentioned serial communication circuit to ensure that when it is not connected to a host computer, the serial port data pin of the main chip is forced to be pulled high or grounded and serial port communication cannot be performed, thereby ensuring the normal operation of the wearable device without interference. Only when it is connected to the host computer, the serial port data pin of the main chip is released and serial port communication is performed normally.
[0027] It should be pointed out that the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by ordinary technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A serial communication circuit, comprising a main chip, wherein the main chip comprises a main chip serial port data pin; characterized in that: It also includes a serial port interface, a power supply interface and an analog switch; the serial port interface includes a host computer serial port data pin; the power supply interface includes a power supply pin; the main chip serial port data pin is connected to the serial port interface; the power supply pin is grounded through a pull-down resistor; The enable pin of the analog switch is connected to the power supply pin, the output end of the analog switch is connected to the serial port data pin of the main chip, the first input end of the analog switch is pulled high or grounded, and the second input end of the analog switch is left empty; When the enable pin of the analog switch is at a low level, the analog switch switches to the channel of the first input end; when the enable pin of the analog switch is at a high level, the analog switch switches to the channel of the second input end.
2. The serial communication circuit according to claim 1, characterized in that: The power interface is a USB power interface.
3. The serial communication circuit according to claim 1, characterized in that: The enable pin of the analog switch is connected to the power supply pin through a pull-up resistor, and the pull-up resistor and the pull-down resistor form a voltage divider circuit.
4. The serial communication circuit according to claim 1, characterized in that: The analog switch is a single-pole double-throw switch.
5. The serial communication circuit according to claim 1, characterized in that: The main chip serial port data pin includes a main chip serial port sending data pin and a main chip serial port receiving data pin, and the host computer serial port data pin includes a host computer serial port sending data pin and a host computer serial port receiving data pin; the analog switch includes a first analog switch and a second analog switch; The main chip serial port data sending pin is connected to the host computer serial port data receiving pin; the main chip serial port data receiving pin is connected to the host computer serial port data sending pin; The enable pin of the first analog switch is connected to the power supply pin, the output end of the first analog switch is connected to the data sending pin of the serial port of the main chip, the first input end of the first analog switch is pulled high or grounded, and the second input end of the first analog switch is empty; The enable pin of the second analog switch is connected to the power supply pin, the output end of the second analog switch is connected to the serial port data receiving pin of the main chip, the first input end of the second analog switch is pulled high or grounded, and the second input end of the second analog switch is empty.
6. A wearable device, characterized in that: Comprising the serial communication circuit as described in any one of claims 1-5.
7. The wearable device according to claim 6, characterized in that: The wearable device is a wrist-mounted device, an earphone device or a head-mounted device.
