Simplifying TWS Earbud Designs with 1-Wire Connectivity

Abstract

This article demonstrates a design that applies ADI’s unique 1-Wire® technology to a true wireless stereo (TWS) earbud solution for the first time. The design utilizes the DS2488 1-Wire dual-port link, and features many merits, such as low cost, low power, high accuracy, small size, and high efficiency, based on meeting the requirements of power transfer and data communication. The design is an ideal solution for TWS earbud applications.

Introduction

The most attractive feature of TWS earbuds is the convenience of wireless wear. Compared to conventional Bluetooth® earbuds, TWS earbuds have many merits such as small size, good sound quality, and high stability, as well as a certain degree of water resistance and intelligence, which have quickly caught the interest of consumers. Shipment volume and total market size for TWS earbuds are continuously expanding in tandem with research and development of this technology in the field of consumer.

System Architecture

The 1-Wire TWS earbud solution presented in this article, the MAXREFDES1302, includes two parts: the charging cradle and the earbuds. The overall system hardware architecture is shown in Figure 1.

Figure 1. System architecture of 1-Wire TWS charging cradle and earbud.

The charging cradle uses a single-cell Li-Ion battery of 3.7 V, 1500 mAh to power the system, and uses the MAX77651 charger supporting the USB Type-C protocol to charge the battery. Users can charge the whole system by using one USB Type-C cable. For power rails, the charging cradle uses the MAX17224 boost module to boost the system voltage of the MAX77651 to 5 V, and MAX38640 buck module generates 3.3 V from this 5 V to power the MAX32655 microcontroller. The 5 V is also transferred to the earbud side through the 1-Wire control circuit as the power supply that charges the earbud system. The charging cradle uses the MAX17262 fuel gauge with internal current sensing resistor to monitor the battery. The MAX17262 combines the traditional coulometer with the novel ModelGauge™ m5 EZ algorithm; it features flexible configuration and ease of use, and no battery characterization. The charging cradle uses the MAX32655 with a Bluetooth 5.2 module and an internal SIMO power module as the microcontroller. In addition to common communication interfaces, some GPIOs can be configured as a 1-Wire interface to control the DS2488 of the earbuds, providing great convenience for 1-Wire communication and charging. The SWD interface of the charging cradle can be connected to the MAX32625PICO programming platform, which can update the firmware of the MAX32655 of the charging cradle, and also display battery information on the computer through the virtual serial port. Battery information can also be displayed on the OLED screen of the charging cradle.

The earbud uses a single-cell Li-Ion battery of 3.7 V, 130 mAh to power the system, and it uses the DS2488 1-Wire dual-port link to implement the data communication between the earbud and the charging cradle, and at the same time controls the 5 V charging power supply, which comes from the charging cradle. The earbud also uses the MAX32655 microcontroller, which uses the UART interface to simulate 1-Wire timing to read and write the DS2488. The MAX32655 of the earbud similarly uses the SWD interface to connect to the MAX32625PICO programming platform to flash programs. For power rails, the MAX77734 charger of the earbud comes with a 3.3 V LDO output to power the MAX32655 microcontroller. At the same time, the 3.3 V, together with the 1.8 V and 1.2 V power supplies generated by the internal SIMO module of the MAX32655, forms the power rails of the MAX98050 audio codec. The earbud also uses the MAX17262 fuel gauge to monitor the battery.

Figure 2 shows a photo of the design. The actual size of the charging cradle is 10.20 cm × 5.80 cm, and that of the earbud is 10.20 cm × 6.50 cm. Since this is a prototype to assist customers in design, testing, and research, the product size could be further diminished if the test points are simplified, to meet the size requirements of actual TWS earbud applications.

Figure 2. 1-Wire TWS charging cradle and earbud prototype PCBA photo.

1-Wire Data Communication and Power Transfer

In TWS earbud applications, it is very important to realize data communication and power transfer between the charging cradle and the earbud reliably and conveniently. Many common TWS earbuds currently on the market usually use three or more touch points to connect to the charging cradle to exchange messages and transfer power. However, having too many touch points usually contributes to higher system cost, which is extremely detrimental to low cost wearable products. In addition, more touch points usually require larger size, which is contrary to the requirement of TWS earbuds’ small size. Also, more touch points tend to increase the likelihood of system failure. Faced with these difficulties, this design uses ADI’s proprietary 1-Wire dual-link port, the DS2488, which is especially designed for TWS solutions to conduct power transfer and data communication between the earbud and the charging cradle. The DS2488 supports 1-Wire protocol and can exchange data and transfer power by a single wire. Since the system needs an additional touch point to connect the GND of the earbud and that of the charging cradle, the whole solution only needs two touch points, which can significantly improve the reliability and reduce the size and cost of the system. The block diagram of the 1-Wire communication and charging circuit of this design is shown in Figure 3.

