A UART serial port and 1-wire interface conversion circuit
By implementing power supply voltage conversion, signal protocol conversion, and a strong pull-up circuit, the problem of inconvenient conversion between UART serial port and 1-Wire interface is solved, achieving high reliability and flexible interface conversion. It supports the conversion between RS232/RS422 and 1-Wire bus, reducing costs and achieving localization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EAST CHINA INST OF OPTOELECTRONICS INTEGRATEDDEVICE
- Filing Date
- 2025-09-22
- Publication Date
- 2026-06-26
AI Technical Summary
The conversion between UART serial port and 1-Wire interface in the existing technology is inconvenient, especially the signal time slot setting of 1-Wire bus protocol is not accurate enough, resulting in insufficient transmission reliability.
The system employs a power supply voltage conversion circuit, a microcontroller UART to 1-Wire signal conversion circuit, a 1-Wire signal level conversion circuit, a strong pull-up circuit, and an ESD protection circuit to achieve the conversion between the UART serial port and the 1-Wire bus interface. The microcontroller performs signal protocol conversion and level conversion, and the combination of strong pull-up and ESD protection improves the reliability of signal transmission.
It enables flexible conversion between UART serial port and 1-Wire bus interface, reduces the complexity of host/motherboard, improves the transmission reliability of 1-Wire bus signal, supports conversion requirements of different interfaces, and realizes the replacement of imported components with domestically produced ones.
Smart Images

