CN102098035B - Analog switch control circuit and mobile phone - Google Patents

Analog switch control circuit and mobile phone Download PDF

Info

Publication number
CN102098035B
CN102098035B CN2010105724730A CN201010572473A CN102098035B CN 102098035 B CN102098035 B CN 102098035B CN 2010105724730 A CN2010105724730 A CN 2010105724730A CN 201010572473 A CN201010572473 A CN 201010572473A CN 102098035 B CN102098035 B CN 102098035B
Authority
CN
China
Prior art keywords
analog switch
resistor
mobile phone
pin
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2010105724730A
Other languages
Chinese (zh)
Other versions
CN102098035A (en
Inventor
刘科
李坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Heze Enze Building Materials Co ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN2010105724730A priority Critical patent/CN102098035B/en
Publication of CN102098035A publication Critical patent/CN102098035A/en
Application granted granted Critical
Publication of CN102098035B publication Critical patent/CN102098035B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephone Function (AREA)

Abstract

本发明涉及移动终端领域,公开了一种模拟开关控制电路及手机。本发明所提供的模拟开关控制电路及手机,由于采用所述MicroUSB接口的第2脚、第3脚与所述模拟开关的输出端连接,其第1脚通过一分压电路连接至模拟开关的控制端,其合理地利用了USB线所带的电源电压,用硬件的方式控制模拟开关,较常规的软件控制GPIO的方法,更加快速,简单有效,不占用GPIO口资源。

The invention relates to the field of mobile terminals, and discloses an analog switch control circuit and a mobile phone. In the analog switch control circuit and the mobile phone provided by the present invention, since the second pin and the third pin of the MicroUSB interface are connected to the output end of the analog switch, the first pin is connected to the analog switch through a voltage divider circuit. The control terminal makes reasonable use of the power supply voltage of the USB cable and controls the analog switch by hardware. Compared with the conventional software control GPIO method, it is faster, simpler and more effective, and does not occupy GPIO port resources.

Description

一种模拟开关控制电路及手机An analog switch control circuit and mobile phone

技术领域 technical field

本发明涉及移动终端领域,尤其涉及的是一种模拟开关控制电路及手机。 The invention relates to the field of mobile terminals, in particular to an analog switch control circuit and a mobile phone.

背景技术 Background technique

随着电子技术的发展和人们生活水平的不断提高,各种电子设备的使用越来越普及。 With the development of electronic technology and the continuous improvement of people's living standards, the use of various electronic devices is becoming more and more popular.

而模拟开关在各种电子产品中得到广泛的运用,将多组相互独立的信号通道共用于一个接口,通过切换开关使各组信号根据用户的需求灵活转换而又不相互影响。 The analog switch is widely used in various electronic products. Multiple sets of mutually independent signal channels are used in one interface, and each set of signals can be flexibly converted according to the needs of users without mutual influence by switching the switch.

现有技术一般是用软件方式控制通用输入输出口(GPIO)来切换模拟开关的信道的。这种控制方式比较简单灵活,但在某些特殊场合会带来一些问题。例如,在电子设备如手机关机情况下与主机连接,软件控制容易出错。 In the prior art, a general purpose input and output (GPIO) is generally controlled by software to switch channels of an analog switch. This control method is relatively simple and flexible, but it will cause some problems in some special occasions. For example, when an electronic device such as a mobile phone is turned off and connected to a host computer, software control is prone to errors.

因此,现有技术还有待于改进和发展。 Therefore, the prior art still needs to be improved and developed.

发明内容 Contents of the invention

本发明要解决的技术问题在于,针对现有技术的上述缺陷,提供一种模拟开关控制电路及手机,其可以快速控制模拟开关进行切换,并且结构简单,不易出错。 The technical problem to be solved by the present invention is to provide an analog switch control circuit and a mobile phone for the above-mentioned defects of the prior art, which can quickly control the analog switch for switching, and has a simple structure and is not easy to make mistakes.

本发明解决技术问题所采用的技术方案如下: The technical solution adopted by the present invention to solve technical problems is as follows:

一种模拟开关控制电路,包括Micro USB接口,及与Micro USB接口通讯连接的模拟开关,其中,所述Micro USB接口的第2脚、第3脚与所述模拟开关的输出端连接,Micro USB接口的第1脚通过一分压电路连接至所述模拟开关的控制端。 An analog switch control circuit, comprising a Micro USB interface, and an analog switch communicated with the Micro USB interface, wherein the second pin and the third pin of the Micro USB interface are connected to the output end of the analog switch, and the Micro USB The first pin of the interface is connected to the control terminal of the analog switch through a voltage divider circuit.

所述的模拟开关控制电路,其中,所述分压电路包括第一电阻和第二电阻,第一电阻的一端连接至所述Micro USB接口的第1脚,第一电阻的另一端连接至所述模拟开关的控制端,所述第一电阻的另一端还通过第二电阻连接参考地。 The analog switch control circuit, wherein the voltage divider circuit includes a first resistor and a second resistor, one end of the first resistor is connected to the first pin of the Micro USB interface, and the other end of the first resistor is connected to the The control end of the analog switch, the other end of the first resistor is also connected to the reference ground through the second resistor.

所述的模拟开关控制电路,其中,所述模拟开关为单刀双掷模拟开关,用于将两组相互独立的信号通道共用于一个接口,所述单刀双掷模拟开关包括第一对输入端和第二对输入端。 The analog switch control circuit, wherein the analog switch is a single-pole double-throw analog switch, which is used to share two sets of mutually independent signal channels for one interface, and the single-pole double-throw analog switch includes a first pair of input terminals and The second pair of inputs.

所述的模拟开关控制电路,其中,所述第一电阻的阻值为36K欧姆,所述第二电阻的阻值为24K欧姆。 In the analog switch control circuit, the resistance of the first resistor is 36K ohms, and the resistance of the second resistor is 24K ohms.

一种手机,包括一手机本体,设置在手机本体内的电路板,及设置在所述电路板上的模拟开关控制电路,其中,所述模拟开关控制电路包括一Micro USB接口,及一模拟开关,所述Micro USB接口的第2脚、第3脚与所述模拟开关的输出端连接,Micro USB接口的第1脚通过一分压电路连接至所述模拟开关的控制端。 A mobile phone, comprising a mobile phone body, a circuit board arranged in the mobile phone body, and an analog switch control circuit arranged on the circuit board, wherein the analog switch control circuit includes a Micro USB interface, and an analog switch , the second pin and the third pin of the Micro USB interface are connected to the output end of the analog switch, and the first pin of the Micro USB interface is connected to the control end of the analog switch through a voltage divider circuit.

所述的手机,其中,所述分压电路包括第一电阻和第二电阻,第一电阻的一端连接至所述Micro USB接口的第1脚,第一电阻的另一端连接至所述模拟开关的控制端,所述第一电阻的另一端还通过第二电阻连接参考地。 The mobile phone, wherein the voltage divider circuit includes a first resistor and a second resistor, one end of the first resistor is connected to the first pin of the Micro USB interface, and the other end of the first resistor is connected to the analog switch the control terminal of the first resistor, and the other terminal of the first resistor is also connected to the reference ground through the second resistor.

所述的手机,其中,所述模拟开关为单刀双掷模拟开关,用于将两组相互独立的信号通道共用于一个接口,所述单刀双掷模拟开关包括第一对输入端和第二对输入端。 The mobile phone, wherein the analog switch is a single-pole double-throw analog switch, which is used to share two sets of mutually independent signal channels on one interface, and the single-pole double-throw analog switch includes a first pair of input terminals and a second pair of input.

所述的手机,其中,在所述电路板上还设置有USB数据收发电路和手机应用程序下载电路,所述手机应用程序下载电路与所述单刀双掷模拟开关的第一对输入端连接,所述USB数据收发电路与所述单刀双掷模拟开关的第二对输入端连接。 The mobile phone, wherein a USB data transceiver circuit and a mobile phone application program download circuit are also arranged on the circuit board, and the mobile phone application program download circuit is connected to the first pair of input terminals of the single-pole double-throw analog switch, The USB data transceiving circuit is connected to the second pair of input terminals of the SPDT analog switch.

所述的手机,其特征在于,所述第一电阻的阻值为36K欧姆,所述第二电阻的阻值为24K欧姆。 The mobile phone is characterized in that the resistance of the first resistor is 36K ohms, and the resistance of the second resistor is 24K ohms.

本发明所提供的一种模拟开关控制电路及手机,由于采用所述Micro USB接口的第2脚、第3脚与所述模拟开关的输出端连接,其第1脚通过一分压电路连接至所述模拟开关的控制端,其合理地利用了USB线所带的电源电压,用硬件的方式控制模拟开关,较常规的软件控制GPIO的方法,更加快速,简单有效,不占用GPIO口资源。 A kind of analog switch control circuit provided by the present invention and mobile phone, owing to adopt the 2nd pin of described Micro USB interface, the 3rd pin is connected with the output end of described analog switch, its 1st pin is connected to by a voltage divider circuit The control end of the analog switch rationally utilizes the power supply voltage carried by the USB line to control the analog switch in a hardware manner, which is faster, simpler and more effective than the conventional software control GPIO method, and does not occupy GPIO port resources.

附图说明 Description of drawings

图1是Micro USB接口及其模拟开关电路简化图。 Figure 1 is a simplified diagram of the Micro USB interface and its analog switch circuit.

图2是软件GPIO控制模拟开关时USB握手时序图。 Figure 2 is a USB handshake timing diagram when the software GPIO controls the analog switch.

图3是本发明实施例的模拟开关控制电路图。 Fig. 3 is a diagram of an analog switch control circuit according to an embodiment of the present invention.

图4是本发明实施例的手机外观结构示意图。 Fig. 4 is a schematic diagram of the appearance and structure of the mobile phone according to the embodiment of the present invention.

图5是本发明实施例的手机电路结构示意图。 Fig. 5 is a schematic diagram of the circuit structure of the mobile phone according to the embodiment of the present invention.

图6是本发明实施例的硬件电路控制模拟开关时USB握手时序图。 FIG. 6 is a timing diagram of USB handshake when the hardware circuit controls the analog switch according to the embodiment of the present invention.

具体实施方式 Detailed ways

本发明所提供的一种模拟开关控制电路及手机,为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。 An analog switch control circuit and a mobile phone provided by the present invention, in order to make the purpose, technical solution and advantages of the present invention clearer and clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

以某款带USB功能的MTK平台手机为例,Micro USB接口及其模拟开关电路简化图如图1所示。图中模拟开关采用单刀双掷模拟开关110,其单刀双掷模拟开关110的电源端VCC连接工作电源VBAT,GND端接参考地。Micro USB(微型USB)接口100已经逐渐成为一种接口标准,它的1脚电源和5脚地作为充电器或USB电源充电接口,2脚和3脚作为USB传输信号,4脚可作它用。 Taking a MTK platform mobile phone with USB function as an example, the simplified diagram of the Micro USB interface and its analog switch circuit is shown in Figure 1. The analog switch in the figure is a single-pole double-throw analog switch 110, the power supply terminal VCC of the single-pole double-throw analog switch 110 is connected to the working power supply VBAT, and the GND terminal is connected to the reference ground. Micro USB (micro USB) interface 100 has gradually become an interface standard. Its 1-pin power supply and 5-pin ground are used as a charger or USB power charging interface, 2-pin and 3-pin are used as USB transmission signals, and 4-pin can be used for other purposes. .

而UART(程序下载线)也是目前手机上常用的一种通讯接口,比如两线式UART接口(图1 中UTXD和URXD信号),它主要可用于手机下载应用程序。可以看到,Micro USB接口100上的信号脚十分有限,只有5个。为了节省空间和资源,一般采用一个单刀双掷模拟开关110,将手机主芯片上的USB接口和UART接口共用于一个Micro USB接口的2、3脚。 And UART (program download line) is also a communication interface commonly used on mobile phones at present, such as the two-wire UART interface (UTXD and URXD signals in Figure 1), which can be mainly used to download applications on mobile phones. It can be seen that the signal pins on the Micro USB interface 100 are very limited, only 5. In order to save space and resources, a SPDT analog switch 110 is generally used, and the USB interface and UART interface on the main chip of the mobile phone are shared with pins 2 and 3 of a Micro USB interface.

一般程序下载线不带电源线,而USB线带电源线。这样,手机端就可以通过检测Micro USB接口1脚上是否有高电平来区分插入的是USB线还是程序下载线。 The general program download cable does not have a power cord, but the USB cable has a power cord. In this way, the mobile phone can distinguish whether the USB cable or the program download cable is plugged in by detecting whether there is a high level on pin 1 of the Micro USB interface.

通常手机主芯片用一个通用输入输出信号(图1 中GPIO1)来控制模拟开关的使能端(控制端),以切换不同的信号通道。比如就此款手机而言,此单刀双掷模拟开关110的默认初始状态是将通道B01、B02分别与D01、D02相连,A01、A02分别与D01、D02断开;即默认情况下,手机Micro USB接口的信号端D-、D+是与程序下载端UTXD、URXD连接的。 Usually the main chip of the mobile phone uses a general-purpose input and output signal (GPIO1 in Figure 1) to control the enable terminal (control terminal) of the analog switch to switch different signal channels. For example, as far as this mobile phone is concerned, the default initial state of the SPDT analog switch 110 is to connect channels B01 and B02 to D01 and D02 respectively, and to disconnect A01 and A02 from D01 and D02 respectively; The signal terminals D- and D+ of the interface are connected to the program download terminals UTXD and URXD.

当手机主芯片的GPIO1输出为低电平时,单刀双掷模拟开关110也是将通道B01、B02分别与D01、D02相连,A01、A02分别与D01、D02断开;而当手机主芯片的GPIO1输出为高电平时,控制单刀双掷模拟开关110将B01、B02分别与D01、D02通道断开,A01、A02分别与D01、D02通道相连。 When the GPIO1 output of the mobile phone main chip is at low level, the SPDT analog switch 110 also connects channels B01 and B02 to D01 and D02 respectively, and A01 and A02 are respectively disconnected from D01 and D02; and when the GPIO1 output of the mobile phone main chip When the level is high, the SPDT analog switch 110 is controlled to disconnect B01 and B02 from the D01 and D02 channels respectively, and A01 and A02 are respectively connected to the D01 and D02 channels.

由于手机在使用UART接口下载程序时,手机处于非正常开机状态,主芯片无法控制GPIO信号,所以一般将UART接在单刀双掷模拟开关110默认初始状态的信号通道上,即接在B01、B02口。 Since the mobile phone is in an abnormal power-on state when using the UART interface to download the program, the main chip cannot control the GPIO signal, so the UART is generally connected to the signal channel of the default initial state of the single-pole double-throw analog switch 110, that is, connected to B01 and B02 mouth.

这样当插入程序下载线(UART线)时,Micro USB接口100的1脚VCHG为低电平,单刀双掷模拟开关110默认B01、B02与D01、D02相连,手机就可以正常下载程序了。 In this way, when the program download line (UART line) is inserted, pin 1 VCHG of the Micro USB interface 100 is at low level, and the single-pole double-throw analog switch 110 is connected to D01 and D02 by default, and the mobile phone can download the program normally.

由于USB功能端的USB_DM、USB_DP分别连接至A01、A02。当插入USB线时,手机识别到Micro USB接口1脚的高电平,手机在开机状态下,能通过控制GPIO1将单刀双掷模拟开关110的信号通道切换到A01、A02分别与D01、D02连接,使用USB功能了。 Because the USB_DM and USB_DP of the USB function end are connected to A01 and A02 respectively. When the USB cable is plugged in, the mobile phone recognizes the high level of pin 1 of the Micro USB interface. When the mobile phone is turned on, it can switch the signal channel of the single-pole double-throw analog switch 110 to A01 and A02 to connect with D01 and D02 respectively by controlling GPIO1. , use the USB function now.

在实际应用中,会遇到一个时序问题,导致手机在关机状态下无法正确被电脑识别为USB设备。通过分析USB通讯的协议规范,得知USB主机(如电脑)识别外设的基理,当USB主机侦测到信号线D+、D-上的电压差时,就认为有外设插入,启动和外设的握手程序,每间隔500毫秒发送一次握手信号,如果连续三次都没有得到外设的正确回应,握手超时,主机则认为插入的是无效的USB设备。这一过程约为1500毫秒。 In practical applications, there will be a timing problem, which will cause the mobile phone to be incorrectly recognized as a USB device by the computer when it is turned off. By analyzing the protocol specifications of USB communication, we know the basic principle of USB host (such as computer) identifying peripherals. When the USB host detects the voltage difference on the signal lines D+ and D-, it will consider that there is a peripheral plugged in, start and The handshake program of the peripheral device sends a handshake signal every 500 milliseconds. If the peripheral device does not get a correct response three times in a row, the handshake timeout, and the host thinks that the inserted USB device is invalid. This process takes about 1500 milliseconds.

由此再来看手机端,如图1所示,手机开机状态下,插入USB线,手机检测到主机输出到USB接口1脚上的5V电压(VCHG)后可立即通过控制GPIO1为高电平切换单刀双掷模拟开关110使通道A01、A02分别与D01、D02连接,手机和主机可以在时限内正常进行握手,使用USB功能。 Let’s look at the mobile phone again. As shown in Figure 1, when the mobile phone is turned on, plug in the USB cable, and the mobile phone can immediately switch to high level by controlling GPIO1 after detecting the 5V voltage (VCHG) output from the host to the pin 1 of the USB interface. The SPDT analog switch 110 connects channels A01 and A02 to D01 and D02 respectively, so that the mobile phone and the host can normally shake hands within a time limit and use the USB function.

而关机状态下,当插入USB线后,信号时序如图2所示。手机检测到USB接口1脚上的5V电压(VCHG)立即开启各模块电源,由UART通讯协议,UTXD和URXD信号会输出一组高低变化的电平(如图2所示的D+/UTXD线所示)。由于默认状态下模拟开关的B01、B02分别与D01、D02通道相连, D+、D-电平受UTXD、URXD信号影响。主机检测D+、D-的压差后,认为有USB外设接入,就启动握手程序。而这时手机只有在完成开机程序,控制GPIO1为高电平(如图2所示的GPIO1线所示)才能切换模拟开关的通道A01、A02与D01、D02相连,此时模拟开关的切换时间约2.3S,这时主机的握手程序已经超时了,电脑无法侦测到手机作为USB设备了。 In the shutdown state, when the USB cable is plugged in, the signal sequence is shown in Figure 2. The mobile phone detects the 5V voltage (VCHG) on pin 1 of the USB interface and immediately turns on the power of each module. According to the UART communication protocol, the UTXD and URXD signals will output a set of high and low levels (as shown in the D+/UTXD line shown in Figure 2. Show). Since the B01 and B02 of the analog switch are connected to the D01 and D02 channels respectively in the default state, the D+ and D- levels are affected by the UTXD and URXD signals. After the host detects the pressure difference between D+ and D-, it thinks that there is a USB peripheral connected, and starts the handshake procedure. At this time, the mobile phone can only switch channels A01 and A02 of the analog switch to connect with D01 and D02 after completing the boot procedure and controlling GPIO1 to a high level (as shown in the GPIO1 line shown in Figure 2). At this time, the switching time of the analog switch About 2.3S, at this time, the host’s handshake procedure has timed out, and the computer cannot detect the mobile phone as a USB device.

由此,本发明实施例提供的一种模拟开关控制电路200,如图3所示,包括Micro USB接口210,及与Micro USB接口210通讯连接的单刀双掷模拟开关220,用于将两组相互独立的信号通道共用于一个接口,如图3所示,所述单刀双掷模拟开关220包括第一对输入端B1和B2及第二对输入端A1和A2,例如,将所述单刀双掷模拟开关220的第一对输入端B1和B2分别连接至手机应用程序下载端UTXD和URXD,将其第二对输入端A1和A2分别连接至UBS数据收发端USB_DP和USB_DM。 Therefore, an analog switch control circuit 200 provided by the embodiment of the present invention, as shown in FIG. Independent signal channels share one interface. As shown in FIG. 3, the SPDT analog switch 220 includes a first pair of input terminals B1 and B2 and a second pair of input terminals A1 and A2. The first pair of input terminals B1 and B2 of the throw analog switch 220 are respectively connected to the mobile phone application program download terminals UTXD and URXD, and the second pair of input terminals A1 and A2 are respectively connected to the UBS data transceiver terminals USB_DP and USB_DM.

其中,所述Micro USB接口210的第2脚、第3脚与所述单刀双掷模拟开关220的输出端D1和D2连接,Micro USB接口210的第4脚用作其它用。第5脚连接参考地,Micro USB接口210的第1脚通过一分压电路230连接至所述单刀双掷模拟开关220的控制端C1和C2。 Wherein, the 2nd pin and the 3rd pin of the Micro USB interface 210 are connected with the output terminals D1 and D2 of the SPDT analog switch 220, and the 4th pin of the Micro USB interface 210 is used for other purposes. The fifth pin is connected to the reference ground, and the first pin of the Micro USB interface 210 is connected to the control terminals C1 and C2 of the SPDT analog switch 220 through a voltage divider circuit 230 .

进一步地,如图3所示,所述分压电路230包括第一电阻R1和第二电阻R2,第一电阻R1的一端连接至所述Micro USB接口210的第1脚,第一电阻R1的另一端连接至所述单刀双掷模拟开关220的控制端C1和C2,所述第一电阻R1的另一端还通过第二电阻R2连接参考地。较佳地,所述第一电阻的阻值为36K欧姆,所述第二电阻的阻值为24K欧姆。 Further, as shown in FIG. 3 , the voltage divider circuit 230 includes a first resistor R1 and a second resistor R2, one end of the first resistor R1 is connected to the first pin of the Micro USB interface 210, and one end of the first resistor R1 is connected to the first pin of the Micro USB interface 210. The other end is connected to the control terminals C1 and C2 of the SPDT analog switch 220 , and the other end of the first resistor R1 is also connected to the reference ground through the second resistor R2 . Preferably, the resistance of the first resistor is 36K ohms, and the resistance of the second resistor is 24K ohms.

由上可见,本发明实施例的模拟开关控制电路200,由原来的软件GPIO信号控制改为硬件电路(即如图3所示的分压电路230)控制模拟开关,缩短了模拟开关的切换时间。如图3,将GPIO1的信号改为由分压电路230的控制信号(控制电平)。Micro USB接口210的1脚上的VCHG信号直接通过一个由R1和R2组成的分压电路得到单刀双掷模拟开关所需的控制电平。 It can be seen from the above that the analog switch control circuit 200 of the embodiment of the present invention is changed from the original software GPIO signal control to a hardware circuit (that is, the voltage divider circuit 230 shown in FIG. 3 ) to control the analog switch, which shortens the switching time of the analog switch. . As shown in FIG. 3 , the signal of GPIO1 is changed to the control signal (control level) of the voltage divider circuit 230 . The VCHG signal on pin 1 of the Micro USB interface 210 directly passes through a voltage divider circuit composed of R1 and R2 to obtain the control level required by the SPDT analog switch.

如图3所示,当有USB设备插入Micro USB接口210时,VCHG信号上有主机输出的5V电平,通过分压电路230立即使单刀双掷模拟开关220的使能端(即控制端C1和C2)信号拉高,通道切换到A1、A2分别与D1、D2连接,D1、D2分别与B1、B2通道断开。其可以快速控制模拟开关进行切换,并且结构简单,不易出错。 As shown in Figure 3, when a USB device is inserted into the Micro USB interface 210, the VCHG signal has a 5V level output by the host, and the voltage divider circuit 230 immediately enables the enabling terminal of the SPDT analog switch 220 (that is, the control terminal C1 and C2) signal is pulled high, the channel is switched to A1, A2 are respectively connected to D1, D2, D1, D2 are respectively disconnected from B1, B2 channel. It can quickly control the analog switch for switching, and has a simple structure and is not easy to make mistakes.

基于上述实施例的模拟开关控制电路,本发明实施例还提供了一种手机,如图4所示,包括一手机本体400,设置在手机本体400内的电路板410,及设置在所述电路板410上的模拟开关控制电路200,如图5所示,其中,所述模拟开关控制电路200包括一Micro USB接口210,及一单刀双掷模拟开关220,用于将两组相互独立的信号通道共用于一个接口,如图5所示,所述单刀双掷模拟开关包括第一对输入端B1和B2及第二对输入端A1和A2。 Based on the analog switch control circuit of the above-mentioned embodiment, the embodiment of the present invention also provides a mobile phone, as shown in Figure 4, comprising a mobile phone body 400, a circuit board 410 arranged in the mobile phone body 400, and a circuit board 410 arranged in the circuit The analog switch control circuit 200 on the board 410, as shown in Figure 5, wherein, the analog switch control circuit 200 includes a Micro USB interface 210, and a single pole double throw analog switch 220, for two groups of mutually independent signals The channels share one interface. As shown in FIG. 5 , the SPDT analog switch includes a first pair of input terminals B1 and B2 and a second pair of input terminals A1 and A2.

如图5所示,所述Micro USB接口210的第2脚(D-)、第3脚(D+)分别与所述单刀双掷模拟开关220的输出端D2、D1连接,Micro USB接口210的第1脚通过一分压电路230连接至所述单刀双掷模拟开关220的控制端C1和C2。 As shown in Figure 5, the second pin (D-) and the third pin (D+) of the Micro USB interface 210 are respectively connected to the output terminals D2 and D1 of the SPDT analog switch 220, and the Micro USB interface 210 The first pin is connected to the control terminals C1 and C2 of the SPDT analog switch 220 through a voltage divider circuit 230 .

进一步地,所述分压电路230包括第一电阻R1和第二电阻R2,第一电阻R1的一端连接至所述Micro USB接口210的第1脚,第一电阻R1的另一端连接至所述单刀双掷模拟开关220的控制端C1和C2,所述第一电阻R1的另一端还通过第二电阻R2连接参考地。较佳地,所述第一电阻R1的阻值为36K欧姆,所述第二电阻R2的阻值为24K欧姆。 Further, the voltage divider circuit 230 includes a first resistor R1 and a second resistor R2, one end of the first resistor R1 is connected to the first pin of the Micro USB interface 210, and the other end of the first resistor R1 is connected to the As for the control terminals C1 and C2 of the SPDT analog switch 220 , the other terminal of the first resistor R1 is also connected to the reference ground through the second resistor R2 . Preferably, the resistance of the first resistor R1 is 36K ohms, and the resistance of the second resistor R2 is 24K ohms.

进一步地,如图5所示,在所述电路板410上还设置有USB数据收发电路240和手机应用程序下载电路250,所述手机应用程序下载电路250通过其UTXD端和URXD端分别与所述单刀双掷模拟开关220的第一对输入端B1和B2连接,所述USB数据收发电路240的USB_DP端和USB_DM分别与所述单刀双掷模拟开关220的第二对输入端连接A1和A2连接。 Further, as shown in FIG. 5 , a USB data transceiver circuit 240 and a mobile phone application program download circuit 250 are also arranged on the circuit board 410, and the mobile phone application program download circuit 250 communicates with the mobile phone application program download circuit 250 through its UTXD terminal and URXD terminal respectively. The first pair of input terminals B1 and B2 of the SPDT analog switch 220 are connected, and the USB_DP terminal and USB_DM of the USB data transceiver circuit 240 are respectively connected to the second pair of input terminals A1 and A2 of the SPDT analog switch 220. connect.

如图5所示,当本发明的手机处于关机状态时,插入USB线,信号时序如图6。VCHG信号上有主机输出的5V电平,通过分压电路230立即使单刀双掷模拟开关220的控制端C1和C2的控制信号(即如图6所示的控制电平线)拉高,单刀双掷开关220内的通道切换A1和A2分别与D1和D2连接,控制D1和D2分别与B1和B2通道断开。D+、D-上的电平就不受UTXD、URXD上的信号影响了,电平都为低,直到手机端拉高D+(如图6所示的D+线),告诉主机有外设插入,主机就启动和外设的握手程序,使用USB功能,正确地识别到手机为USB设备了。 As shown in FIG. 5 , when the mobile phone of the present invention is in a power-off state, the USB cable is inserted, and the signal sequence is shown in FIG. 6 . There is a 5V level output by the host on the VCHG signal, and the control signals of the control terminals C1 and C2 of the SPDT analog switch 220 (that is, the control level lines shown in Figure 6) are immediately pulled high through the voltage divider circuit 230, and the single-pole The channel switches A1 and A2 in the double-throw switch 220 are connected to D1 and D2 respectively, and the control D1 and D2 are disconnected from the channels B1 and B2 respectively. The levels on D+ and D- are not affected by the signals on UTXD and URXD, and the levels are all low until the mobile phone pulls up D+ (D+ line as shown in Figure 6), telling the host that there is a peripheral plugged in. The host starts the handshake program with the peripheral, uses the USB function, and correctly recognizes the mobile phone as a USB device.

由上可见,本发明实施例的手机合理地利用了USB线所带的电源电压(即Micro USB接口210的第1脚电压),用以分压电路230的硬件控制方式控制模拟开关,较常规的软件控制GPIO的方法,更加快速,简单有效,不占用GPIO口资源,只增加极少的硬件成本。 It can be seen from the above that the mobile phone in the embodiment of the present invention rationally utilizes the power supply voltage carried by the USB line (that is, the voltage of the first pin of the Micro USB interface 210), and uses the hardware control method of the voltage divider circuit 230 to control the analog switch, which is more conventional. The method of controlling GPIO by software is faster, simpler and more effective, does not occupy GPIO port resources, and only adds very little hardware cost.

综上所述,本发明所提供的一种模拟开关控制电路及手机,由于采用所述Micro USB接口的第2脚、第3脚与所述模拟开关的输出端连接,其第1脚通过一分压电路连接至所述模拟开关的控制端,其合理地利用了USB线所带的电源电压,用硬件的方式控制模拟开关,较常规的软件控制GPIO的方法,更加快速,简单有效,不占用GPIO口资源。 In summary, in the analog switch control circuit and the mobile phone provided by the present invention, since the second pin and the third pin of the Micro USB interface are connected to the output end of the analog switch, the first pin is passed through a The voltage divider circuit is connected to the control terminal of the analog switch, which reasonably utilizes the power supply voltage carried by the USB line to control the analog switch in a hardware manner, which is faster, simpler and more effective than the conventional software control GPIO method. Occupies GPIO port resources.

应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。 It should be understood that the application of the present invention is not limited to the above examples, and those skilled in the art can make improvements or transformations according to the above descriptions, and all these improvements and transformations should belong to the protection scope of the appended claims of the present invention.

Claims (5)

1.一种模拟开关控制电路,包括Micro USB接口,及与Micro USB接口通讯连接的模拟开关,其特征在于,Micro USB接口的第2脚、第3脚与所述模拟开关的输出端连接,Micro USB接口的第1脚通过一分压电路连接至所述模拟开关的控制端; 1. A kind of analog switch control circuit, comprise Micro USB interface, and the analog switch that communicates with Micro USB interface, it is characterized in that, the 2nd pin of Micro USB interface, the 3rd pin are connected with the output end of described analog switch, The first pin of the Micro USB interface is connected to the control terminal of the analog switch through a voltage divider circuit; 所述分压电路包括第一电阻和第二电阻,第一电阻的一端连接至所述Micro USB接口的第1脚,第一电阻的另一端连接至所述模拟开关的控制端,所述第一电阻的另一端还通过第二电阻连接参考地; The voltage divider circuit includes a first resistor and a second resistor, one end of the first resistor is connected to the first pin of the Micro USB interface, the other end of the first resistor is connected to the control terminal of the analog switch, and the first resistor The other end of the first resistor is also connected to the reference ground through the second resistor; 所述模拟开关为单刀双掷模拟开关,用于将两组相互独立的信号通道共用于一个接口,所述单刀双掷模拟开关包括第一对输入端和第二对输入端。 The analog switch is a single-pole double-throw analog switch, which is used to share two sets of mutually independent signal channels to one interface, and the single-pole double-throw analog switch includes a first pair of input terminals and a second pair of input terminals. 2.根据权利要求1所述的模拟开关控制电路,其特征在于,所述第一电阻的阻值为36K欧姆,所述第二电阻的阻值为24K欧姆。 2. The analog switch control circuit according to claim 1, wherein the resistance of the first resistor is 36K ohms, and the resistance of the second resistor is 24K ohms. 3.一种手机,包括一手机本体,设置在手机本体内的电路板,及设置在所述电路板上的模拟开关控制电路,其特征在于,所述模拟开关控制电路包括一Micro USB接口,及一模拟开关,所述Micro USB接口的第2脚、第3脚与所述模拟开关的输出端连接,Micro USB接口的第1脚通过一分压电路连接至所述模拟开关的控制端; 3. A mobile phone, comprising a mobile phone body, a circuit board arranged on the mobile phone body, and an analog switch control circuit arranged on the circuit board, wherein the analog switch control circuit comprises a Micro USB interface, And an analog switch, the second pin and the third pin of the Micro USB interface are connected to the output end of the analog switch, and the first pin of the Micro USB interface is connected to the control end of the analog switch through a voltage divider circuit; 所述分压电路包括第一电阻和第二电阻,第一电阻的一端连接至所述Micro USB接口的第1脚,第一电阻的另一端连接至所述模拟开关的控制端,所述第一电阻的另一端还通过第二电阻连接参考地; The voltage divider circuit includes a first resistor and a second resistor, one end of the first resistor is connected to the first pin of the Micro USB interface, the other end of the first resistor is connected to the control terminal of the analog switch, and the first resistor The other end of the first resistor is also connected to the reference ground through the second resistor; 所述模拟开关为单刀双掷模拟开关,用于将两组相互独立的信号通道共用于一个接口,所述单刀双掷模拟开关包括第一对输入端和第二对输入端。 The analog switch is a single-pole double-throw analog switch, which is used to share two sets of mutually independent signal channels to one interface, and the single-pole double-throw analog switch includes a first pair of input terminals and a second pair of input terminals. 4.根据权利要求3所述的手机,其特征在于,在所述电路板上还设置有USB数据收发电路和手机应用程序下载电路,所述手机应用程序下载电路与所述单刀双掷模拟开关的第一对输入端连接,所述USB数据收发电路与所述单刀双掷模拟开关的第二对输入端连接。 4. mobile phone according to claim 3, is characterized in that, on described circuit board, also be provided with USB data transceiver circuit and mobile phone application program download circuit, described mobile phone application program download circuit and described SPDT analog switch The first pair of input terminals of the USB data transceiver circuit is connected with the second pair of input terminals of the single-pole double-throw analog switch. 5.根据权利要求3或4所述的手机,其特征在于,所述第一电阻的阻值为36K欧姆,所述第二电阻的阻值为24K欧姆。 5. The mobile phone according to claim 3 or 4, wherein the resistance of the first resistor is 36K ohms, and the resistance of the second resistor is 24K ohms.
CN2010105724730A 2010-12-03 2010-12-03 Analog switch control circuit and mobile phone Active CN102098035B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105724730A CN102098035B (en) 2010-12-03 2010-12-03 Analog switch control circuit and mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105724730A CN102098035B (en) 2010-12-03 2010-12-03 Analog switch control circuit and mobile phone

Publications (2)

Publication Number Publication Date
CN102098035A CN102098035A (en) 2011-06-15
CN102098035B true CN102098035B (en) 2013-01-02

Family

ID=44130927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105724730A Active CN102098035B (en) 2010-12-03 2010-12-03 Analog switch control circuit and mobile phone

Country Status (1)

Country Link
CN (1) CN102098035B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227702A (en) * 2015-05-28 2016-01-06 盛耀无线通讯科技(北京)有限公司 A kind of bilateral cell phone platform USB socket
CN107124175B (en) * 2017-03-29 2023-06-13 昆明理工大学 Two-way USB control circuit
CN107911696B (en) * 2017-12-28 2019-12-06 上海传英信息技术有限公司 Method and system for distinguishing cameras
CN108233913A (en) * 2018-01-30 2018-06-29 上海与德科技有限公司 A kind of key control circuit and electronic equipment
CN112968332A (en) * 2021-02-06 2021-06-15 读书郎教育科技有限公司 Compatible device and method for switching TYPE-C interface of tablet personal computer mainboard to UART serial port communication
CN114326687B (en) * 2022-01-07 2024-05-24 摩登汽车有限公司 Power domain controller of new energy vehicle and vehicle

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2790039Y (en) * 2005-03-28 2006-06-21 英华达(上海)电子有限公司 Multifunction universal interface circuit for mobile telephone
CN201919042U (en) * 2010-12-03 2011-08-03 惠州Tcl移动通信有限公司 Analog switch control circuit and mobile phone

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004334823A (en) * 2003-05-07 2004-11-25 Sony Corp Communication line switching circuit and method, information processor, and program recorder
TWI296376B (en) * 2005-10-06 2008-05-01 Holtek Semiconductor Inc Method and apparatus for detecting the type of interface to which a peripheral device is connetced
JP5157933B2 (en) * 2009-01-21 2013-03-06 株式会社リコー Signal switching circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2790039Y (en) * 2005-03-28 2006-06-21 英华达(上海)电子有限公司 Multifunction universal interface circuit for mobile telephone
CN201919042U (en) * 2010-12-03 2011-08-03 惠州Tcl移动通信有限公司 Analog switch control circuit and mobile phone

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JP特开2004-334823A 2004.11.25
JP特开2010-171589A 2010.08.05

Also Published As

Publication number Publication date
CN102098035A (en) 2011-06-15

Similar Documents

Publication Publication Date Title
US8898363B2 (en) Multiple connections to a single serial interface
US9414147B2 (en) Method and device for earphone and USB to share micro-USB interface
CN101931674B (en) Method and device for sharing Micro-USB interface
CN101937414B (en) Method and device of sharing minitype USB interface for UART (Universal Asynchronous Receive/Transmitter) and USB (Universal Serial Bus)
WO2018176901A1 (en) Adapter, terminal device and adapter system
US7895386B2 (en) USB interface provided with host/device function and its control method
CN101951421B (en) Expansion use method for cell phone earphone interface
CN102098035B (en) Analog switch control circuit and mobile phone
CN108604218A (en) The method and terminal device of connection are established between equipment with general-purpose serial bus USB Type-C interfaces
US20070239924A1 (en) Electronic device transmitting audio-and-video signals with USB connector
CN102082846B (en) Terminal equipment with plurality of externally arranged shared interfaces
US8458376B1 (en) USB peripheral device with automatic mode switch
CN109672950B (en) Power saving circuit and power saving method based on Type-C earphone
US11403245B2 (en) Terminal, terminal peripheral, signal transmission system and signal sending and receiving method
CN201805529U (en) Earphone interface shared by serial port download line and earphone, and mobile terminal shared thereby
WO2024148860A1 (en) Pcie network card and interface mode switching method therefor, electronic device, and storage medium
CN102281482A (en) Function extension method and device thereof for earphone jack of smart phone
CN107613126A (en) UART (Universal asynchronous receiver transmitter) and USB (Universal Serial bus) multiplexing circuit and mobile terminal
CN201919041U (en) Terminal equipment with plurality of peripheral sharing interfaces
CN109660894A (en) The transmission method of terminal peripheral hardware and audio signal
TWM614161U (en) Multifunctional adapter device
CN101626412A (en) Mobile terminal circuit with multifunctional earphone socket and implementation method thereof
CN213151196U (en) Signal adapter
CN210006035U (en) USB and OTG function switching control circuit, device and mobile terminal
CN111886585B (en) Terminal device, debugging card and debugging method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201225

Address after: 274200 Room 102, 1 / F, Jiahe neighborhood committee, Wenting street, Chengwu County, Heze City, Shandong Province

Patentee after: Chengwu Yichang Information Technology Co.,Ltd.

Address before: 511400 No.106 Fengze East Road, Nansha District, Guangzhou City, Guangdong Province (self compiled Building 1) x1301-a4845 (cluster registration) (JM)

Patentee before: Guangzhou shengxia Intellectual Property Operation Co.,Ltd.

Effective date of registration: 20201225

Address after: 511400 No.106 Fengze East Road, Nansha District, Guangzhou City, Guangdong Province (self compiled Building 1) x1301-a4845 (cluster registration) (JM)

Patentee after: Guangzhou shengxia Intellectual Property Operation Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. 23 District

Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20241206

Address after: 274000 muliu administrative village, Shatu Town, Mudan District, Heze City, Shandong Province

Patentee after: Heze Enze building materials Co.,Ltd.

Country or region after: China

Address before: 274200 Room 102, 1 / F, Jiahe neighborhood committee, Wenting street, Chengwu County, Heze City, Shandong Province

Patentee before: Chengwu Yichang Information Technology Co.,Ltd.

Country or region before: China