CN108664365A - The detection method of the external accessory of a kind of electronic equipment - Google Patents

The detection method of the external accessory of a kind of electronic equipment Download PDF

Info

Publication number
CN108664365A
CN108664365A CN201710186170.7A CN201710186170A CN108664365A CN 108664365 A CN108664365 A CN 108664365A CN 201710186170 A CN201710186170 A CN 201710186170A CN 108664365 A CN108664365 A CN 108664365A
Authority
CN
China
Prior art keywords
accessory
detection method
external accessory
external
scl
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.)
Pending
Application number
CN201710186170.7A
Other languages
Chinese (zh)
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.)
Next Single Network Technology (shanghai) Co Ltd
Original Assignee
Next Single Network Technology (shanghai) 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 Next Single Network Technology (shanghai) Co Ltd filed Critical Next Single Network Technology (shanghai) Co Ltd
Priority to CN201710186170.7A priority Critical patent/CN108664365A/en
Publication of CN108664365A publication Critical patent/CN108664365A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The invention discloses the external accessory detection method of a kind of electronic equipment, especially a kind of detection method of the external accessory of low-power consumption internet of things equipment.By being multiplexed I2C interface reduces required connecting line quantity with GPIO interface.At least one master chip of electronic equipment host and two weak pull-down resistance being connected with master chip;At least containing there are one controllers and one can be operated in I in the master chip2The interface that C mode and GPIO patterns mutually switch, wherein controller are used to detect the access state of interface, and the specific works pattern of interface is arranged according to system requirements.After controller completes access differentiation, it can further pass through I2C mode reads the information in external accessory.The detection method that the present invention illustrates reduces connecting line quantity by interface duplex, and under the premise of not influencing original function, further holding equipment host is to accessing the automatic decision of accessory type and to the information collection and control of accessory.

Description