Figure 3. Block diagram of 1-Wire communication and charging.

Working Principle of the DS2488

As shown in Figure 3, the DS2488 is the 1-Wire dual-port link with two 1-Wire communication pins, IOA and IOB, which are controlled by the microcontrollers on both sides. The IOA pin is controlled by the microcontroller of the charging cradle, and the IOB pin is controlled by the microcontroller of the earbud. The IOA pin can support input voltage up to 5.5 V, and it can support different communication and charging levels on the 1-Wire bus (IOA). As a 1-Wire device, each DS2488 has a unique 64-bit ROM ID for users to identify and authenticate. The DS2488 also features an internal 8-byte buffer that can be read and written by the microcontroller to update battery information on both sides in real time. In this design, the information stored in the buffer is shown in Table 1.

Table 1. Information Stored in DS2488 Buffer
Index Information
Bit 7 Reserved
Bit 6 Cradle battery CAP (thousands and hundreds place) (mAh)
Bit 5 Cradle battery CAP (tens and ones place) (mAh)
Bit 4 Cradle battery SOC (%)
Bit 3 Right earbud battery CAP (mAh)
Bit 2 Right earbud battery SOC (%)
Bit 1 Left earbud battery CAP (mAh)
Bit 0 Left earbud battery SOC (%)

The TOKEN pin of the DS2488 indicates the control status of the DS2488: TOKEN logic low indicates that the microcontroller on the charging cradle side has obtained the control authority of the DS2488, while TOKEN logic high indicates that the microcontroller on the earbud side has obtained the control authority of the DS2488. The CD/PIOC pin of the DS2488 controls the charging cradle to charge the earbud: when the voltage on the 1-Wire bus (IOA) is lower than 4 V, the CD/PIOC pin is high impedance, so the transistor is off and charging stops. When the voltage on the 1-Wire (IOA) is higher than 4 V, the CD/PIOC pin is logic low. The transistor is on, so the voltage on the 1-Wire bus (IOA) is directly transferred to the charger of the earbud, and charging starts. The MOSFET connected to 5 V determines when to charge and when to communicate. The turn-on and turn-off of the MOSFET is controlled by the microcontroller of the charging cradle. The usage of the earbuds and charging cradle can be roughly divided into the following three cases.

The earbud is in the cradle and the cradle cover is open

In this case, the microcontroller of the charging cradle turns off the MOSFET and obtains the control authority of the DS2488. Under the circumstances, the TOKEN pin is logic low and the CD/PIOC pin is high impedance. The charging cradle reads the 8-byte buffer of the DS2488 through the 1-Wire bus (IOA) to read the earbud battery information and writes the 8-byte buffer to update the cradle battery information. At this time, charging stops and communication starts.

The earbud is in the cradle and the cradle cover is closed

In this case, the microcontroller of the cradle turns on the MOSFET, so 5 V is directly transferred to the earbud through the 1-Wire bus (IOA). Under the circumstances, the TOKEN pin is logic high and the CD/PIOC pin is logic low. The 5 V from the cradle is transferred to the earbud side to charge the earbud battery. Meanwhile, the microcontroller of the earbud obtains the control authority of the DS2488, updates the earbud battery information, and reads the cradle battery information by reading and writing the 8-byte buffer of the DS2488 through the 1-Wire bus (IOB). At this time, communication stops and charging starts.

The earbud is not in the cradle, or the cradle battery is nearly dead

In this case, the 1-Wire bus (IOA) is high impedance, the TOKEN pin is logic high, and the CD/PIOC pin is high impedance. At this time, the microcontroller of the earbud obtains the control authority of the DS2488 and updates the earbud battery information by writing the 8-byte buffer of the DS2488 through the 1-Wire bus (IOB).

DS2488 1-Wire Data Communication

As mentioned, this design uses the DS2488 as a bridge between the microcontrollers on the charging cradle side and the earbud side to realize the message exchange on both sides. The DS2488 supports the typical 1-Wire communication protocol. The protocol includes reset and response timing and read/write timing. The read/write timing includes a write-zero slot, a write-one slot, and a read-data time slot, as shown in Figure 4 and Figure 5. Timing slot duration details are listed in the DS2488 data sheet.

Figure 4. DS2488 1-Wire reset and presence timing.
Figure 5. DS2488 1-Wire read/write timing.

All 1-Wire devices have an internal state machine and its state transition diagram is shown in Figure 6. As shown in Figure 4, when the microcontroller sends a reset signal to the DS2488, the 1-Wire bus will be pulled low for 48 μs to 80 μs, and then the bus will be released to high level by the pull-up resistor. If there is a DS2488 on the bus, the DS2488 will respond to the reset signal and pull the 1-Wire bus low again for 6 μs to 10 μs after the bus is released for 48 μs. At this time, the microcontroller can detect the level change on the bus—that is, determine whether there is a DS2488 connected to the 1-Wire bus by detecting whether the bus is pulled low again.

