A serial communication circuit for a TWS Bluetooth earphone dock and a communication method based on the circuit.

CN116033307BActive Publication Date: 2026-08-14SHENZHEN ZUNXIN ELECTRONIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]现有的常规的两 PIN 针通信方式,利用升压芯片使能脚模拟通信信号,通信引脚和耳机充电正极复用,实现 TWS 蓝牙耳机底座和蓝牙耳机的通信,但是两 PIN 针通信方式一般只能支持单向传输,只能发射数据而不能接收数据,且由于和耳机充电正极复用,通信速率慢,一个 bit 时序在 2mS 左右;为解决两PIN 针通信方式只能单向传输和通信速率慢的问题,能够使用三 PIN 针代替两PIN 针实现通信,即串口通信脚单独使用一个单片机 GPIO 通过 PIN 针和耳机连接,能够支持 TWS 蓝牙耳机底座和蓝牙耳机进行高速双向串口通信,但是目前使用三 PIN 针的通信方式其主控模块外围电路需要有多种模块配合才能实现功能,制造成本高

Benefits of technology

本发明提供的一种 TWS 蓝牙耳机底座串口通信电路及基于该电路的通信方法,实现了使 TWS 蓝牙耳机底座通过两个 PIN 针与蓝牙耳机进行双向高速串口通信,且主控模块外围电路结构简单,不需要多种模块配合就能实现其功能,制造成本低,具有较好的量产前景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116033307B_ABST
    Figure CN116033307B_ABST
Patent Text Reader

Abstract

This invention discloses a serial communication circuit for a TWS Bluetooth headset dock and a communication method based on the circuit. The TWS Bluetooth headset dock serial communication circuit includes a main control module and a serial communication module. The serial communication module includes a PIN pin unit for connecting to the Bluetooth headset. The PIN pin unit includes a first PIN pin J2 and a second PIN pin J3. The main control module is equipped with a 100µs timer for issuing a cyclic interrupt signal. Through the TWS Bluetooth headset dock serial communication circuit and the communication method based on the circuit, bidirectional high-speed serial communication between the TWS Bluetooth headset dock and the Bluetooth headset is realized through two PIN pins. Moreover, the peripheral circuit structure of the main control module is simple, and its function can be realized without the cooperation of multiple modules. The manufacturing cost is low, and it has good mass production prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Bluetooth headset communication technology. Background Technology

[0002] With the rapid development of TWS technology, Bluetooth earphones are becoming smaller and smaller. This means that some of the functions of traditional earphone buttons are now handled by the TWS dock. As the functionality becomes more and more complete, the amount of data communicated between the TWS dock and the Bluetooth earphones is increasing and becoming faster.

[0003] The existing conventional two-pin communication method uses a boost chip enable pin to simulate a communication signal. The communication pin is multiplexed with the positive terminal of the earphone charging port to achieve communication between the TWS Bluetooth earphone dock and the Bluetooth earphone. However, the two-pin communication method generally only supports unidirectional transmission, only transmitting data and not receiving data. In addition, due to the multiplexing with the positive terminal of the earphone charging port, the communication speed is slow, with a timing of about 2ms per bit. To solve the problems of unidirectional transmission and slow communication speed of the two-pin communication method, a three-pin communication method can be used instead of the two-pin communication method. That is, the serial communication pin uses a microcontroller GPIO to connect to the earphone through the pin, which can support high-speed bidirectional serial communication between the TWS Bluetooth earphone dock and the Bluetooth earphone. However, the current three-pin communication method requires multiple modules to cooperate in the peripheral circuit of the main control module to realize the function, resulting in high manufacturing costs. Summary of the Invention

[0004] To address the problems in the prior art mentioned above, this invention provides a serial communication circuit for a TWS Bluetooth headset dock and a communication method based on this circuit.

[0005] The TWS Bluetooth headset dock serial communication circuit provided by this invention includes: a charging interface module, a buck-boost module, and a power module. The power input terminal of the charging interface module is used to connect to an external power source. The power output terminal of the charging interface module is connected to the first power input terminal of the buck-boost module. The first power output terminal of the buck-boost module is connected to the power input terminal of the power module. The power output terminal of the power module is connected to the second power input terminal of the buck-boost module. The circuit also includes: a main control module and a serial communication module. The serial communication module includes a PIN unit for connecting to the Bluetooth headset. The PIN unit includes a first PIN J2 and a second PIN J3. The main control module is equipped with a 100µs timer for issuing a loop interrupt signal. The second power output terminal of the buck-boost module is connected to the power input terminal of the main control module. The third power output terminal of the buck-boost module is connected to the power input terminal of the serial communication module. The control signal output terminal of the main control module is connected to the control signal input terminal of the serial communication module. The data transmission terminal of the main control module is connected to the data transmission terminal of the serial communication module.