The detection method of the external accessory of a kind of electronic equipment
Technical field
The invention belongs to the detection circuit field of electronic equipment, more particularly to low-power consumption Internet of Things electronic equipment is external attached The detection method of accessory.
Background technology
Higher and higher in the rapid development of electronic technology, master chip integrated level, the function of electronic equipment is more and more multiple It is miscellaneous.But often different electronic device body hardware designs are identical, and the sensing in the external accessory of electronic equipment Device, executing agency difference.In order to enable electronic equipment can actively detect external accessory it is reliable insertion and It removes and reads which kind of accessory external accessory is, and then carry out corresponding digital independent and control to seem particularly It is important.Can at this time exist between electronic device body and external accessory a large amount of signal wire for be inserted into detect, attachment Identification and signal control, how under the premise of meeting functional requirement, and reduce to the greatest extent electronic product body and accessory it Between connecting line become an important project.
In the prior art, a kind of recognition methods for peripheral hardware is by product host software timed periodic (example Such as 100 milliseconds) inquired by I2C buses, if there is accessory is inserted into, then can read setting in accessory Standby information, the I2C read errors if accessory removes indicate that equipment is removed.The disadvantage of this pattern maximum is exactly The controller of host is constantly in periodic operating mode, and energy consumption greatly increases, and for LoRa, NB-IoT etc. is battery powered It is unacceptable for low-power consumption Internet of Things electronic equipment.
In the prior art, a kind of recognition methods for peripheral hardware is utilized by one or more GPIO interface Corresponding GPIO pull-up or the pattern of pull down resistor are identified on accessory.The pattern have it is simple in structure, it is at low cost Honest and clean feature.It is simple accessories in accessory, under the premise of type is less, such as the moulds such as LED light, a buzzer It is effective under formula.When accessory is all kinds of sophisticated sensors, accessory is needed to provide sensor type, sequence number, school Under the complex environments such as quasi- parameter, the pattern of the upper pull down resistors of GPIO cannot provide enough information, and simple GPIO patterns It is easy to be interfered the false judgment for leading to electronic equipment host by factors such as contact contamination, human body touchings.
In existing technology, a kind of recognition methods for peripheral hardware is simply by being pulled down on I2C buses and GPIO The composite mode of resistance carries out the detection of accessory.This method effectively prevents the drawbacks of above two method, but simple Superposition so that connecting line quantity between electronic product body and accessory greatly increases, not only increase the complexity of product Degree, cost, also influence the appearance of external equipment.The master chip of consumption inherently more valuable pin money simultaneously Source.
Invention content
The technical problem to be solved by the present invention is in order to overcome electronic product equipment in the prior art and accessory to detect With the various problems in identification, make full use of novel master chip external pin can with flexible configuration various operating modes spy Point is multiplexed GPIO and I2The pin of C buses, only increase by 2 weak pull-down resistance can be completed accessory be inserted into, remove it is reliable Detection, and further support main electronic product body to the automatic decision of accessory type and the number to accessing accessory According to reading or control.
Description of the drawings
Fig. 1 is a kind of detection circuit schematic diagram provided in an embodiment of the present invention.
Fig. 2 be it is provided in an embodiment of the present invention, it is a kind of more excellent when master chip itself does not support GPIO/I2C mode multiplexings Detection circuit schematic diagram.
Specific implementation mode
The present invention is to solve above-mentioned technical problem by following technical proposals, is hereinafter described by taking Fig. 1 as an example It is described in detail.
The detection method of the external accessory of a kind of electronic equipment, which is characterized in that including:Electronic equipment host (1) passes through External accessory (2), the I in electronic equipment host (1) are connected to by aerial lug (spring thimble etc.) (3)2C and GPIO Output reduces thimble quantity needed for aerial lug (3) to aerial lug (3) after matched circuit is compound;Electronic equipment Host (1) can the external accessory of automatic decision (2) whether connect system, external accessory can be further read after connection (2) facility information in, electronic equipment host (1) with external accessory (2) after connecting in I2The not busy gap of C communications can pass through GPIO port keeps monitoring whether external accessory keeps connecting.
The detection method, being effectively utilized master chip interface (6) can configure as needed in different working modes, knot It closes and utilizes I2C buses itself work required pull-up resistor R3 (13), and R4 (14) is used as detection means, using I2C buses itself Signal wire SDA (7) and SCL (8), do not increasing additional detections connecting line, do not influencing I2Itself reliable communicating of C buses, passes through Only increase by 2 weak pull-down resistance R1 (11), R2 (12) completes the reliable detection of external attached device (2).
The detection method, when external accessory (2) is not connected to electronic device host (1), CPU controls Device (5) it is default interface circuit (6) configure the operating mode that is inputted in GPIO high impedances, signal wire SDA (7) and SCL (8) via Weak pull-down resistance R1 (11) and R2 (12) are connected in power ground, and SDA (7) and SCL (8) is low level, cpu controller at this time (5) it is judged as that no attachment is connected to electronic device host (1), complete machine is in a dormant state.
The detection method, when external accessory (2) is connected to electronic device host (1), signal wire SDA (7) it is connected on power supply VCC via strong pull-up resistance R3 (13) and R4 (14) with SCL (8).Cpu controller (5), which detects, at this time connects The rising edge signal that mouth circuit (6) transmits enters level detection state, is all high level when reading SDA (7) and SCL (8) When, then judge there is external accessory (2) access.Then interface circuit (6) is configured to I by cpu controller (5)2The Working mould of C Formula, and pass through I2C agreements read the specific facility information of EEPROM (9) in external accessory (2) and can execute as needed Other relevant operations.All I2After C end of operation, interface circuit (6) is reconfigured back to the work of GPIO by cpu controller (5) Pattern, the high level of SDA (7) and SCL (8) holdings at this time.
The detection method, when external accessory (2) is connected correctly to electronic device host (1), SDA (7) It is always maintained at high level state with SCL (8), when external force removes external accessory (2), signal wire SDA (7) and SCL (8) lose external strong pull-up resistance R3 (13) and R4 (14), by electronic device host (1) weak pull-down resistance R1 (11) and R2 (12) moves low level to again.Cpu controller (5) receives the failing edge signal that interface circuit (6) transmits and enters level inspection Survey state then judges that external accessory (2) is removed when reading SDA (7) and SCL (8) is low level.
The detection method, signal wire SDA (7) and SCL (8) are connected to weak pull-down resistance R1 (11) and R2 simultaneously in host (12), strong pull-up resistance R3 (13) and R4 (14) are connected in accessory.When being inserted into and removing judgement, CPU Controller (5) while the state for reading SDA (7) and SCL (8) is judged greatly reduces external interference and human body touch False triggering.
The detection method, when external attached accessory (2) does not access, weak pull-down resistance R1 (11) and R2 (12) Resistance value is chosen very big (such as 20M ohm), while interface circuit (6) configures the operating mode inputted in GPIO high impedances, has The electric leakage of reduction system is imitated, battery working time when electronic equipment is not inserted into attachment is extended.
More preferably, the connection method, in the I2C buses continue with I after completing attachment detection2C buses are to accessory Interior sensor/other peripheral hardwares (10) carry out digital independent or control.
More preferably, when certain master chips can not simply switch I2It, can be with when C operating modes and GPIO operating modes Two GPIO pins are directly connected on I2On the pin of C, connection method figure is shown in 2, can play the identical effect of the present invention.
The detection method of the external accessory of electronic equipment of the present invention is more simple, at least in electronic equipment host As long as the reliable insertion of equipment can be completed with 4 pins of external accessory, remove detection;Accessory type specifying information Identification and digital independent or the control of accessory.Meeting the function of same electronic equipment host difference accessory needs It asks, enormously simplifies external interface.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that these It is merely illustrative of, protection scope of the present invention has appended claims limited.Those skilled in the art is not carrying on the back Under the premise of from the principle and substance of the present invention, change or modification can be made to embodiment of above, but these changes and Modification falls within protection scope of the present invention.