Figure CN121301251B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a UART serial port to 1-Wire interface conversion circuit. Background Technology
[0002] Application No. 202411502465.7 discloses a communication method and apparatus based on UART and 1-WIRE bus. The UART terminal has a TX pin and is connected to the 1-WIRE terminal. The communication method includes: enabling the 1-WIRE host mode on the UART terminal; sending a reset pulse to the 1-WIRE terminal and then receiving an acknowledgment pulse; comparing the acknowledgment pulse and the reset pulse on the UART terminal to determine whether to perform data transmission or reception; and sending or receiving data to the 1-WIRE terminal only when it is determined that data transmission or reception is required. Using this invention eliminates the need to configure a corresponding 1-WIRE bus interface on the host, avoiding increased costs, and enabling bus communication based on the 1-WIRE protocol even without configuring a 1-WIRE bus interface.
[0003] However, this invention only describes a communication method that uses the TX pin of the UART end to directly connect to the 1-WIRE device, and does not realize the conversion between the UART serial port and the 1-Wire interface. Furthermore, it uses the TX pin of the UART end as the 1-WIRE bus method. The signal time slot setting of the 1-WIRE bus protocol needs to be based on the corresponding baud rate, and sometimes the baud rate needs to be switched, so it is not convenient to accurately set the time slot. Summary of the Invention
[0004] The purpose of this invention is to overcome the defects in the existing technology and provide a UART serial port to 1-Wire bus interface conversion circuit to realize the conversion function of UART (TTL) serial port to 1-Wire bus interface, so that the 1-Wire bus signal has high transmission reliability.
[0005] The technical solution adopted in this invention is as follows:
[0006] A UART serial port to 1-Wire interface conversion circuit mainly consists of a power supply voltage conversion circuit unit, a microcontroller UART to 1-Wire signal conversion circuit unit, a 1-Wire signal level conversion circuit unit, a strong pull-up circuit unit, and an ESD protection circuit unit.
[0007] The power supply voltage conversion circuit unit provides a 3.3V output voltage to power the microcontroller;
[0008] A microcontroller is used as a UART to 1-Wire signal conversion circuit unit to perform protocol conversion between the microcontroller's UART serial port signal and the 1-Wire bus signal of IO port 1;
[0009] The 1-Wire signal level conversion circuit unit performs bidirectional conversion of arbitrary levels between the front-end 1-Wire (VCC2) signal and the back-end 1-Wire (VCC) signal;
[0010] The input of the strong pull-up circuit unit is connected to the microcontroller's I / O port 2, and the output is connected to the back end of the 1-Wire signal level conversion circuit unit, thereby controlling the strong and weak pull-up of the 1-Wire signal;
[0011] The front end of the ESD protection circuit unit is connected to the back end of the 1-Wire signal level conversion circuit unit to provide ESD protection for the 1-Wire signal terminal. One back end of the ESD protection circuit unit serves as the 1-Wire bus signal communication terminal for the load device, and the other back end is connected to the 1-Wire bus ground.
[0012] Based on the above technical solutions, the following further technical solutions are proposed:
[0013] The 1-Wire signal level conversion circuit unit consists of an NMOS transistor V1, resistors R1 and R2. The source of the NMOS transistor V1 and one end of the resistor R1 are connected to the microcontroller's I / O port 1. The other end of the resistor R1 is connected to the power supply voltage conversion circuit unit's output power supply VCC2 and the gate of the NMOS transistor V1. The drain of the NMOS transistor V1 is connected to one end of the resistor R2, and the other end of the resistor R2 is connected to the power supply input voltage VCC.
[0014] The strong pull-up circuit unit consists of a PMOS transistor V2, an NMOS transistor V3, a resistor R3, and a resistor R4. The gate of the NMOS transistor V3 is connected to one end of the resistor R3, and its source is grounded. The other end of the resistor R3 is connected to the IO port 2 of the microcontroller. The drain of the NMOS transistor V3 is connected to one end of the resistor R4 and the gate of the PMOS transistor V2. The other end of the resistor R4 and the source of the PMOS transistor V2 are connected to the input VCC of the power supply voltage conversion circuit unit. The drain of the PMOS transistor V2 is connected to the back end of the 1-Wire signal level conversion circuit unit.
[0015] The ESD protection circuit unit consists of resistors R5, R6, R7, R8, capacitor C1, and bidirectional TVS diode V4.
[0016] Resistors R5 and R6 are connected in series. The non-connection end of resistor R5 and one end of capacitor C1 are connected to the back end of the 1-Wire signal level conversion circuit unit. The non-connection end of resistor R6 serves as the 1-Wire bus signal communication end for the load device.
[0017] Resistors R7 and R8 are connected in series, with the non-connected end of resistor R7 and the other end of capacitor C1 grounded, and the non-connected end of resistor R8 connected to the 1-Wire bus ground.
[0018] The series terminals of resistors R5 and R6 and the series terminals of resistors R7 and R8 are connected to bidirectional TVS diode V4.
[0019] Because of the adoption of the above technical solution, the present invention has the following advantages:
[0020] 1) The circuit can flexibly provide the power supply voltage VCC according to the voltage requirements of the 1-Wire bus load;
[0021] 2) Convenient application: The front-end host / motherboard can operate the 1-Wire bus load only through UART serial port communication, avoiding the cumbersome processing of 1-Wire signals by the host / motherboard.
[0022] 3) By using common domestic microcontrollers, linear regulators or buck power supplies, NMOS transistors, PMOS transistors, TVS transistors, resistors and capacitors, the conversion function between UART (TTL) serial port and 1-Wire interface is realized, thereby replacing the imported device DS2480B (serial to 1-Wire bus driver, mainly used to convert RS-232 / UART interface to 1-Wire protocol) with domestic functionality;
[0023] 4) The reliability of 1-Wire bus signal transmission is improved through strong pull-up design and ESD protection.
[0024] 5) An RS232 transceiver or RS422 transceiver can be connected to the UART (TTL) serial port to achieve the conversion between RS232 serial port / RS232 serial port and 1-Wire bus interface, so as to meet the different interface conversion requirements of the host / motherboard. Attached Figure Description
[0025] Figure 1 This is a block diagram of the hardware system composition structure of the present invention;
[0026] Figure 2 This is a timing diagram of the 1-Wire bus reset pulse / on-line response detection sequence;
[0027] Figure 3 This is a schematic diagram of the write 1-slot and read data slots on a 1-Wire bus;
[0028] Figure 4 This is a schematic diagram of the 1-Wire bus write-0 time slot;
[0029] Figure 5This is a schematic diagram of a 1-Wire bus strong pull-up time slot;
[0030] Figure 6 This is a schematic diagram of a 1-Wire signal level conversion circuit unit.
[0031] Figure 7 This is a schematic diagram of a strong pull-up circuit unit.
[0032] Figure 8 This is a schematic diagram of the ESD protection circuit unit. Detailed Implementation
[0033] The hardware block diagram of a UART serial port to 1-Wire interface conversion circuit is shown in Figure 1. It mainly consists of a power supply voltage conversion circuit unit, a microcontroller UART to 1-Wire signal conversion circuit unit, a 1-Wire signal level conversion circuit unit, a strong pull-up circuit unit, and an ESD protection circuit unit. The power supply voltage conversion circuit unit provides a 3.3V output voltage to power the microcontroller. Using the microcontroller as the UART to 1-Wire signal conversion circuit unit, it performs protocol conversion between the microcontroller's UART serial port signal and the 1-Wire signal of I / O port 1. The 1-Wire signal level conversion circuit unit... It performs bidirectional level conversion between the front-end 1-Wire (VCC2) signal and the back-end 1-Wire (VCC) signal; the input of the strong pull-up circuit unit is connected to the microcontroller IO port 2, and the output is connected to the back end of the 1-Wire signal level conversion circuit unit, thereby controlling the strong and weak pull-up of the 1-Wire signal; the ESD protection circuit unit is connected to the back end of the 1-Wire signal level conversion circuit unit to provide ESD protection for the 1-Wire signal terminal. One back end of the ESD protection circuit unit serves as the 1-Wire bus signal communication terminal for the load device, and the other back end is connected to the 1-Wire bus ground.
[0034] First, the voltage conversion circuit unit provides VCC2 (3.3V) output voltage to power the microcontroller, and uses the microcontroller's I / O port 1 as the 1-Wire (VCC2) signal port to perform UART (TTL) signal and 1-Wire signal protocol conversion through the microcontroller; the 1-Wire signal level conversion circuit unit converts the 1-Wire (VCC2) signal with a high level of VCC2 (3.3V) and the 1-Wire (VCC) signal with a high level of VCC to each other; the strong pull-up circuit unit controls the strong and weak pull-up of the 1-Wire signal through the microcontroller's I / O port 2; the ESD protection circuit unit provides ESD protection for the 1-Wire signal terminal.
[0035] The design process of each functional circuit is described in detail below.
[0036] (1) Power supply voltage conversion circuit unit
[0037] The circuit uses a single power supply VCC. Through a linear regulator or a step-down power supply, it outputs a 3.3V power supply voltage VCC2 to power subsequent circuit units such as the microcontroller.
[0038] (2) Microcontroller UART and 1-Wire signal conversion circuit unit
[0039] like Figure 1 As shown, the UART pins TX and RX of the microcontroller (such as XXX32F103) are used as the UART (TTL) serial communication ports of the front-end host / motherboard; microcontroller I / O port 1 is used as a 1-Wire signal port, set to open-drain mode, which can collect the signal level of the 1-Wire bus load feedback while outputting the signal, thereby realizing single-wire communication of the 1-Wire bus; microcontroller I / O port 2 is used as a strong pull-up control port, set to push-pull output mode; according to the DS2480B working timing requirements, the conversion between UART serial port signals and 1-Wire bus signal protocols is implemented through microcontroller code.
[0040] When the microcontroller converts UART signals to 1-Wire bus signals, the 1-Wire bus mainly includes three operations based on the command code received at the RX terminal of the UART: 1-Wire bus reset / presence detection, 1-Wire bus write 1 and read data, write 0, and 1-Wire bus strong pull-up.
[0041] a) 1-Wire bus reset / online response detection
[0042] The timing sequence of the 1-Wire bus reset pulse / on-line response detection sequence is as follows: Figure 2 shown (Note: Figure 2 In the 1-Wire bus, the high level is VCC, which is the 1-Wire (VCC2) signal from the microcontroller's I / O port 1 after passing through the 1-Wire signal level conversion circuit. This sequence consists of four parts: the reset low level time t RSTL Short circuit / interrupt sampling offset time t SI Response detection sampling offset time t PDT and delay time t FILL . t SI t PDT and t FILL This constitutes the reset high-level time t RSTH During this period, the 1-Wire slave device sends an acknowledge signal or an interrupt pulse. This reset high-level time t... RSTH During this period, the circuit uses a weak pull-up resistor to pull the 1-Wire bus high (see weak pull-up resistor details). Figure 6 (R2).
[0043] When the microcontroller's UART RX input receives a command code (such as C1h) to generate a reset pulse / on-line response detection sequence, it pulls the 1-Wire bus low for a continuous period of time. RSTL Released after a certain time, returning to VCC. The microcontroller then waits for the short-circuit / interrupt sampling offset time t. SI End, to detect the voltage of the 1-Wire bus to determine if a short circuit or interrupt signal exists (a low level indicates a short circuit or interrupt signal; a high level indicates no short circuit or interrupt signal). If there is no short circuit or interrupt (e.g. Figure 2 (As shown) signal, the microcontroller waits for t PDT When the timer expires, the microcontroller checks the voltage on the 1-Wire bus to detect the presence of an acknowledgment pulse: a low level indicates an acknowledgment pulse, meaning a load device is connected to the 1-Wire bus; a high level indicates no acknowledgment pulse, meaning no load device is connected to the 1-Wire bus. Regardless of the acknowledgment detection result, the microcontroller waits for t... FILL After the time expires, the UART's TX output sends a command response byte to the host / motherboard (e.g., CDh is returned when there is a load on the 1-Wire bus, and CFh is returned when there is no load on the 1-Wire bus).
[0044] b) 1-Wire bus write 1 time slot, read data time slot, write 0 time slot
[0045] When the microcontroller's UART RX input receives a general command code, the microcontroller will transmit the command code via a method such as... Figure 3 The 1-Wire bus write 1 time slot and read data time slot shown are... Figure 4 The write 0 time slot shown is converted into a 1-Wire bus protocol signal to communicate with the 1-Wire bus load device, and the corresponding response data is sent to the host / motherboard via the TX output of the UART. (Note:) Figure 3 , Figure 4 In this context, the high level of the 1-Wire bus signal is VCC, which is the 1-Wire (VCC) signal after the 1-Wire signal level conversion circuit unit passes through the 1-Wire signal level conversion circuit unit from the 1-Wire (VCC2) signal at the microcontroller's I / O port 1.
[0046] A write 1 time slot and a read data time slot are determined by t LOW1 t DSO and t HIGH1 Composition. In the write 1 time slot, when the write 1 low level duration t LOW1 After completion, the microcontroller waits for the data sampling offset time, then samples the voltage on the 1-Wire bus to read the slave device's response. After this, it must wait for t... HIGH1Time, until the end of the first time slot.
[0047] A write-0 time slot is only composed of t LOW0 and t REC0 constitute.
[0048] c) Strong pull-up on 1-Wire bus
[0049] A schematic diagram of the 1-Wire bus strong pull-up time slot is shown below. Figure 5 As shown, according to the needs of the front-end host, during certain communication periods, the 1-Wire (VCC) terminal is connected to VCC through a strong pull-up circuit unit via the control of the microcontroller's IO port 2.
[0050] When the microcontroller's UART RX pin receives a strong pull-up command code (such as EFh), the I / O port 2 control signal switches to the strong pull-up enabled state, activating the strong pull-up on the 1-Wire (VCC) pin through the strong pull-up circuit unit. When the microcontroller's UART RX pin receives a command code (such as F1h, EDh), the I / O port 2 control signal switches to the strong pull-up terminated state, releasing the strong pull-up on the 1-Wire (VCC) pin through the strong pull-up circuit unit, restoring it to a weak pull-up state (see weak pull-up resistor). Figure 6 (R2).
[0051] (3) 1-Wire signal level conversion circuit unit
[0052] The schematic diagram of the 1-Wire signal level conversion circuit unit is shown below. Figure 6 As shown, it consists of an NMOS transistor V1, resistors R1 and R2. The source of the NMOS transistor V1 and one end of the resistor R1 are connected to the microcontroller's I / O port 1. The other end of the resistor R1 is connected to the power supply voltage conversion circuit unit's output power supply VCC2 and the gate of the NMOS transistor V1. The drain of the NMOS transistor V1 is connected to one end of the resistor R2, and the other end of the resistor R2 is connected to the power supply input voltage VCC.
[0053] The 1-Wire signal level conversion circuit unit realizes bidirectional conversion between any level of different high-level 1-Wire signals 1-Wire(VCC2) and 1-Wire(VCC): 1-Wire(VCC2) is the 1-Wire signal at the microcontroller IO port 1, with its high level being VCC2 and its low level being GND; 1-Wire(VCC) is the 1-Wire signal with high level VCC and low level GND.
[0054] a) When 1-Wire(VCC2) is the input and 1-Wire(VCC) is the output:
[0055] When 1-Wire (VCC2) is high (the voltage at the open-drain output of microcontroller I / O port 1 is pulled up to VCC2 by R1), the gate-source voltage V of NMOS transistor V1 is... 1GS =0V<gate-source threshold voltage V 1GS(th) Therefore, V1 is in the off state, so the 1-Wire (VCC) voltage is V. CC ;
[0056] When 1-Wire (VCC2) is low, the gate-source voltage V of NMOS transistor V1 is... 1GS =V CC2 > Gate-source threshold voltage V 1GS(th) V1 is in the ON state, so the 1-Wire (VCC) voltage is low.
[0057] b) When 1-Wire (VCC) is the input and 1-Wire (VCC2) is the output:
[0058] When 1-Wire (VCC) is high, NMOS transistor V1 is off, therefore the voltage of 1-Wire (VCC2) is pulled up by R1 to voltage V. CC2 ;
[0059] When 1-Wire (VCC2) is low, the source terminal of NMOS transistor V1 is pulled low due to the presence of the body diode, thus turning V1 on. Therefore, the voltage of 1-Wire (VCC2) is pulled low.
[0060] (4) Strong pull-up circuit unit
[0061] The strong pull-up circuit unit consists of PMOS transistor V2, NMOS transistor V3, resistor R3, and resistor R4. The gate of NMOS transistor V3 is connected to one end of resistor R3, and its source is grounded. The other end of resistor R3 is connected to the microcontroller's I / O port 2. The drain of NMOS transistor V3 is connected to both one end of resistor R4 and the gate of PMOS transistor V2. The other end of resistor R4 and the source of PMOS transistor V2 are connected to the input VCC of the power supply voltage conversion circuit unit. The drain of PMOS transistor V2 is connected to the back end of the 1-Wire signal level conversion circuit unit.
[0062] Because the load impedance changes constantly during communication operations on the 1-Wire bus, a strong pull-up circuit unit is designed to ensure reliable network operation. The microcontroller outputs the SUP signal through I / O port 2 to control the strong pull-up of the 1-Wire (VCC). The schematic diagram is shown below. Figure 7 As shown.
[0063] When the microcontroller's I / O port 2 output signal SUP is high (strong pull-up for startup), the gate-source voltage of NMOS transistor V3 is V.3GS =V CC2 > Gate-source threshold voltage V 3GS(th) V3 is in the ON state; at this time, the gate of PMOS transistor V2 is V 2G =0V, its gate-source voltage V 2GS(th) =-V CC V2 is in the ON state, therefore the 1-Wire (VCC) voltage is directly connected to the power supply voltage V. CC This enables strong pull-up and avoids the impact of low high-level signal on the reliability of 1-Wire (VCC) signal transmission.
[0064] When the microcontroller's I / O port 2 output signal SUP is low (strong pull-up is released), the gate-source voltage of NMOS transistor V3 is V. 3GS =0 < gate-source threshold voltage V 3GS(th) V3 is in the off state; at this time, the gate of PMOS transistor V2 is V 2G =V CC Its gate-source voltage V 2GS(th) =0V, V2 is in the off state, therefore 1-Wire(VCC) is the communication signal of R2 in the weak pull-up state.
[0065] (5) ESD protection circuit unit
[0066] The schematic diagram of the ESD protection circuit unit is shown below. Figure 8 As shown, the ESD protection circuit unit consists of resistors R5, R6, R7, R8, capacitor C1, and bidirectional TVS diode V4. Resistors R5 and R6 are connected in series, with the non-connected end of resistor R5 and one end of capacitor C1 connected to the back end of the 1-Wire signal level conversion circuit unit. The non-connected end of resistor R6 serves as the 1-Wire bus signal communication terminal for the load device. Resistors R7 and R8 are connected in series, with the non-connected end of resistor R7 and the other end of capacitor C1 grounded. The non-connected end of resistor R8 is connected to the 1-Wire bus ground. The series terminals of resistors R5 and R6 and R7 and R8 are connected to the bidirectional TVS diode V4.
[0067] It consists of a bidirectional TVS diode V4, series resistors R5-R8, and a capacitor. The TVS diode absorbs external surge voltages at the 1-Wire signal terminal; the series resistors limit current, isolate, and slow down the signal rise time; and the capacitor filters the 1-Wire signal to reduce peak voltage. Through the TVS diode, series resistors, and capacitor, a comprehensive ESD protection effect is achieved, improving the circuit's electromagnetic compatibility and effectively enhancing the reliability of 1-Wire bus signal transmission.
Claims
1. A UART serial port to 1-Wire interface conversion circuit, characterized in that... It mainly consists of a power supply voltage conversion circuit unit, a microcontroller UART and 1-Wire signal conversion circuit unit, a 1-Wire signal level conversion circuit unit, a strong pull-up circuit unit, and an ESD protection circuit unit; The power supply voltage conversion circuit unit provides a 3.3V output voltage to power the microcontroller; The microcontroller serves as a UART to 1-Wire signal conversion circuit unit, performing protocol conversion between the microcontroller's UART serial port signals and the 1-Wire bus signals of I / O port 1; The 1-Wire signal level conversion circuit unit performs bidirectional conversion of arbitrary levels between the front-end 1-Wire-VCC2 signal and the back-end 1-Wire-VCC signal; The input of the strong pull-up circuit unit is connected to the microcontroller's IO port 2, and the output is connected to the 1-Wire-VCC signal terminal of the 1-Wire signal level conversion circuit unit, thereby controlling the strong pull-up of the 1-Wire signal. The front end of the ESD protection circuit unit is connected to the back end of the 1-Wire signal level conversion circuit unit to provide ESD protection for the 1-Wire signal terminal. One back end of the ESD protection circuit unit serves as the 1-Wire bus signal communication terminal for the load device, and the other back end is connected to the 1-Wire bus ground. The 1-Wire signal level conversion circuit unit consists of an NMOS transistor V1, resistors R1 and R2. The source of the NMOS transistor V1 and one end of the resistor R1 are connected to the microcontroller's I / O port 1. The other end of the resistor R1 is connected to the power supply voltage conversion circuit unit's output power supply VCC2 and the gate of the NMOS transistor V1. The drain of the NMOS transistor V1 is connected to one end of the resistor R2, and the other end of the resistor R2 is connected to the power supply input voltage VCC.
2. The UART serial port to 1-Wire interface conversion circuit according to claim 1, characterized in that... The strong pull-up circuit unit consists of a PMOS transistor V2, an NMOS transistor V3, a resistor R3, and a resistor R4. The gate of the NMOS transistor V3 is connected to one end of the resistor R3, and its source is grounded. The other end of the resistor R3 is connected to the IO port 2 of the microcontroller. The drain of the NMOS transistor V3 is connected to one end of the resistor R4 and the gate of the PMOS transistor V2. The other end of the resistor R4 and the source of the PMOS transistor V2 are connected to the input VCC of the power supply voltage conversion circuit unit. The drain of the PMOS transistor V2 is connected to the 1-Wire-VCC signal terminal of the 1-Wire signal level conversion circuit unit.
3. The UART serial port to 1-Wire interface conversion circuit according to claim 2, characterized in that: The ESD protection circuit unit consists of resistors R5, R6, R7, R8, capacitor C1, and bidirectional TVS diode V4. Resistors R5 and R6 are connected in series. The non-connection end of resistor R5 and one end of capacitor C1 are connected to the 1-Wire-VCC signal terminal of the 1-Wire signal level conversion circuit unit. The non-connection end of resistor R6 serves as the 1-Wire bus signal communication terminal for the load device. Resistors R7 and R8 are connected in series, with the non-connected end of resistor R7 and the other end of capacitor C1 grounded, and the non-connected end of resistor R8 connected to the 1-Wire bus ground. The series terminals of resistors R5 and R6 and the series terminals of resistors R7 and R8 are connected to bidirectional TVS diode V4.
Citation Information
Patent Citations
Communication method and device based on UART and 1-WIRE bus
CN119576827A
Method and system for controlling unibus equipment
CN101727422A
Power clamp ESD protection circuit
CN108306271A