[0006] In one embodiment, the serial communication module further includes a low-level on-switch element Q1, a high-level on-switch element Q2, and a resistor R8. The third power output terminal of the buck-boost module is connected to the controlled on-input terminal of the low-level on-switch element Q1, and the controlled on-output terminal of the low-level on-switch element Q1 is connected to one end of the PIN pin unit. The data transmission terminal of the main control module is connected to the common terminal of the low-level on-switch element Q1 and the PIN pin unit. The other end of the PIN pin unit is grounded. The control signal output terminal of the main control module is connected to the control on-switch terminal of the high-level on-switch element Q2. The control on-switch terminal of the low-level on-switch element Q1 is connected to the controlled on-input terminal of the high-level on-switch element Q2, and the controlled on-output terminal of the high-level on-switch element Q2 is grounded. One end of the resistor R8 is connected to the controlled on-input terminal of the low-level on-switch element Q1, and the other end of the resistor R8 is connected to the common terminal of the low-level on-switch element Q1 and the high-level on-switch element Q2.

[0007] In one embodiment, the controlled on-output terminal of the low-level on-switch element Q1 is connected to one end of the first PIN J2 and the second PIN J3, respectively. The data transmission terminal of the main control module is connected to the common terminal of the low-level on-switch element Q1 and the first PIN J2. The data transmission terminal of the main control module is also connected to the common terminal of the low-level on-switch element Q1 and the second PIN J3. The other end of the first PIN J2 and the second PIN J3 is grounded.

[0008] In one embodiment, the main control module further includes a communication enable pin for providing a bias voltage for communication.

[0009] This invention also provides a communication method for a serial communication circuit of a TWS Bluetooth earphone dock, comprising the following steps: S1. Power on the TWS Bluetooth earphone base. After the power-on is stable, the main control module initializes and executes a loop task. S2. Send a serial communication request to the TWS Bluetooth headset dock. After receiving the serial communication request, the main control module generates a loop task interrupt signal through a 100uS timer, causing the main control module to enter the serial port working mode. S3. The main control module determines the working status of the serial communication module; S4. When the serial communication module meets the serial communication conditions, the main control module sends serial data to the Bluetooth headset through the serial communication module. S5. The main control module receives and processes the serial port data fed back by the Bluetooth headset.

[0010] In one embodiment, in step S1, the main control module executes a loop task, which includes sequentially executing function tasks. The function tasks include: an empty function, a charging function, a Hall switch detection function, a battery ADC conversion module function, a power function, a discharge function, a display function, an NTC detection and control function, a sleep clearing judgment function, and a time function.

[0011] In one embodiment, the sleep clearing judgment is used to determine whether the TWS Bluetooth earphone base meets the sleep conditions. If it does not meet the conditions, the loop task continues to be executed. If the sleep conditions are met, the 100µs timer is turned off, the external interrupt is turned on, and the device enters sleep mode, waiting for the external interrupt to wake it up.

[0012] In one embodiment, in step S3, the main control module determines the working status of the serial communication module. If the serial communication module is in an inactive state, it continues to determine whether a new event has occurred. If no new event has occurred, the main control module exits the serial communication working state. If a new event has occurred, it determines whether the previous serial port processing has been completed. If it has been completed, the main control module exits the serial communication working state. If it has been completed, the serial communication will begin.

[0013] In one embodiment, in step S4, the main controller puts the data to be sent into the temporary transmission register and starts the serial port transmission process through the serial communication module. After the temporary register data is sent, the receive buffer register is cleared and the serial port receive waiting state is entered.

[0014] In one embodiment, in step S5, after the Bluetooth headset receives the serial port data, it sends the corresponding data to the main control module based on the received data. After the main control module receives the data, it exits the serial port working mode, re-executes the loop task, and processes the received cached data. This invention provides a serial communication circuit for a TWS Bluetooth headset dock and a communication method based on the circuit, enabling the TWS Bluetooth headset dock to conduct bidirectional high-speed serial communication with the Bluetooth headset through two pins. The main control module has a simple peripheral circuit structure, does not require multiple modules to achieve its function, has low manufacturing cost, and has good mass production prospects. Attached Figure Description

