External equipment in-place detection method and related device
By introducing SOC, BUCK, PMU and specific interface structures into tablets, the access status of external devices is detected by voltage changes, and the problem of requiring additional Hall sensors in the prior art is solved, enabling a lighter, thinner and lower cost device design, while simplifying the magnetic field environment.
Patent Information
- Application Number
- CN202510575826.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-06-06
AI Technical Summary
Existing tablets require additional Hall sensors when detecting whether external devices are connected, resulting in increased space occupancy, weight, volume and cost, while complicating the magnetic field environment.
By introducing system-on-chip SOC, buck converter BUCK, power management unit PMU and specific interface structures into the electronic device, the voltage changes of the data contacts and power contacts are used to identify the access status of the external device, thereby realizing external device in-position detection without the Hall sensor.
This enables accurate detection of the access status of external devices without the need for additional Hall sensors, reducing the weight, volume and cost of the device while simplifying the magnetic field environment.
Smart Images

Figure CN120103231A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a method for detecting the presence of an external device and related devices. Background Art
[0002] Currently, electronic devices such as tablet computers usually use an additional Hall sensor to detect whether an external device such as a keyboard is connected. This is not only not conducive to saving space, reducing the weight, volume and cost of the tablet computer, but also increases the complexity of the magnetic field environment of the tablet computer. Summary of the invention
[0003] The present application provides a method for detecting the presence of an external device and a related device.
[0004] In a first aspect, the present application provides an electronic device, which includes: a system on chip SOC, a buck converter BUCK, a first interface and a power management unit PMU, the first interface includes a data contact a and a power contact e, the PMU is connected to one end of a first resistor R1, and the other end of R1 is connected to a; a is also connected to the interrupt INT port of the SOC, and a is also connected to the analog-to-digital conversion ADC port of the SOC; e is connected to BUCK; the SOC is connected to BUCK.
[0005] Based on the above structure, the electronic device can identify the voltage change at point a, and further identify whether other devices are connected to the first interface according to the voltage change at point a.
[0006] In some embodiments, a second resistor R2 is provided between a and the INT port, and a third resistor R3 is provided between a and the ADC port, for stabilizing the voltages on the INT port and the ADC port.
[0007] In some embodiments, the first interface is a pogo pin interface.
[0008] In a second aspect, the present application provides an electronic device, comprising: a system on chip SOC and a first interface, the first interface comprising a data contact a, a being connected to a first port of the SOC, the first port being used to detect a voltage at point a; the SOC being used to determine that an external device is connected to the first interface when the voltage at point a drops from a first value (e.g., 1.8V) to a second value (e.g., 0.17V).
[0009] In some embodiments, the first interface further includes a power contact e; the SOC is further configured to supply power to point e after determining that the first interface is connected to an external device, so that the voltage at point e rises to a third value (e.g., 3V). In this way, the external device connected to the first interface, such as a keyboard, can obtain power input through the contact e so that the device can be powered on and operate.
[0010] In some embodiments, the SOC is further configured to, after determining that the first interface is connected to the external device, send a heartbeat packet to the external device; and determine that the external device is removed when no confirmation information of the heartbeat packet is received within a timeout period.
[0011] In some embodiments, the SOC is further used to determine that the external device is removed when it is detected that the voltage at point a recovers to a first value (eg, 1.8 V).
[0012] In some embodiments, the SOC is further used to stop supplying power to point e to avoid current leakage after determining that the external device is removed.
[0013] In some embodiments, the electronic device further includes a power management unit PMU, the PMU is connected to one end of the first resistor R1, the other end of R1 is connected to a, and the PMU is used to provide a first value voltage (eg, 1.8V).
[0014] In some embodiments, a is also connected to the second port of the SOC; when the voltage at point a changes, the second port generates a first interrupt; the SOC is specifically used to identify the change in the voltage at point a in response to the first interrupt, and when the voltage at point a drops from a first value to a second value, it determines that the first interface is connected to an external device.
[0015] In some embodiments, a second resistor R2 is provided between a and the INT port, and a third resistor R3 is provided between a and the ADC port, for stabilizing the voltages on the INT port and the ADC port.
[0016] In some embodiments, the electronic device also includes a buck converter BUCK; the SOC is connected to one end of the BUCK, and the other end of the BUCK is connected to e; the SOC is specifically used to, after determining that the first interface is connected to the external device, send a first instruction to the BUCK, the first instruction is used to instruct the BUCK to supply power to point e; after determining that the external device is removed, send a second instruction to the BUCK, the second instruction is used to instruct the BUCK to stop supplying power to point e.
[0017] In a third aspect, the present application provides an electronic device, which includes: a microprogram controller MCU and a second interface, the second interface including a data contact b, a ground contact d, and a power contact f, b is connected to the data transceiver port of the MCU, f is connected to the power input port of the MCU, and d is grounded; b and d are connected through a fourth resistor R4.
[0018] Based on the above structure, when the electronic device is connected to another device via the second interface, R4 divides the voltage so that the voltage at point b changes. The voltage of the contact point (e.g., contact point a) on the other device that contacts b also changes accordingly, so that the other device can determine whether the electronic device is connected by identifying the voltage change.
[0019] In some embodiments, b is also connected to f through a fifth resistor R5 and a first unidirectional flow device, the input end of the first unidirectional flow device is connected to f, and the output end of the first unidirectional flow device is connected to b. The electronic device can raise the voltage at b through the above structure to meet the communication requirements based on high-level communication in the existing communication protocol.
[0020] In some embodiments, the first unidirectional flow device is any one of the following: a diode, a transistor, and a controllable switch.
[0021] In some embodiments, the second interface is a pogo pin interface.
[0022] In some embodiments, the MCU is used to transmit and receive data based on the fourth voltage value after the voltage at point b rises to a fourth value (eg, 1.72V).
[0023] In some embodiments, the MCU is further configured to pull down the voltage at point b (eg, 0.01 V) after receiving a sleep indication.
[0024] In some embodiments, the electronic device is specifically a keyboard, and the MCU is further configured to restore the voltage at point b to a fourth value (eg, 1.72 V) after detecting a key operation by the user. In this way, the user can wake up the main device connected thereto through the keyboard.
[0025] In a fourth aspect, the present application provides a detection system, which includes a first electronic device and a second electronic device; the first electronic device includes: a system on chip SOC and a first interface; the first interface includes a data contact a, a is connected to a first port of the SOC, the first port is used to output a voltage waveform, and the voltage waveform output by the first port indicates the voltage change at point a; the second electronic device includes: a microprogram controller MCU and a second interface; the second interface includes a data contact b, when the first interface of the first electronic device is connected to the second interface of the second electronic device, a is connected to b; b is grounded through a fourth resistor R4; the SOC is used to determine that the first interface is connected to the second electronic device when the voltage at point a drops from a first value to a second value; when it is detected that the voltage at point a returns to the first value, it is determined that the second electronic device is taken away.
[0026] The first electronic device (also called the main device) is the electronic device described in the first aspect or the second aspect, such as a tablet computer, a mobile phone, a television, a large conference screen, etc. The second electronic device (also called the external device) is the electronic device described in the third aspect, such as a keyboard, a camera, a speaker, etc. The first interface and the second interface are spring pin interfaces.
[0027] In some embodiments, the first interface also includes a power contact e, and the second interface also includes a power contact f. When the first interface of the first electronic device is connected to the second interface of the second electronic device, e is connected to f. The SOC is also used to, after determining that the first interface is connected to the second electronic device, supply power to point e so that the second electronic device can be powered on; after determining that the second electronic device is taken away, stop supplying power to point e to avoid leakage.
[0028] In some embodiments, b is also connected to f through a fifth resistor R5 and a first unidirectional flow device, the input end of the first unidirectional flow device is connected to f, and the output end of the first unidirectional flow device is connected to b. The second electronic device can raise the voltage at a and b through the above structure so that the data path where a and b are located meets the communication requirements based on high-level communication in the existing communication protocol and can be used for communication signal transmission. The first unidirectional flow device is any one of the following: a diode, a transistor, and a controllable switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a schematic diagram of an external keyboard for a tablet computer provided in an embodiment of the present application; Figure 2 is a circuit diagram of the connection between the tablet computer 10 and the keyboard 20 provided in an embodiment of the present application; Figure 3 is a schematic diagram of a detection circuit provided in an embodiment of the present application; Figure 4A-4B is a working schematic diagram of a set of detection circuits provided in an embodiment of the present application; Figure 5A-5C is a working schematic diagram of a set of detection circuits provided in an embodiment of the present application; Figure 6 is a working schematic diagram of a set of detection circuits provided in an embodiment of the present application; Figure 7 It is a schematic diagram of another detection circuit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.
[0031] Figure 1 It is a schematic diagram of an external keyboard for a tablet computer provided in an embodiment of the present application.
[0032] The Pogo Pin interface is a device that uses spring-loaded contacts to achieve high-reliability, miniaturized electrical connections. Figure 1As shown, a spring pin interface 11 (first interface) is provided at one edge of the back plate of the tablet computer 10, and a Hall sensor 12 is provided near the spring pin interface 11. A spring pin interface 21 (second interface) is provided at the folding part of the keyboard 20, and a magnetic sheet 22 is provided near the spring pin interface 21.
[0033] When the tablet computer 10 is close to the spring pin interface 21, the magnetic sheet 22 on the keyboard 20 and the Hall sensor 12 on the tablet computer 10 generate magnetic force, so that the tablet computer 10 is adsorbed and fixed on the keyboard 20, and the spring pin interface 11 contacts the spring pin interface 21. The spring pin interface includes a plurality of conductive contacts. Figure 1 As shown, taking a 3-contact spring pin interface as an example, the 3 contacts are respectively a power contact, a data contact and a ground contact. When the spring pin interface 11 contacts the spring pin interface 21, the same type of contacts of the spring pin interface 11 and the spring pin interface 21 contact one by one.
[0034] When the magnetic sheet 22 and the Hall sensor 12 generate magnetic force, the tablet computer 10 can determine that the user is connecting an external keyboard based on the magnetic force. In response to the above state, the tablet computer 10 can supply power to the power contacts of the spring pin interface 11. Then, the current can be transmitted to the keyboard 20 through the power contacts of the spring pin interface 11 and the power contacts of the spring pin interface 21, so that the keyboard 20 can work.
[0035] Specifically, Figure 2 It is a circuit diagram of the connection between the tablet computer 10 and the keyboard 20 provided in an embodiment of the present application.
[0036] like Figure 2As shown, the tablet computer 10 is provided with a battery, a charging integrated circuit (IC), a power management unit (PMU), a buck converter (BUCK), a system on chip (SOC) and a Hall sensor 12 (marked Hall
[12] in the figure). The contacts a, c and e on one side of the tablet computer 10 are the three contacts of the spring pin interface 11. Among them, contact a is a data contact, contact c is a ground contact, and contact e is a power contact. The keyboard 20 is provided with a microprogrammed control unit (MCU) and a magnetic sheet 22. The contacts b, d and f on one side of the keyboard 20 are the three contact points of the spring pin interface 21. Among them, contact b corresponds to contact a and is a data contact; contact d corresponds to contact c and is a ground contact; contact f corresponds to contact e and is a power contact. When the spring pin interface 11 contacts the spring pin interface 21, the contacts a, c, e are connected to the contacts b, d, f one by one. The path connected to the contacts ab is the data path (denoted as DATA), the path connected to the contacts cd is the ground path (denoted as GND), and the path connected to the contacts ef is the power path (denoted as VDD).
[0037] The connection between electronic components includes direct connection and indirect connection. Direct connection, also known as direct connection, refers to the direct connection between two components through a wire or metal connection to form an electrical path. Indirect connection, also known as non-direct connection, refers to the connection between two components through a third component (such as a relay, switch, optocoupler, etc.). This connection method can achieve electrical isolation between components and enhance safety. It is also convenient for controlling and managing circuits, realizing complex logical functions, and improving the flexibility and scalability of circuits. The "connection" used in the subsequent embodiments of the present application can be any type of connection suitable for transmitting signals from or to corresponding nodes, units, or integrated circuit devices, including direct connections and / or indirect connections.
[0038] In the tablet computer 10, the battery is connected to one end of the charging IC. The charging IC is used to control and manage the charging process of the battery, such as monitoring the battery voltage and current, adjusting the charging strategy, providing a protection mechanism, etc. The other end of the charging IC is connected to the PMU and BUCK respectively, and provides power input to the PMU and BUCK. The PMU is responsible for the charging management of the battery, and is also responsible for the power distribution, conversion and monitoring of the entire system. The PMU can dynamically adjust the power consumption management, turn on or off the power of each module according to the system needs to optimize the power consumption and extend the battery life. The PMU can also provide various protection functions, such as over-temperature protection and overload protection, to ensure the stability and reliability of the entire system. The BUCK is used to convert high-voltage DC input into low-voltage DC output (such as 5V, 3.3V and other common voltages). The SOC includes multiple processors for processing signals and data. The SOC is connected to one end of the PMU, and based on this connection, it obtains power input from the PMU. One end of the PMU is also connected to the resistor R1, and through the voltage stabilization effect of R1, a stable high-level output (such as 1.8V) is provided to the contact a.
[0039] When the tablet computer 10 is close to the spring pin interface 21, the magnetic sheet 22 and the Hall sensor 12 generate magnetic force. Figure 2 As shown, after detecting the above-mentioned magnetic force, a first interrupt message can be generated on the interrupt (interrupt, INT) port of the SOC. Based on the above-mentioned first interrupt message, the SOC can determine that the user is connecting an external keyboard. Therefore, the SOC can send a power-on command to the BUCK through the enable port EN. After receiving the power-on command sent by the SOC, the BUCK can supply power to contact e. Exemplarily, after the BUCK supplies power, the voltage on contact e can be raised to 3V. At this time, contact e outputs an operating voltage VDD, such as 3V. Contact f is connected to the power input port of the MCU of the keyboard 20. Therefore, VDD is input into the keyboard 20 through the contact ef and input into the MCU of the keyboard 20. The keyboard 20 is powered on and works.
[0040] After the MCU is powered on, the MCU can send key control signals corresponding to user key input to the SOC through the data path (DATA), and receive control signals sent by the SOC. Among them, the UART-TX port of the MCU is used to send key control signals to the SOC, and the UART-RX port is used to receive control signals sent by the SOC. Correspondingly, the port UART-TX of the SOC is used to send key control signals to the MCU, and the port UART-RX is used to receive control signals sent by the MCU. The UART-TX port and UART-RX port of the MCU are the data transceiver ports of the MCU. The UART-TX port and UART-RX port of the SOC are the data transceiver ports of the SOC. The UART-TX port and UART-RX port of the MCU are respectively connected to the data contact b, and the UART-TX port and UART-RX port of the SOC are respectively connected to the data contact a. Based on the electrical connectivity characteristics after the data contact a and the data contact b are in contact, the MCU and the SOC exchange signals through the data path (DATA) connected by the data contact a and the data contact b to communicate.
[0041] When the user takes the tablet computer 10 away from the keyboard 20, the magnetic force between the magnetic sheet 22 and the Hall sensor 12 decreases. After detecting the above change, a second interrupt message may be generated on the INT port. Based on the above second interrupt message, the SOC may determine that the connection between the spring pin interface 11 and the spring pin interface 21 has been disconnected. Then, the SOC may send a power-off instruction to the BUCK. In response to the above power-off instruction, the BUCK immediately stops supplying power to the contact e (power contact) to avoid leakage.
[0042] refer to Figure 1 Another Hall sensor 13 is often provided on the other side edge of the back plate of the existing tablet computer 10 .
[0043] When the tablet computer 10 and the keyboard 20 are closed (cover closed), the magnetic sheet 23 on the keyboard 20 and the Hall sensor 13 on the tablet computer 10 generate magnetic force. The tablet computer 10 can determine that the user has stopped using the tablet computer 10 and the keyboard 20 based on the magnetic force. In response to the above state, the tablet computer 10 enters the sleep mode.
[0044] The design of two Hall sensors is not conducive to saving space and reducing the weight and volume of the tablet computer 10 .
[0045] In view of this, an embodiment of the present application provides a detection circuit. The tablet computer 10 can detect whether an external keyboard 20 is connected through the above detection circuit. When the external keyboard is detected to be connected, the tablet computer 10 can supply power to the power contacts of the spring pin interface 11 and provide VDD to the keyboard 20 for the keyboard 20 to work. When the disconnection is detected, the tablet computer 10 can stop supplying power to the power contacts of the spring pin interface 11 to avoid leakage.
[0046] In this case, the tablet computer 10 does not need to be provided with the Hall sensor 12, which can reduce the number of sensors, thereby reducing the weight, volume and cost of the tablet computer 10, and also helps to reduce the magnetic field complexity of the tablet computer 10. Correspondingly, the keyboard 20 does not need to be provided with the magnetic sheet 22, which reduces the weight, volume and cost of the keyboard 20.
[0047] Figure 3 It is a schematic diagram of a detection circuit provided in an embodiment of the present application.
[0048] like Figure 3 As shown, on the side of the tablet computer 10, the INT port of the SOC is connected to the contact a, and a resistor R2 is arranged between the INT port (second port) and the contact a, and the analog to digital converter (ADC) port of the SOC is connected to the contact a, and a resistor R3 is arranged between the ADC port (first port) and the contact a. On the side of the keyboard 20, the contact b is connected to the contact d, and a resistor R4 is arranged between the contact b and the contact d, and the contact b is connected to the contact f, and a resistor R5 and a diode D1 are arranged between the contact b and the contact f. Optionally, the diode D1 can be replaced with a metal-oxide-semiconductor field-effect transistor (MOSFET) (i.e., MOS tube) or a controllable switch, which can also realize the on-off and reverse protection of the path. As Figure 3 As shown, the tablet computer 10 also includes modules or devices such as a battery, a charging IC, a PMU, a BUCK, and an R1, and the keyboard 20 also includes modules or devices such as an MCU. The functions and connection relationships of the above modules or devices can be specifically referred to Figure 2 The relevant description in will not be repeated here.
[0049] After the tablet computer 10 and the spring pin interface of the keyboard 20 are in contact, the resistor voltage divider causes the voltage on the contact a to change. The tablet computer 10 can determine that the keyboard 20 is connected based on the above change. Then, the tablet computer 10 can supply power to the contact e, so that the keyboard 20 receives the VDD input and then powers on.
[0050] Table 1 shows the level changes of the contacts a and e in different states of the tablet computer 10 and the keyboard 20 provided in the embodiment of the present application.
[0051] Table 1
[0052] 1. Keyboard 20 access (i.e. state 1-3 switching process): When the keyboard is not connected, the tablet computer 10 provides a stable pull-up voltage, such as 1.8V, to the contact a through the PMU and the resistor R1.
[0053] refer to Figure 4A After the tablet computer 10 and the keyboard 20 are connected, that is, contacts a and b are in contact, contacts c and d are in contact, and contacts e and f are in contact, the circuit is closed, and the voltage on contact a (data contact) is reduced by the voltage divider R1 and R4. For example, when R1=100KΩ and R4=10KΩ, the voltage on contact a can be reduced from the original 1.8V to 0.17V. At this time, the voltage on contact b is also 0.17V. It can be understood that the above R1=100KΩ and R4=10KΩ are only an example. R1 and R4 can also be resistors of other resistance values. The embodiments of the present application are not limited to this. Similarly, the resistance values of other resistors mentioned later are also only an example and should not constitute a limitation on the embodiments of the present application.
[0054] At this time, the voltage on the INT port also decreases accordingly. In response to the above voltage change, the INT port generates an interrupt message.
[0055] The ADC port can detect the voltage at the ADC port at a fixed frequency. Considering the voltage divider of R3, there is a difference between the voltage at the ADC port and the voltage at contact a. However, since R3 is small, for example, R3=1K, the above difference can be ignored. Therefore, the voltage at the ADC port can be approximately regarded as the same as the voltage at point a, that is, the voltage at the ADC port = the voltage at point a. Therefore, in the above example, when the voltage at contact a can be reduced from the original 1.8V to 0.17V, the voltage at the ADC port can also be reduced from the original 1.8V to 0.17V.
[0056] In response to the above interrupt message, the SOC can identify the sampled data of the ADC port (i.e., the voltage of the ADC port detected at a fixed frequency). When it is identified that the voltage at point a decreases from 1.8V to 0.17V, the SOC can determine that the keyboard 20 is connected to the spring pin interface 11. It can be understood that when the difference between the voltage at the ADC port and the voltage at the contact a is large and cannot be ignored, the SOC can determine the voltage at the contact a corresponding to the voltage at the ADC port based on the mapping relationship between the two, and then determine whether the voltage at point a decreases to the specified value of 0.17V.
[0057] After recognizing that the voltage at point a decreases from 1.8V to 0.17V, the SOC can send a power-on command (first command) to the BUCK through the EN port. In response to the power-on command, the BUCK supplies power to the contact e and outputs VDD. For example, after power is supplied to the contact e, the voltage at the contact e can be raised from 0V when the power is off to 3V.
[0058] In the keyboard 20, the current generated by the VDD input passes through the resistor R5 and the diode D1, and is merged into the data path; it flows to the MCU. The input of D1 and R5 increases the level on the contact b. For example, when R5=6.2KΩ, the voltage on the contact a and the contact b increases from the original 0.17V to 1.72V, meeting the communication requirements. Existing protocols, such as the I2C (Inter-Integrated Circuit) protocol and the Serial Peripheral Interface (SPI) protocol, are usually based on high-level communication.
[0059] Therefore, the SOC and MCU can use the above data path to send and receive signals for the user to perform keyboard input operations. Among them, the MCU can send signals to the SOC through the UART-TX port on the MCU and receive the signals sent by the SOC through the UART-RX port. Correspondingly, the SOC can send signals to the MCU through the UART-TX port on the SOC and receive the signals sent by the MCU through the UART-RX port.
[0060] After the voltage on the data path meets the communication requirements, the SOC can periodically send a heartbeat packet to the MCU through the data path. For example, the SOC can send a heartbeat packet to the MCU every 200ms. In response to the above heartbeat packet, the MCU can return a confirmation message to the SOC.
[0061] When receiving the confirmation message, the SOC can confirm that the keyboard 20 is online (ie, remains connected). When the confirmation message is not received after a timeout, the SOC can confirm that the keyboard 20 is offline (ie, disconnected, the keyboard 20 is taken away).
[0062] 2. When the screen is on, the keyboard 20 is removed (i.e., the state 4-5 switching process): When the keyboard 20 is removed, the circuit is disconnected, the contacts a, c, and e are suspended, and the resistance voltage division disappears. Figure 4B , the voltage on contact a recovers from 1.72V when supporting communication to 1.8V before keyboard 20 is connected.
[0063] At this time, the voltages on the INT port and the ADC port also recover from 1.72V to 1.8V. In response to the above voltage change, the INT port generates an interrupt message. In response to the above interrupt message, the SOC can identify the sampled data of the ADC port. When it is identified that the voltage at point a recovers to the original 1.8V, the SOC can determine that the keyboard 20 is removed. Then, the SOC can send a power-off instruction (second instruction) to the BUCK through the EN port. In response to the above instruction, the BUCK immediately stops supplying power to the contact e. At this time, the voltage on the contact e drops from 3V to 0V.
[0064] Powering off the power contacts can avoid leakage, and is also beneficial for increasing the life of the contacts and the life of the spring pin interface.
[0065] When no confirmation message is received after the timeout, the SOC may confirm that the keyboard 20 is offline. Optionally, in some embodiments, in response to the keyboard 20 being offline, the SOC may also directly send a power-off instruction to the BUCK through the EN port, instructing the BUCK to immediately stop supplying power to the contact e, without observing the voltage change on the contact a.
[0066] 3. Screen off and sleep (state 6): When the tablet computer 10 and the keyboard 20 remain connected, the tablet computer 10 will enter the sleep mode after no user operation is detected for a long time or after the tablet computer 10 detects that the cover is closed.
[0067] First sleep strategy: refer to Figure 5A In some embodiments, after entering the sleep mode, the SOC may send an indication message to the MCU, indicating that the tablet computer 10 has entered the sleep mode. In response to the indication message, the MCU may output a low level through the UART-TX port to pull down the voltage on the data path (DATA). At this time, the voltage on the contact a drops from 1.72V when supporting communication to 0.01V (approximately 0V).
[0068] In the embodiment of the present application, after entering the sleep mode, the SOC does not instruct the BUCK to stop supplying power. Since the MCU is not powered off, the MCU can continuously detect the user's key operation. After detecting the user's key operation, the MCU can stop the low-level output on the UART-TX port, thereby waking up the tablet computer 10. After stopping the low-level output on the UART-TX port, the voltage on the contact a can be restored from 0.01V in sleep mode to 1.72V when supporting communication.
[0069] Second sleep strategy: refer to Figure 5BIn some embodiments, after entering the sleep mode, the SOC may send a power-off instruction to the BUCK. In response to the instruction, the BUCK immediately stops supplying power to the contact e. The voltage on the contact e drops from 3V when powered on to 0V. On the other hand, after entering the sleep mode, the PMU may stop supplying power to the contact a. At this time, the voltage on the contact a may drop from 1.72V when supporting communication to 0V.
[0070] In this way, after entering the sleep mode, the tablet computer 10 stops supplying power to the keyboard 20 , which is beneficial to reducing the power consumption of the tablet computer 10 and extending the battery life.
[0071] 4. When the screen is turned off and the keyboard 20 is removed (state 7): When the tablet computer 10 is connected to the keyboard 20 and the tablet computer 10 is in sleep mode, the user can directly take away the tablet computer 10. At this time, the connection between the tablet computer 10 and the keyboard 20 is disconnected, and the circuit is disconnected.
[0072] Based on the first sleep strategy: refer to Figure 5C In the dormant state, after the keyboard 20 is removed and the circuit is disconnected, the voltage on contact a recovers from 0.01V in the dormant state to 1.8V before the keyboard is connected. The SOC can identify the voltage change on the data contact a based on the sampled data on the ADC port. When it is identified that the voltage at point a recovers to 1.8V, the SOC can determine that the keyboard 20 is removed. Therefore, the SOC can send a power-off command to the BUCK through the EN port. In response to the above command, the BUCK immediately stops supplying power to contact e. The voltage on contact e drops from 3V to 0V.
[0073] Under the second sleep strategy, the voltages of the data contacts and the voltage contacts have all dropped to 0. At this time, whether the keyboard 20 is removed does not affect the tablet computer 10. Therefore, the tablet computer 10 does not need to detect whether the keyboard 20 is removed.
[0074] 5. Exit hibernation and resume working with bright screen (state 8): For the second sleep strategy, the user cannot wake up the tablet computer 10 by inputting keys on the keyboard 20. At this time, the user can only wake up the tablet computer 10 and exit the sleep mode by operating the tablet computer 10 (such as pressing the power button or double-clicking the screen).
[0075] refer to Figure 6After exiting the sleep mode, the SOC can send a power-on command to the BUCK, instructing the BUCK to supply power to contact e. The voltage of contact e changes from 0V when the power is off to 3V, thereby providing VDD input to the keyboard 20. On the other hand, after exiting the sleep mode, the PMU re-outputs the pull-up voltage. The voltage of contact a recovers from 0V when the power is off to 1.72V power supply when supporting communication. Accordingly, the SOC resumes sending heartbeat packets, and then continues to detect whether the keyboard 20 is removed in the working state through the heartbeat packets.
[0076] In summary, through Figure 3 With the circuit design shown, the tablet computer 10 can identify whether the keyboard 20 is connected by observing the level changes on the power contacts of the spring pin interface 11, without adding a new Hall sensor 12, which is beneficial to reducing the number of sensors, reducing the weight, volume and cost of the tablet computer 10, and also helping to reduce the magnetic field complexity of the tablet computer 10.
[0077] Based on the waveform difference of the ADC sampling data, that is, the difference in the specific voltage change on the data contact, the tablet computer 10 can also identify keyboard access, short circuit, stain attachment, and keyboard format.
[0078] For example, when a stain is attached, the level of the data contact will change. However, since the impedance of the stain is very small, the voltage of the data contact will be greater than the voltage when the keyboard is connected. For example, the voltage when the stain is attached is 0.3V, which is greater than the voltage of 0.17V when the keyboard is connected. The tablet computer 10 can identify whether there is a stain attached to the data contact based on the above voltage change. After identifying a short circuit or stain attachment, the tablet computer 10 stops supplying power to the power contact and stops providing VDD, thereby protecting the interface circuit and both devices. Optionally, after identifying a short circuit or stain attachment, the tablet computer 10 can also display a prompt message to instruct the user to clean the spring pin interface.
[0079] Different manufacturers have different choices for the resistor R4 in the keyboard 20 when manufacturing the keyboard 20. This will also result in different voltage division results on the data contacts when the keyboard 20 is connected. At this time, the tablet computer 10 can identify whether the currently connected keyboard is a keyboard from the same manufacturer based on the specific voltage change (i.e., keyboard format identification). Based on the above keyboard format identification, the manufacturer of the tablet computer 10 can perform anti-counterfeiting detection on the keyboard 20 to determine whether the keyboard 20 is a product of the same manufacturer. Optionally, when it is identified that the manufacturer of the keyboard 20 is different from that of the tablet computer 10, the tablet computer 10 can display a prompt message to indicate to the user that the keyboard 20 is not a product of the same manufacturer, and some functions may not be supported.
[0080] In some scenarios, the tablet computer 10 and the keyboard 20 may also use a low-level based communication protocol.
[0081] In view of this, an embodiment of the present application provides another detection circuit. Figure 7 It is a schematic diagram of another detection circuit provided in an embodiment of the present application.
[0082] like Figure 7 As shown, on the tablet computer 10 side, a resistor R2 is provided between the INT port of the SOC and the contact a, and a resistor R3 is provided between the ADC port and the contact a. On the keyboard 20 side, a resistor R4 is provided between the contact b and the contact d. That is, compared to Figure 3 The detection circuit shown, Figure 7 There is no connection between the contact point b and the contact point f of the detection circuit shown, and the resistor R5 and the diode D1 are not provided.
[0083] After the spring pin interface of the tablet computer 10 and the keyboard 20 is in contact, the voltage divider of R1 and R4 also causes the voltage on contact a to drop to 0.17V. After recognizing the above changes, the SOC can instruct the BUCK to supply power to contact e, so that the keyboard 20 receives the VDD input and then powers on. When using a low-level communication protocol, after the voltage on contact a drops to 0.17V, the tablet computer 10 and the keyboard 20 can communicate based on the 0.17V data path and send and receive signals for the user to perform keyboard input operations. At this time, the keyboard 20 does not need to connect contacts b and f through resistor R5 and diode D1 to raise the voltage on contact b.
[0084] When the keyboard 20 is removed, the circuit is disconnected, contacts a, c, and e are suspended, and the resistor voltage divider disappears. The voltage on contact a recovers from 0.17V when supporting communication to 1.8V before the keyboard 20 is connected. After recognizing the above changes, the SOC can instruct the BUCK to stop supplying power. The voltage on contact e drops from 3V to 0V to avoid leakage.
[0085] It should be noted that the embodiment of the present application does not limit the specific values of the resistors in the detection circuit, and can be set according to actual usage requirements. The values of the aforementioned resistors and the related voltages are only examples provided by the present application.
[0086] The detection circuit provided in the embodiment of the present application is not limited to the device combination of a tablet computer (main device) and a keyboard (external device), and can also be used for other device combinations of main devices and external devices. For example, the main device can also be a mobile phone, a television, a large conference screen, etc.; the external device can also be a camera, a speaker, etc. The embodiment of the present application does not limit this.
[0087] As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items. As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrase "when determining..." or "if (stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)", depending on the context.
[0088] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0089] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. An electronic device, characterized in that: The electronic device comprises: System on chip SOC, buck converter BUCK, first interface and power management unit PMU, The first interface includes a data contact a and a power contact e, the PMU is connected to one end of the first resistor R1, and the other end of R1 is connected to the data contact a; the data contact a is also connected to the interrupt INT port of the SOC, and the data contact a is also connected to the analog-to-digital conversion ADC port of the SOC; the power contact e is connected to the BUCK; the SOC is connected to the BUCK.
2. The electronic device according to claim 1, characterized in that: A second resistor R2 is provided between the data contact a and the INT port, and a third resistor R3 is provided between the data contact a and the ADC port.
3. The electronic device according to claim 1, characterized in that: The first interface is a spring pin interface.
4. An electronic device, characterized in that: The electronic device comprises: a system on chip (SOC) and a first interface. The first interface includes a data contact a, which is connected to a first port of the SOC, and the first port is used to detect the voltage on the data contact a; the SOC is used to determine that the first interface is connected to an external device when the voltage on the data contact a drops from a first value to a second value.
5. The electronic device according to claim 4, characterized in that: The first interface also includes a power contact e; The SOC is further configured to, after determining that the first interface is connected to an external device, supply power to the power contact e so that the voltage on the power contact e rises to a third value.
6. The electronic device according to claim 5, characterized in that: The SOC is also used to, after determining that the first interface is connected to an external device, send a heartbeat packet to the external device; and determine that the external device is removed when confirmation information of the heartbeat packet is not received within a timeout period.
7. The electronic device according to claim 5, characterized in that: The SOC is further configured to determine that the external device is removed when detecting that the voltage on the data contact a returns to the first value.
8. The electronic device according to claim 6 or 7, characterized in that: The SOC is further configured to stop supplying power to the power contact e after determining that the external device is removed.
9. The electronic device according to claim 4, characterized in that: The electronic device further includes a power management unit PMU, the PMU is connected to one end of the first resistor R1, the other end of R1 is connected to the data contact a, and the PMU is used to provide the first value voltage.
10. The electronic device according to claim 4, characterized in that: The data contact a is also connected to the second port of the SOC; when the voltage on the data contact a changes, the second port generates a first interrupt; The SOC is specifically used to, in response to the first interrupt, identify a change in the voltage on the data contact a, and determine that the first interface is connected to an external device when the voltage on the data contact a drops from a first value to a second value.
11. The electronic device according to claim 10, characterized in that: A second resistor R2 is provided between the data contact a and the second port, and a third resistor R3 is provided between the data contact a and the first port.
12. The electronic device according to claim 8, characterized in that: The electronic device further comprises a buck converter BUCK; the SOC is connected to one end of the BUCK, and the other end of the BUCK is connected to the power contact e; The SOC is specifically used to, after determining that the first interface is connected to an external device, send a first instruction to the BUCK, wherein the first instruction is used to instruct the BUCK to supply power to the power contact e; and after determining that the external device is removed, send a second instruction to the BUCK, wherein the second instruction is used to instruct the BUCK to stop supplying power to the power contact e.
13. An electronic device, characterized in that: The electronic device comprises: a microprogram controller MCU and a second interface, The second interface includes a data contact b, a ground contact d, and a power contact f. The data contact b is connected to the data transceiver port of the MCU, the power contact f is connected to the power input port of the MCU, and the ground contact d is grounded. The data contact b and the ground contact d are connected through a fourth resistor R4.
14. The electronic device according to claim 13, characterized in that: The data contact b is also connected to the power contact f through a fifth resistor R5 and a first unidirectional flow device, the input end of the first unidirectional flow device is connected to the power contact f, and the output end of the first unidirectional flow device is connected to the data contact b.
15. The electronic device according to claim 14, characterized in that: The first unidirectional flow device is any one of the following: a diode, a transistor, and a controllable switch.
16. The electronic device according to claim 13, characterized in that: The second interface is a spring pin interface.
17. The electronic device according to claim 14, characterized in that: The MCU is used for transmitting and receiving data based on the fourth value voltage after the voltage on the data contact b rises to the fourth value.
18. The electronic device according to claim 17, characterized in that: The MCU is further configured to pull down the voltage on the data contact b after receiving a sleep instruction.
19. The electronic device according to claim 18, characterized in that: The electronic device is specifically a keyboard, and the MCU is further used to restore the voltage on the data contact b to the fourth value after detecting a key operation of the user.
20. A detection system, characterized in that: The detection system includes a first electronic device and a second electronic device; The first electronic device comprises: a system on chip SOC and a first interface; the first interface comprises a data contact a, the data contact a is connected to a first port of the SOC, and the first port is used to detect the voltage on the data contact a; The second electronic device comprises: a microprogram controller MCU and a second interface; the second interface comprises a data contact b, when the first interface of the first electronic device is connected to the second interface of the second electronic device, the data contact a is connected to the data contact b; the data contact b is grounded through a fourth resistor R4; The SOC is used to When the voltage on the data contact a drops from a first value to a second value, it is determined that the first interface is connected to the second electronic device; when it is detected that the voltage on the data contact a returns to the first value, it is determined that the second electronic device is removed.
21. The detection system according to claim 20, characterized in that: The first interface further includes a power contact e, and the second interface further includes a power contact f, and when the first interface of the first electronic device is connected to the second interface of the second electronic device, the power contact e is connected to the power contact f; The SOC is also used to, After determining that the first interface is connected to the second electronic device, supplying power to the power contact e; After determining that the second electronic device is taken away, stop supplying power to the power contact e.
Citation Information
Patent Citations
Electronic device, peripheral device, and single-wire communication system
CN116028391A
Method and device for supplying power to keyboard through tablet computer and tablet computer
CN116048195A
Spring needle interface connection state detection method, combination device and electronic equipment
CN116699477A
Communication detection method and apparatus, device, system, and storage medium
WO2024001105A1
Power supply method, readable medium and electronic device
WO2024041491A1