Claims (9)

1. the detection method of the external accessory of a kind of electronic equipment, including electronic equipment host(1)Via aerial lug(Bullet Spring thimble etc.)(3)It is connected to external accessory(2), electronic equipment host(1)Interior I2The matched circuits of C and GPIO are compound After export to aerial lug(3), reduce aerial lug(3)Required thimble quantity;Electronic equipment host(1)It can sentence automatically Break external accessory(2)Whether system in connection, external accessory can be further read after connection(2)Interior equipment letter Breath, electronic equipment host(1)With external accessory(2)In I after connection2The not busy gap of C communications can be kept supervising by GPIO port Survey whether external accessory keeps connecting.
2. detection method according to claim 1, which is characterized in that be effectively utilized master chip interface(6)It can basis It needs to configure in different working modes, is combined I2C buses itself work required strong pull-up resistance R3, and R4 is as detection Means, using I2The signal wire SDA of C buses itself(6)With SCL(7), do not increasing additional detections connecting line, do not influencing I2C is total Line itself reliable communicating completes external attached device by only increasing by 2 weak pull-down resistance R1, R2(2)Reliable detection.
3. detection method according to claim 1, which is characterized in that in external accessory(2)It is not connected to electronics Device host(1)When, cpu controller(5)It is default interface circuit (6) to be configured the Working mould inputted in GPIO high impedances Formula, signal wire SDA(6)It is connected in power ground via weak pull-down resistance R1 and R2 with SCL (7), SDA (6) and SCL (7) is equal at this time It is low level, cpu controller is judged as that no attachment is connected to electronic device host(1), complete machine is in a dormant state.
4. detection method according to claim 1, which is characterized in that in external accessory(2)It is connected to electronic device Host(1)When, signal wire SDA(6)It is connected on power supply VCC via strong pull-up resistance R3 and R4 with SCL (7);CPU is controlled at this time Device processed(5)Detect that the rising edge signal that interface circuit (6) transmits enters level detection state, when reading SDA(6)With When being all high level in SCL (7), then judge there is external accessory(2)Access;Then cpu controller(5)By interface circuit (6) it is configured to I2The operating mode of C, and pass through I2C agreements read external accessory(2)Middle EEPROM(9)Specific equipment letter It ceases and other relevant operations can be executed as needed;All I2After C end of operation, cpu controller(5)By interface circuit (6) weight Newly match the operating mode for putting back into GPIO, at this time SDA(6)High level is kept with SCL (7).
5. detection method according to claim 1, which is characterized in that in external accessory(2)It is connected correctly to electronics Device host(1)When, SDA(6)It is always maintained at high level state with SCL (7), when external force removes external accessory(2) When, signal wire SDA(6)External strong pull-up resistance R3 and R4 are lost with SCL (7), by electronic device host(1)Interior is weak Pull down resistor R1 and R2 move low level to again;Cpu controller(5)The failing edge signal that interface circuit (6) transmits is received to enter To level detection state, when reading SDA(6)When being low level with SCL (7), then external accessory is judged(2)It has moved It removes.
6. detection method according to claim 1, which is characterized in that signal wire SDA(6)With SCL (7) in host simultaneously It is connected to weak pull-down resistance R1 and R2, strong pull-up resistance R3 and R4 are connected in accessory;It is being inserted into and is being removed judgement When, cpu controller(5)Read SDA simultaneously(6)Judged with the state of SCL (7), greatly reduces external interference and people The false triggering that body touches.
7. detection method according to claim 1, which is characterized in that when external attached accessory(2)When access, Weak pull-down resistance R1 and R2 resistance value is chosen very big(Such as 20M ohm), while interface circuit (6) configuration is defeated in GPIO high impedances The operating mode entered effectively reduces the electric leakage of system, extends battery working time when electronic equipment is not inserted into attachment.
8. more preferably, detection method according to claim 1, in the I2C buses continue with I after completing attachment detection2C Bus is to the sensor in accessory/other electronic devices(10)Carry out digital independent.
9. more preferably, detection method according to claim 1, when certain master chips can not simply switch I2C operating modes When with GPIO operating modes, two GPIO pins can be directly connected on I2On the pin of C, connection method Fig. 2, Ke Yiqi To the identical effect of the present invention.
CN201710186170.7A 2017-03-27 2017-03-27 The detection method of the external accessory of a kind of electronic equipment Pending CN108664365A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710186170.7A CN108664365A (en) 2017-03-27 2017-03-27 The detection method of the external accessory of a kind of electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710186170.7A CN108664365A (en) 2017-03-27 2017-03-27 The detection method of the external accessory of a kind of electronic equipment