[0015] Figure 1 is a circuit block diagram of a serial communication circuit for a TWS Bluetooth headset dock provided by the present invention; Figure 2 is a circuit diagram of the charging interface module provided by the present invention; Figure 3 is a circuit diagram of the buck-boost module provided by the present invention; Figure 4 is a circuit schematic diagram of the power module provided by the present invention; Figure 5 is a circuit schematic diagram of the main control module provided by the present invention; Figure 6 is a circuit schematic diagram of the serial communication module provided by the present invention; Figure 7 is a circuit diagram of the PIN pin unit provided by the present invention; Figure 8 is a flowchart of a communication method based on a serial communication circuit of a TWS Bluetooth headset dock provided by the present invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0017] The existing conventional two-pin communication method uses a boost chip enable pin to simulate a communication signal. The communication pin is multiplexed with the positive terminal of the earphone charging port to achieve communication between the TWS Bluetooth earphone dock and the Bluetooth earphone. However, the two-pin communication method generally only supports unidirectional transmission, only transmitting data and not receiving data. In addition, due to the multiplexing with the positive terminal of the earphone charging port, the communication speed is slow, with a timing of about 2ms per bit. To solve the problems of unidirectional transmission and slow communication speed of the two-pin communication method, a three-pin communication method can be used instead of the two-pin communication method. That is, the serial communication pin uses a microcontroller GPIO to connect to the earphone through the pin, which can support high-speed bidirectional serial communication between the TWS Bluetooth earphone dock and the Bluetooth earphone. However, the current three-pin communication method requires multiple modules to cooperate in the peripheral circuit of the main control module to realize the function, resulting in high manufacturing costs.

[0018] This invention provides a serial communication circuit for a TWS Bluetooth headset dock and a communication method based on the circuit, enabling the TWS Bluetooth headset dock to conduct bidirectional high-speed serial communication with the Bluetooth headset through two pins. The main control module has a simple peripheral circuit structure, does not require multiple modules to achieve its function, has low manufacturing cost, and has good mass production prospects.

[0019] Please refer to Figures 1-8. This invention provides a serial communication circuit for a TWS Bluetooth headset dock and a communication method based on this circuit. In this embodiment, a serial communication circuit for a TWS Bluetooth earphone dock includes a charging interface module, a buck-boost module, and a power module. The charging interface module includes a Type-C interface, but other types of charging interfaces such as USB and Lightning can also be used. The buck-boost module includes an ETA9084A-esop10 buck-boost chip, which can boost or buck the input power signal before outputting a corresponding voltage power signal. The buck-boost module also includes a filter capacitor C3, which makes the output voltage more stable. The power input terminal of the charging interface module is used to connect to an external power source, and the power output terminal of the charging interface module is connected to the first power input terminal of the buck-boost module. The first power output terminal of the buck-boost module is connected to the power input terminal of the power module. The external power source can charge the internal power supply of the TWS Bluetooth earphone dock through the charging interface module and the buck-boost module.

[0020] In this embodiment, the circuit further includes a main control module and a serial communication module. The main control module includes a ZXC02E main control chip, but other chips capable of enabling the main control module to perform the same functions as in this invention can also be used. The main control module has a 100µs timer for issuing a loop interrupt signal. The power output terminal of the power supply module is connected to the second power input terminal of the buck-boost module, the second power output terminal of the buck-boost module is connected to the power input terminal of the main control module, and the third power output terminal of the buck-boost module is connected to the power input terminal of the serial communication module. The power supply module can supply power to the main control module through the buck-boost module and supply power to the Bluetooth headset through the buck-boost module and the serial communication module. The supply voltage to the Bluetooth headset is 5V. The main control module also includes a communication enable pin for providing a bias voltage for communication, namely pin 5 of the main control chip. The communication enable pin outputs a low level by default. The communication enable pin also includes an anti-reverse sub-unit, which is a diode D3, to prevent 5V from being reversed. Direct voltage to the communication enable pin can damage the main control chip. The control signal output of the main control module is connected to the control signal input of the serial communication module. The control signal output of the main control module is pin 9 of the main control chip. The main control module can disable the power supply to the Bluetooth headset from the power module via its control signal output, preventing the filter capacitor C3 from interfering with serial communication when the power module supplies power to the Bluetooth headset. The data transmission terminal of the main control module is connected to the data transmission terminal of the serial communication module. The data transmission terminal of the main control module is pin 4 of the main control chip, which is a special multiplexed pin that supports open-drain functionality. When the power supply is normal and the Bluetooth headset is being charged, the charging voltage will not affect the main control chip. When the data transmission end of the main control module is in open-drain mode when the data transmission bit is high, it is in low-output mode when the data transmission bit is low.