Figure 6. State transition diagram of 1-Wire devices.

Once the DS2488 has responded to the reset signal, the microcontroller will send a ROM function command. All 1-Wire devices have the same ROM function commands. Some common ROM function commands are summarized in Table 2. In the design, two DS2488s are connected to the 1-Wire bus (IOA) because there are usually two earbuds in the charging cradle. The read ROM command (0x33) and the match ROM command (0x55) are used to read the ROM IDs of the two DS2488s on the 1-Wire bus (IOA) and match the DS2488 with the specific ROM ID to implement the identification and selection of the left earbud or the right earbud.

Table 2. Common 1-Wire ROM Function Commands
ROM Function Command Code Description
Search ROM 0xF0 Read ROM IDs of all devices on the bus
Read ROM 0x33 Read the ROM ID of the only device on the bus
Match ROM 0x55 Select a device with a specific ROM ID
Skip ROM 0xCC Select the only device on the bus

After sending the ROM function command, the microcontroller will send a device function command to perform further control of the device. Different 1-Wire devices have different device function commands. For the DS2488, some common device function commands are summarized in Table 3. This design uses the write buffer (0x33) and the read buffer (0x44) commands to read and write the 8-byte buffer of the DS2488 to realize battery information exchange between the charging cradle and the earbud.

Table 3. Common DS2488 Device Function Commands
Device Function Command Code Description
Write Configuration 0x11 Write the DS2488 configuration
Read Configuration 0x22 Read the DS2488 configuration
Write Buffer 0x33 Write the buffer of the DS2488
Read Buffer 0x44 Read the buffer of the DS2488
Read Status 0x55 Read the status of the DS2488

Two groups of GPIOs (P0.6 and P0.7, P0.18 and P0.19) of the MAX32655 microcontroller of the cradle can be configured as the OWM_IO pin and the OWM_PE pin of the 1-Wire module to realize communication to DS2488 and 5 V transfer, respectively. In this design, the OWM_IO pin of the MAX32655 is connected to the IOA pin of the DS2488 to realize 1-Wire communication function between the microcontroller of the cradle and the DS2488 of the earbud.

Differently, considering that some microcontrollers on the market do not have the 1-Wire interface, for the convenience of design, the MAX32655 microcontroller of the earbud uses the UART interface to simulate 1-Wire timing and communicates with DS2488 through the IOB pin, as shown in Figure 3. The microcontroller can realize this function by configuring a specific UART baud rate and sending a specific code pattern. Taking the reset and presence sequence shown in Figure 4 as an example, when the baud rate is 115200, the duration for the UART to send or receive 1-bit data is about 8.68 μs. Therefore, the duration for 1-byte data is approximately 69.44 μs. Since 0xE0 (11100000, LSB first) exactly corresponds to the 1-Wire reset timing, it can be sent as the 1-Wire reset signal. In this case, if the microcontroller sends 0xE0 (1-Wire reset signal) through the TX pin, the DS2488 on the 1-Wire bus (IOB) will respond to this 1-Wire reset signal and pull the bus low for 6 μs to 10 μs. At this time, the signal received by the RX pin should be 0xC0 (11000000) or 0x80 (10000000). To conclude, the microcontroller can implement the function of simulating 1-Wire timing via UART by sending and receiving different code patterns and comparing the received and sent signals.

DS2488 1-Wire Power Transfer

As shown in Figure 3, the OWM_PE pin of the MAX32655 microcontroller of the cradle controls the turn-on and turn-off of the MOSFET. When the MOSFET is off, the system conducts 1-Wire communication. When the MOSFET is on, the 5 V voltage is transferred to the earbud side through the 1-Wire bus (IOA). As soon as the DS2488 detects 5 V, the CD/PIOC pin will output low level to turn on the transistor to transfer the 5 V to the MAX77734 charger so as to charge the earbud battery.

Battery Management and Power Configuration

The battery management and power configuration system of the charging cradle consists of the MAX77751 USB Type-C charger, the MAX17262 fuel gauge, the MAX17224 boost DC-to-DC converter, and the MAX38640 buck DC-to-DC converter. Generally, the termination voltage of a single-cell Li-Ion battery is 4.2 V, so MAX77751CEFG+ is selected as the specific part number of the charger. Its charging current is configured by the resistors connected to the IFAST pin and the ITOPOFF pin. Considering the design needs, a fast charge current of 500 mA and a top-off current of 100 mA are selected, and the corresponding resistors are 2.4 kΩ and 8.06 kΩ, respectively. The MAX17262 fuel gauge features the ModelGauge m5 EZ algorithm, which can automatically measure the battery after configuring battery parameters such as battery capacity, termination current, and charging voltage threshold, without additional battery characterization. The output voltages of the MAX17224 boost DC-to-DC converter and the MAX38640 buck DC-to-DC converter are respectively configured by resistors connected to the SEL pin and the RSEL pin. In this design, 0 Ω and 56.2 kΩ resistors are selected to output 5 V and 3.3 V respectively.