Publications (1)

Publication Number Publication Date
CN108664365A true CN108664365A (en) 2018-10-16

Family

ID=63785391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710186170.7A Pending CN108664365A (en) 2017-03-27 2017-03-27 The detection method of the external accessory of a kind of electronic equipment

Country Status (1)

Country Link
CN (1) CN108664365A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110988746A (en) * 2019-12-11 2020-04-10 昆山丘钛微电子科技有限公司 Module connection state detection device and method
CN112667548A (en) * 2020-12-25 2021-04-16 海宁奕斯伟集成电路设计有限公司 Communication interface, device and method for supporting bidirectional two-wire system synchronous serial bus
CN113641611A (en) * 2021-06-30 2021-11-12 荣耀终端有限公司 I2C interface circuit, control method thereof and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329663A (en) * 2008-07-31 2008-12-24 炬力集成电路设计有限公司 Apparatus and method for implementing pin time-sharing multiplexing
CN102169468A (en) * 2011-03-22 2011-08-31 惠州Tcl移动通信有限公司 Identification method for external module and electronic equipment using same
US20120059489A1 (en) * 2010-09-08 2012-03-08 Integrated Device Technology, Inc. System and method for communication handshaking between processors
CN102821176A (en) * 2012-08-22 2012-12-12 上海华勤通讯技术有限公司 Mobile terminal and external equipment detection method thereof
CN104459376A (en) * 2014-11-18 2015-03-25 青岛海信移动通信技术股份有限公司 Interface circuit and peripheral detection method and external sensor based on interface circuit

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329663A (en) * 2008-07-31 2008-12-24 炬力集成电路设计有限公司 Apparatus and method for implementing pin time-sharing multiplexing
US20120059489A1 (en) * 2010-09-08 2012-03-08 Integrated Device Technology, Inc. System and method for communication handshaking between processors
CN102169468A (en) * 2011-03-22 2011-08-31 惠州Tcl移动通信有限公司 Identification method for external module and electronic equipment using same
CN102821176A (en) * 2012-08-22 2012-12-12 上海华勤通讯技术有限公司 Mobile terminal and external equipment detection method thereof
CN104459376A (en) * 2014-11-18 2015-03-25 青岛海信移动通信技术股份有限公司 Interface circuit and peripheral detection method and external sensor based on interface circuit

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110988746A (en) * 2019-12-11 2020-04-10 昆山丘钛微电子科技有限公司 Module connection state detection device and method
CN112667548A (en) * 2020-12-25 2021-04-16 海宁奕斯伟集成电路设计有限公司 Communication interface, device and method for supporting bidirectional two-wire system synchronous serial bus
CN113641611A (en) * 2021-06-30 2021-11-12 荣耀终端有限公司 I2C interface circuit, control method thereof and electronic equipment
CN113641611B (en) * 2021-06-30 2022-07-15 荣耀终端有限公司 I2C interface circuit, control method thereof and electronic equipment

Similar Documents

Publication Publication Date Title
CN104252435B (en) Varistructure intelligence interface and its collocation method based on dynamic reconfigurable FPGA
CN108664365A (en) The detection method of the external accessory of a kind of electronic equipment
CN103019991A (en) Interface system, switching method, USB key and UART terminal
CN205786933U (en) One kind of multiple style interface testing moulds
CN109753777A (en) A kind of personal identification method, device, storage medium and mobile terminal
TWI810260B (en) Automatic usb host detection and port configuration
CN104200555A (en) Method and device for finger ring gesture door opening
CN106776183A (en) A kind of debug circuit, debugging apparatus, modulating system and a kind of electronic equipment
CN108228509A (en) A kind of USB interface switching device and electronic equipment
CN108574897A (en) A kind of pleasant formula device wearing detection method
CN109542465A (en) Method for writing data, system, device, equipment and the medium of IC chip
CN104101100B (en) Water heater and control method thereof
CN109254894B (en) Device and method for monitoring heartbeat of chip
CN105892609B (en) A kind of method and intelligent terminal of terminal booting and identification memory card synchronous operation
CN104459376B (en) A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit
CN206601695U (en) A kind of burning device for detecting and indicating objective chip state
CN201607724U (en) USB HUB supporting multi-threaded operation
CN106774816A (en) Portable electronic system
CN205983460U (en) Serial receiving and dispatching interface module and USB interface module sharing port circuit
CN104581527B (en) A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit
CN106502911A (en) Multiple terminals access device
CN206459767U (en) The supervising device of supervisory circuit and electronic equipment
CN202404483U (en) Embedded network server equipment
CN116931462A (en) Site station main control unit based on domestic main control chip and control method
CN107423242A (en) SD interface and the electronic installation and method of USB interface multiplexing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20181016