[0021] In this embodiment, the serial communication circuit of the TWS Bluetooth headset dock also includes an NTC thermistor. One control signal output terminal of the main control module is connected to one end of the NTC thermistor, and the other end of the NTC thermistor is grounded. The NTC thermistor can effectively suppress the power-on surge current and protect the serial communication circuit of the TWS Bluetooth headset dock from damage. In this embodiment, the serial communication circuit of the TWS Bluetooth headset dock also includes a push-button switch. One end of the push-button switch is connected to the main control module, and the other end of the push-button switch is grounded. The user can turn on the TWS Bluetooth headset dock by touching the push-button switch.

[0022] In this embodiment, the serial communication module includes a low-level on / off switch element Q1, a high-level on / off switch element Q2, a PIN unit, and a resistor R8. The PIN unit includes a first PIN J2 and a second PIN J3. The third power output terminal of the buck-boost module is connected to the controlled on / off input terminal of the low-level on / off switch element Q1. The controlled on / off output terminal of the low-level on / off switch element Q1 is connected to one end of the first PIN J2 and the second PIN J3. The data transmission terminal of the main control module is connected to the common terminal of the low-level on / off switch element Q1 and the first PIN J2. The data transmission terminal of the main control module is also connected to the common terminal of the low-level on / off switch element Q1 and the second PIN J3. The other ends of the first PIN J2 and the second PIN J3 are grounded. The control signal output terminal of the main control module is connected to the control on / off terminal of the high-level on / off switch element Q2. The low-level on / off switch element Q1... The control conduction terminal of the resistor is connected to the controlled conduction input terminal of the high-level conduction switch element. The controlled conduction output terminal of the high-level conduction switch element Q2 is grounded. One end of the resistor R8 is connected to the controlled conduction input terminal of the low-level conduction switch element, and the other end of the resistor R8 is connected to the common terminal of the low-level conduction switch element and the high-level conduction switch element Q2.

[0023] In this embodiment, the low-level on / off switch element Q1 is a PMOS transistor. The controlled on / off input terminal of the low-level on / off switch element Q1 is the source of the PMOS transistor, the controlled on / off output terminal of the low-level on / off switch element Q1 is the drain of the PMOS transistor, and the control on / off terminal of the low-level on / off switch element Q1 is the gate of the PMOS transistor. The high-level on / off switch element Q2 is an NMOS transistor. The controlled on / off input terminal of the high-level on / off switch element Q2 is the drain of the NMOS transistor, the controlled on / off output terminal of the high-level on / off switch element Q2 is the source of the NMOS transistor, and the control on / off terminal of the high-level on / off switch element Q2 is the gate of the NMOS transistor. Of course, the low-level on / off switch element Q1 and the high-level on / off switch element Q2 can also be replaced by other types of transistors such as NPN transistors and PNP transistors to achieve the same effect.

[0024] The present invention also provides a communication method for a serial communication circuit of a TWS Bluetooth headset dock, the method comprising the following steps: S1. Power on the TWS Bluetooth earphone dock. After stable power-on, the main control module initializes and executes a loop task. The loop task executed by the main control module includes sequentially executing function tasks, which include: an empty function, a charging function, Hall switch detection, battery ADC conversion module, power function, discharge function, display function, NTC detection and control function, sleep clear judgment, and a time function. Setting an empty function makes the structure of the loop task clearer and facilitates the expansion of other functions. The charging function is used to determine whether the power supply is in a charging state. The Hall switch detection is used to detect the Hall switch status. The battery ADC conversion module is used to perform analog-to-digital conversion on the power supply voltage. The power function is used to determine the power supply level. The discharge function is used to determine whether the power supply is in a discharging state. The display function is used to display various data such as the power supply level and charging / discharging status of the TWS Bluetooth earphone dock. The NTC detection and control function is used to detect and control the status of the NTC thermistor. The sleep clear judgment is used to determine whether the TWS Bluetooth earphone dock meets the sleep conditions. If not, the loop task continues to execute. If the sleep conditions are met, the device is turned off for 100µs. The timer enters sleep mode after an external interrupt is enabled, waiting for an external interrupt to wake it up. The external interrupt wake-up is when the user touches the button switch to turn on the TWS Bluetooth headset. The time function includes the determination of 200ms and 500ms counters.