The battery management and power configuration system of the earbud consists of the MAX77734 charger and the MAX17262 fuel gauge. The output of the MAX32655 microcontroller SIMO module also provides 1.8 V and 1.2 V power rails for the system. Since only one 3.3 V LDO output is needed, the MAX77734GENP+ is selected as the specific part number of the charger. The charger can also be configured to factory-ship state, shutdown state, and standby state through I2C to extend battery life. The MAX32655 microcontroller provides four SIMO outputs, each of which can be configured to output different voltages.

Firmware Design

The flowchart of the charging cradle firmware is shown in Figure 7. After power-on, the microcontroller of the charging cradle will initialize GPIOs and configure the MAX17262 fuel gauge and the OLED module. Then, the microcontroller polls the status of the cradle cover. If the cradle is closed, the microcontroller will disable the 1-Wire module and apply the 5 V charging voltage to the 1-Wire bus (IOA) to charge the earbud. In this case, if the microcontroller detects that the remaining power of the cradle battery is less than 5%, the charging will be stopped. If the cradle is opened, the microcontroller will disable the 5 V charging voltage and enable the 1-Wire module to read and write the DS2488 buffer. Battery information of the cradle and earbud is displayed through an OLED module or the virtual serial port.

Figure 7. Flowchart of cradle firmware.

The flowchart of the earbud firmware is shown in Figure 8. After power-on, the microcontroller of the earbud will initialize GPIOs, and configure the MAX17262 fuel gauge and the MAX77734 charger. Then, the microcontroller polls whether the input voltage from the charger is valid. If the input voltage is valid and greater than 4 V, the microcontroller enables the charger and starts charging. At this time, the microcontroller polls the status of the TOKEN pin. If the TOKEN pin is logic low, the cradle has the control authority to read and write the DS2488. If the TOKEN pin is logic high, the earbud has the control authority to read and write the DS2488. Under the circumstances, the microcontroller writes the earbud battery information into the buffer of the DS2488 for the cradle to read.

Figure 8. Flowchart of earbud firmware.

Test Result

The design requirements and test results of the power rail of the cradle and earbud are shown in Table 4 and Table 5. This design can meet the system design requirement.

Table 4. Design Requirements and Test Results of the Cradle Power Rail
Parameter Symbol Measured Value Design Requirement
Battery Voltage BAT 4.08 V 3.1 V to 4.6 V
USB Input Voltage CHGIN 4.94 V 4.8 V to 5.2 V
5 V Output of the Boost Module 5 V 5.16 V 4.8 V to 5.2 V
3.3 V Output of the Buck Module 3V3 3.30 V 3.2 V to 3.4 V
Table 5. Design Requirements and Test Results of the Earbud Power Rail
Parameter Symbol Measured Value Design Requirement
Battery Voltage VBAT 3.71 V 3.3 V to 4.6 V
3.3 V Output of the Charger VCC_3.3 3.32 V 3.2 V to 3.4 V
1.8 V Output of the Microcontroller VCC_1.8 1.82 V 1.7 V to 1.9 V
1.2 V Output of the Microcontroller VCC_1.2 1.12 V 1.1 V to 1.3 V

The test results for the open cradle and closed cradle are shown in Figure 9 and Figure 10, respectively. This design can display the information of the cradle battery and earbud battery in real time, and read and display the ROM ID of the DS2488 of the earbud.

Figure 9. Test result for closed cradle.
Figure 10. Test result for open cradle.

Conclusion

Prototyping TWS earbud solutions is a challenge that requires the balance between ease of use, low cost, portability, and stability. The DS2488 1-Wire dual-port link paves the way for low power, high stability, high performance TWS earbud solutions in smaller form factor and at a lower cost. Building on the DS2488, the MAXREFDES1302, including hardware design and firmware design, is an easy to use TWS earbud prototype that is capable of power transfer and data communication through only two touch points.

Ссылки

Fang, Liang and Ning Jia. “MAXIM PLC Technology-Based TWS Solution.” Electronic Engineering & Product World, May 2021.

MAX32655 User Guide. Maxim Integrated, March 2021.

Об авторах

Yi Xin

Yi Xin

Yi Xin is a member of the technical staff at Analog Devices and is responsible for support and application of healthcare biosensor products. He graduated from Fudan University and the Chinese University of Hong Kong, with a Bachelor of Science in electronic information science and technology and a Master of Science in electronic engineering, respectively. Yi joined Maxim Integrated (now part of Analog Devices) in 2018.