[0025] S2. A serial communication request is sent to the TWS Bluetooth headset dock. After receiving the serial communication request, the main control module generates a cyclic task interrupt signal through a 100µs timer. When the main control module detects the cyclic task interrupt signal generated by the 100µs timer, the communication enable pin of the main control module outputs a high level to provide a bias voltage for serial communication, and the control signal output terminal of the main control module outputs a low level, making the high-level conducting switch element Q2 in the off state. At this time, the voltage at the controlled conduction input terminal of the low-level conducting switch element Q1 is equal to the voltage at the control conduction terminal, making the low-level conducting switch element Q1 also in the off state. The power supply channel of the power module to the Bluetooth headset is turned off, so that the main control module enters the serial port working mode. In this embodiment, an interrupt signal is generated and data is sent once every 100µs, and the transmission is performed at a baud rate of 9600. When other interrupt timers are set, such as a 50µs timer, a 25µs timer, etc., changing the frequency of the interrupt signal can correspondingly change the baud rate of the serial port transmission, and the fastest can support 38400. baud rate is the communication rate.

[0026] S3. The main control module determines the working status of the serial communication module: when the serial communication module is not working... If the status is not updated, the main control module will continue to check if any new events have occurred. If no new events have occurred, the main control module will exit the serial port working state. If a new event has occurred, the main control module will check if the previous serial port processing has been completed. If it has been completed, the main control module will exit the serial port working state. If it has not been completed, the current serial communication will begin. S4. When the serial communication module meets the serial communication conditions, the main control module sends data through the serial communication module. Serial port data; the specific process is as follows: the main control module puts the data to be sent into the transmit temporary register, and starts the serial port transmission process through the serial communication module. Every time an interrupt signal is generated by a 100uS timer, 1 bit is sent. When the data in the temporary register is sent, the receive buffer register is cleared and the serial port receive waiting state is entered.

[0027] S5. The main control module receives and processes the serial port data fed back by the Bluetooth headset. The specific process is as follows: the communication enable pin of the main control module continues to output a high level to provide a bias voltage for serial communication, and the control signal output terminal of the main control module continues to output a low level, so that the high-level conduction switch element Q2 is in the off state. At this time, the voltage at the controlled conduction input terminal of the low-level conduction switch element Q1 is equal to the voltage at the control conduction terminal, so that the low-level conduction switch element Q1 is also in the off state. After the Bluetooth headset finishes receiving the serial port data, it sends the corresponding data to the main control module according to the received data. Whenever data is received, the level of the data transmission terminal of the main control module is judged and the corresponding level is saved to each bit. After the main control module finishes receiving the data, it exits the serial port working mode, re-executes the loop task, and processes the received buffered data.

[0028] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A serial communication circuit for a TWS Bluetooth earphone dock, comprising a charging interface module, a buck-boost module, and a power supply module, wherein the power input terminal of the charging interface module is used to connect to an external power source, the power output terminal of the charging interface module is connected to the first power input terminal of the buck-boost module, the first power output terminal of the buck-boost module is connected to the power input terminal of the power supply module, and the power output terminal of the power supply module is connected to the second power input terminal of the buck-boost module, characterized in that: The circuit also includes a main control module and a serial communication module. The serial communication module includes a PIN pin unit for connecting to a Bluetooth headset. The PIN pin unit includes a first PIN pin J2 and a second PIN pin J3. The main control module is equipped with a 100µs timer for issuing a loop interrupt signal. The second power output terminal of the buck-boost module is connected to the power input terminal of the main control module. The third power output terminal of the buck-boost module is connected to the power input terminal of the serial communication module. The control signal output terminal of the main control module is connected to the control signal input terminal of the serial communication module. The data transmission terminal of the main control module is connected to the data transmission terminal of the serial communication module. The serial communication module also includes a low-level on / off switch element Q1, a high-level on / off switch element Q2, and a resistor R8. The third power output terminal of the buck-boost module is connected to the controlled on / off input terminal of the low-level on / off switch element Q1. The controlled on / off output terminal of the low-level on / off switch element Q1 is connected to one end of the PIN pin unit. The data transmission terminal of the main control module is connected to the common terminal of the low-level on / off switch element Q1 and the PIN pin unit. The other end of the PIN pin unit is grounded. The control signal output terminal of the main control module is connected to the control on / off terminal of the high-level on / off switch element Q2. The control on / off terminal of the low-level on / off switch element Q1 is connected to the controlled on / off input terminal of the high-level on / off switch element Q2. The controlled on / off output terminal of the high-level on / off switch element Q2 is grounded. One end of the resistor R8 is connected to the low-level on / off switch element Q1. The controlled on-input terminal of the device is connected to the other end of resistor R8, which is connected to the common terminal of the low-level on-switch element and the high-level on-switch element Q2. After receiving a serial communication request, the main control module generates a cyclic task interrupt signal via a 100µs timer. When the main control module detects this interrupt signal, its communication enable pin outputs a high level, providing a bias voltage for serial communication. Simultaneously, the control signal output terminal of the main control module outputs a low level, causing the high-level on-switch element Q2 to be in the off state. At this time, the voltage at the controlled on-input terminal of the low-level on-switch element Q1 is equal to the voltage at the control on-input terminal, causing Q1 to also be in the off state. This shuts off the power supply channel from the power module to the Bluetooth headset, allowing the main control module to enter serial port operating mode. The controlled on-output terminal of the low-level on-switch element Q1 is connected to one end of the first PIN J2 and the second PIN J3 respectively. The data transmission terminal of the main control module is connected to the common terminal of the low-level on-switch element Q1 and the first PIN J2. The data transmission terminal of the main control module is also connected to the common terminal of the low-level on-switch element Q1 and the second PIN J3. The other end of the first PIN J2 and the second PIN J3 is grounded. The main control module also includes a communication enable pin for providing bias voltage for communication. The data transmission terminal of the main control module is pin 4 of the main control chip, which is a special multiplexed pin that supports open-drain function. When the data transmission terminal of the main control module is in input open-drain mode when the data bit is high, it is in output low mode when the data bit is low. The serial communication circuit for the TWS Bluetooth earphone dock is also used for: S1. Power on the TWS Bluetooth earphone base. After the power-on is stable, the main control module initializes the configuration and executes a loop task. S2. Send a serial communication request to the TWS Bluetooth headset base. After receiving the serial communication request, the main control module generates a loop task interrupt signal through a 100uS timer, so that the main control module enters the serial port working mode. S3. The main control module determines the working status of the serial communication module; S4. When the serial communication module meets the serial communication conditions, the main control module sends serial data to the Bluetooth headset through the serial communication module. S5. The main control module receives and processes the serial port data fed back by the Bluetooth headset.

2. The serial communication circuit for a TWS Bluetooth earphone dock according to claim 1, characterized in that: In step S1, the main control module executes a loop task, which includes sequentially executing function tasks. The function tasks include: empty function, charging function, Hall switch detection, battery ADC conversion module, power function, discharge function, display function, NTC detection and control function, sleep clear judgment and time function.

3. The serial communication circuit for a TWS Bluetooth earphone dock according to claim 2, characterized in that: The sleep clearing judgment is used to determine whether the TWS Bluetooth earphone base meets the sleep conditions. If it does not meet the conditions, the loop task continues to be executed. If the sleep conditions are met, the 100uS timer is turned off, the external interrupt is turned on, and the earphone enters sleep mode, waiting for the external interrupt to wake it up.

4. The serial communication circuit for a TWS Bluetooth earphone dock according to claim 3, characterized in that: In step S3, the main control module determines the working status of the serial communication module. If the serial communication module is in an inactive state, it continues to determine whether a new event has occurred. If no new event has occurred, the main control module exits the serial communication working state. If a new event has occurred, it determines whether the previous serial port processing has been completed. If it has been completed, the main control module exits the serial communication working state. If it has not been completed, the current serial communication will begin.

5. The serial communication circuit for a TWS Bluetooth earphone dock according to claim 1, characterized in that: In step S4, the main control module puts the data to be sent into the temporary transmission register and starts the serial port transmission process through the serial communication module. After the temporary register data is sent, the receive buffer register is cleared and the serial port receive waiting state is entered.

6. The serial communication circuit for a TWS Bluetooth earphone dock according to claim 1, characterized in that: In step S5, after the Bluetooth headset receives the serial port data, it sends the corresponding data to the main control module based on the received data. After the main control module receives the data, it exits the serial port working mode, re-executes the loop task, and processes the received cached data.

Citation Information

Patent Citations

  • Charging base for communicating with Bluetooth earphone and implementation method

    CN110474403A