CN107256187A - SD card physical switch detection circuit, method and SD card closing detecting apparatus - Google Patents
SD card physical switch detection circuit, method and SD card closing detecting apparatus Download PDFInfo
- Publication number
- CN107256187A CN107256187A CN201710457277.0A CN201710457277A CN107256187A CN 107256187 A CN107256187 A CN 107256187A CN 201710457277 A CN201710457277 A CN 201710457277A CN 107256187 A CN107256187 A CN 107256187A
- Authority
- CN
- China
- Prior art keywords
- card
- switch
- state
- physical switch
- gpio port
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/2221—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
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)
- Details Of Connecting Devices For Male And Female Coupling (AREA)
Abstract
Circuit is detected this application discloses a kind of SD card physical switch, including:PCH chips, SD card connector and power circuit;Wherein, the GPIO port of the PCH chips is connected with the WP_Switch pins of the SD card connector;The power circuit is connected with the connecting line of the GPIO port and the WP_Switch pins.The detection circuit detects the corresponding WP_Switch pins of SD card physical switch by GPIO port, so that BIOS learns the state of SD card physical switch by the state of GPIO port and makes prompting to user or tester, facilitate testing process and user uses, shorten the research and development test period of product.Disclosed herein as well is a kind of SD card physical switch detection method and SD card closing detecting apparatus, with above-mentioned same beneficial effect.
Description
Technical field
The application is related to SD card field, more particularly to a kind of SD card physical switch detection circuit, method and SD card switch
Detection means.
Background technology
(Secure Digital Memory Card, Chinese is referred to as SD card:SD card) it is that a kind of semiconductor quick flashing that is based on is remembered
The memory device sizes of new generation of device are recalled just as the SD memory cards of a stamp, weight only has 2 grams, but possess high memory hold
Amount, greatly rapid data transmission rate, mobile flexibility and good security.The SD card speed of service is faster than mmc card a lot,
And it is more popular, cheap, it is commonly used on camera, notebook, industrial control equipment and server.
SD card has two states, and one kind is readable write state, and one kind is write-protect state.When using SD card, meeting
The problem of running into such, after SD card is set to unlock by system, now lock or unlock is by SD card physics itself
Switch control.When factory production line test personnel test SD card, BIOS can not detect SD card either with or without lock, if tester
SD card lock is lived, this card can not be write information to when being tested with related tool, test can report an error, and cause tester unnecessary
Trouble.Meanwhile, when SD card is set to unlock and after user is by SD card lock by system, user can not write data to SD card, draw
Play the unnecessary trouble of user.
The content of the invention
The purpose of the application is to provide a kind of SD card physical switch detection circuit and method and SD card closing detecting apparatus, real
Now to the detecting of SD card physical switch state, shorten the research and development test period of product, reduce the inconvenience caused to user.
In order to solve the above technical problems, this application provides a kind of circuit for detecting SD card physical switch state, there is provided such as
Lower technical scheme:
SD card physical switch detection circuit includes:PCH chips, SD card connector and power circuit;
Wherein, the GPIO port of the PCH chips is connected with the WP_Switch pins of the SD card connector;
The power circuit is connected with the connecting line of the GPIO port and the WP_Switch pins;
The GPIO port of the PCH chips obtains WP_Switch pin state, and true according to the pin state
Determine SD card physical switch state.
Wherein, the detection circuit includes:
When the WP_Switch pins of the SD card connector are hanging, the physical switch of SD card disconnects;
During the WP_Switch pins ground connection of the SD card connector, the physical switch closure of SD card.
Wherein, the power circuit includes:
The resistance of 3V voltages and 10K Ω.
The application also provides a kind of SD card closing detecting apparatus, including the detection circuit described in above-mentioned any one.
The application also provides a kind of SD card physical switch detection method, and methods described includes:
After the instruction for receiving detection SD card physical switch, the GPIO port state on PCH chips is determined;Wherein, institute
The second GPIO port is stated with the WP_Switch pins on SD card connector to be connected;
When the GPIO port is in first state, the physical switch of SD card disconnects;
When the GPIO port is in the second state, the physical switch closure of SD card.
Wherein, the state that the first state is grounded for the WP_Switch pins of the SD card connector;Second shape
State is the hanging state of the WP_Switch pins of the SD card connector.
Wherein, methods described also includes:
During the WP_Switch pins ground connection of SD card connector so that the WP pins on SD card control chip are in low level,
The SD card control chip control SD card logic switch closure.
Wherein, also include after the second GPIO port state on the determination PCH chips:
Suggestion device is according to the second GPIO port condition prompting SD card physical switch state.
This application provides a kind of circuit for detecting SD card physical switch, by the improvement to available circuit, in PCH chips
Upper to detect the corresponding pin state of physical switch using a GPIO port, SD card can not be detected by solving BIOS in the prior art
Research and development testing efficiency is low caused by physical switch state and the problem of Consumer's Experience perceptual difference, can test start when or system
User is pointed out in time during start, research and development of products test period is shortened.The application also provides a kind of SD card physical switch detection side
Method and SD card closing detecting apparatus, with above-mentioned beneficial effect, here is omitted.
Brief description of the drawings
, below will be to institute in prior art and embodiment in order to illustrate more clearly of the technical scheme in the embodiment of the present application
The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the application
Example, for those of ordinary skill in the art, on the premise of not paying creative work, can also be obtained according to these accompanying drawings
Obtain other accompanying drawings.
Circuit diagram when Fig. 1 is detection SD card in the prior art;
Fig. 2 is that the embodiment of the present application realizes the corresponding circuit diagram of detection SD card physical switch function;
A kind of circuit diagram for SD card closing detecting apparatus that Fig. 3 provides for the embodiment of the present application;
A kind of flow chart for SD card physical switch detection method that Fig. 4 provides for the embodiment of the present application.
Embodiment
The application provides a kind of circuit that can detect SD card physical switch state, method and SD card closing detecting apparatus,
The detecting to SD card physical switch state is realized, shortens the research and development test period of product, the inconvenience caused to user is reduced.
Such as Fig. 1, circuit diagram when Fig. 1 is detection SD card in the prior art.When system sets SD card to be lock or SD card
When physical switch is pushed closure state, SD is in write-protect state, and the operation that at this moment can be carried out only has reading.Corresponding circuit
The GPIO0 ports of middle PCH chips are low level, and metal-oxide-semiconductor is not turned on, the WP of the WP pins of SD control chips by SD card connector
Switch control:If now physical switch is disconnected, the pin of WP switches is hanging, and the WP pins of SD card control chip are in high electricity
Flat, therefore SD card in write-protect state, can only be read;If now physical switch is closed, the pin ground connection of WP switches, SD card control
The WP pins of coremaking piece are in low level, and SD card can be read also write.
For SD card, switch closed pair answers unlock, switches off correspondence lock.For SD card state, SD
Lock shows that SD card is in write-protect state, can only read;SD unlock show that SD card is in readable write state.
To make the purpose, technical scheme and advantage of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
In accompanying drawing, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described embodiment is
Some embodiments of the present application, rather than whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of the application protection.
Embodiment one
Fig. 2 is refer to, Fig. 2 is that the present embodiment realizes the corresponding circuit diagram of detection SD card physical switch function.
The partial circuit includes PCH chips 100, SD card connector 300 and power circuit 200, wherein, the PCH chips
100 GPIO port is connected with the WP_Switch pins of the SD card connector 300;The power circuit 200 and the GPIO
Port is connected with the connecting line of the WP_Switch pins;
When the WP_Switch pins of the SD card connector 300 are grounded, the GPIO port on PCH chips 100 detects low
Level, corresponding SD card physical switch is in closure state;When WP_Switch pins are hanging, GPIO port detects high level,
When corresponding SD card physical switch is off.
Pull up or pull a down can also be set to make a change the level of GPIO port so that in WP_
GPIO port is high level when Switch pins are grounded, and GPIO port is low level when WP_Switch pins are hanging.Or have it
His similar change, all should be the application's as long as GPIO port and WP_Switch corresponding relation can be showed clearly
Within protection domain.I.e. the present embodiment does not limit the corresponding states of GPIO port and corresponding SD card physical switch, as long as that is,
Corresponding SD card physical switch state can be determined according to the signal of GPIO port.
The present embodiment does not limit the concrete form of power circuit, as long as adaptability electric energy can be provided.Optionally,
The power circuit can include a voltage and a resistance because the GPIO port of PCH chips 100 generally be+3V
Electricity, therefore power circuit is generally also+3V electricity, is kept consistent with the rated voltage of GPIO port.Resistance mainly plays protection
The resistance of the effect of circuit, such as 10K Ω, power circuit primarily serves the effect of power supply, as long as can be powered i.e. to GPIO1 ports
Can, its position for accessing circuit is not limited.Resistance first end in the power supply point road is connected with voltage, and the second end is linked into institute
In the connecting line for stating GPIO port and the WP_Switch pins.
Embodiment two
SD card closing detecting apparatus as shown in Figure 3 include PCH chips, SD card connector, SD card control chip, metal-oxide-semiconductor with
And power circuit;Wherein, the GPIO1 ports of the PCH chips are connected with the WP_Switch pins of the SD card connector;
The power circuit is connected with the connecting line of the GPIO1 ports and the WP_Switch pins;
The GPIO1 ports of the PCH chips obtain WP_Switch pin state, and according to the pin state
Determine SD card physical switch state.
The grid of metal-oxide-semiconductor is connected with the GPIO0 ports of PCH chips, and source electrode is connected with the WP_Switch of SD card connector,
Drain electrode is connected with the WP pins of SD card control chip.
The power circuit includes+3V a voltages and 10K Ω resistance, because the GPIO port of PCH chips is used
Be+3V electricity, power circuit be also+3V electricity, keep it is consistent with the voltage of GPIO port.Power circuit is primarily served
The effect of power supply, as long as the rated voltage of GPIO1 ports can be given, its position for accessing circuit is not limited.
When system is needed to SD card lock, the GPIO0 ports of PCH chips are dragged down level, SD card control chip by BIOS
WP pins be driven high level, SD card write-protect during high level can only be read.When system is needed to SD card unlock, BIOS handles
PCH chip GPIO0 are drawn high port, and the WP pins pin of SD card control chip is switched by WP to be controlled, that is, by the physics of SD card
Switch control.
But when system is needed to SD card unlock, now the GPIO0 ports of PCH chips are high level, as closure SD
During the physical switch of card, the WP_Switch pins ground connection of SD card connector, corresponding WP pins reform into low level, SD card control
Chip controls SD card logic switch closure processed, now the GPIO1 ports of PCH chips, which are detected in low level, BIOS, sets SD card
unlock;When opening the physical switch of SD card, the WP_Switch pins of SD card connector are hanging, correspondence WP pin high level,
SD card control chip control SD card logic switch is disconnected, and the GPIO1 ports of PCH chips are detected to be set in high level, BIOS
SD card lock;So the state that BIOS can judge SD card by the low and high level of this port of the GPIO1 of PCH chips is can
Read-write or write-protect.
The access circuit of GPIO1 ports can also be made and changed, increased other circuits and enable GPIO1 ports to show it
He plants different states.Even introducing a circuit causes GPIO1 ports physical switch when detecting low level to disconnect, high electricity
Usually physical switch closure etc. mode should also be as within the protection domain of the application.
Accordingly, BIOS points out the shape of tester's SD card according to the state of GPIO1 ports under corresponding test formula
State, if needing to set SD switch to be arranged to unlock by hand when SD card is in lock states.If at SD card physical switch
In closure state, then test process is normally carried out.
Embodiment three
Fig. 4 is refer to, Fig. 4 is the corresponding flow chart of the present embodiment
S101:Receive the instruction of detection SD card physical switch;
Receiving the instruction of detection SD card physical switch includes the artificial instruction for sending request detection SD card physical switch, also may be used
Be tester open test machine setup test SD card when machine can send automatically the instruction request inquire about SD card thing
On off state is managed, or user's system in system boot sends the instruction etc..
S102:Determine the second GPIO port state on PCH chips;Wherein, second GPIO port is connected with SD card
WP_Switch pins on device are connected;
The second GPIO port on PCH chips is joined directly together with the WP_Switch pins on SD card connector, can be direct
Detect the state of WP_Switch pins.Certainly, in addition it is also necessary to the power circuit of a power supply, power circuit includes a voltage
And resistance:The voltage of circuit meets the rated voltage requirement of GPIO port, the protective resistance with a protection circuit.
S103:When second GPIO port is in first state, the physical switch of SD card disconnects;
When second GPIO port is in the second state, the physical switch closure of SD card.
When the physical switch of SD card disconnects, that is, WP_Switch pin is hanging, and now the second GPIO port is detected
To high level, in high level state.
After the physical switch closure of SD card, namely WP_Switch pin is grounded, and now the second GPIO port is detected
Low level, in low level state.
The access circuit of second GPIO port can also be made and changed, increased other circuits and enable the second GPIO port
Show other kind of different state.Even change port setting and such as cause the 2nd GPIO ends using pull up or pull down
Mouth physical switch when detecting low level disconnects, and physical switch closure etc. mode should also be as the guarantor in the application during high level
Within the scope of shield.
In addition, when the WP_Switch pins ground connection of SD card connector, the WP pins on SD card control chip are low electricity
Flat, now control chip will control SD card logic switch to close;Accordingly, when WP_Switch pins are hanging, SD card control core
WO pins on piece are high level, and now control chip will control SD card logic switch to disconnect.
It is preferred that, after SD card physical switch state is detected, a suggestion device can also be increased.BIOS is being detected
After the state of second GPIO port, relative program can be called to remind tester or other users.
The method of prompting has a lot, if tester, it is possible to use a LED is as indicator lamp, and indicator lamp is bright
When represent SD card physical switch disconnect, it is necessary to manual closing.The forms such as prompt tone can also be utilized.For other users,
Can be detected in system boot after SD card physical switch disconnects points out user's SD card physical switch to disconnect in the form of prompting frame.
Example IV
The application can apply to following scene:
When tester tests SD card on machine, test machine is opened, at this moment starts SD card physical switch testing process:
Judge the state with the GPIO port that WP_Switch pins are connected on SD card connector on PCH chips.
When SD card physical switch is closed, the WP_Switch pins ground connection being connected with GPIO port, WP pins are in low electricity
It is flat, SD card control chip control SD card logic switch unlock, therefore GPIO port detects low level, BIOS detects GPIO
The low level of port is to learn that SD card physical switch is closure state, and the indicator lamp of suggestion device gives a green light, and testing process is normal
Carry out.
When SD card physical switch disconnects, the WP_Switch pins being connected with GPIO port are hanging, and WP pins are in high electricity
It is flat, SD card control chip control SD card logic switch lock, therefore GPIO port detects high level, BIOS detects GPIO ends
The high level of mouth is to learn that SD card physical switch is off-state, influence test.Now BIOS sends alarm to suggestion device and disappeared
Breath, the indicator lamp of suggestion device sends out a warning, and points out tester's SD card physical switch not close.
The embodiment of each in this specification is described by the way of progressive, and what each embodiment was stressed is and other
Between the difference of embodiment, each embodiment identical similar portion mutually referring to.It should also be noted that, in this theory
In bright book, such as first and second or the like relational terms be used merely to an entity or operation and another entity or
Operation makes a distinction, and not necessarily require or imply these entities or operation between exist any this actual relation or
Sequentially.Moreover, term " comprising ", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that
Process, method, article or equipment including a series of key elements not only include those key elements, but also including being not expressly set out
Other key elements, or also include for this process, method, article or the intrinsic key element of equipment.In not more limits
In the case of system, the key element limited by sentence "including a ...", it is not excluded that the process including the key element, method,
Also there is other identical element in article or equipment.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or use the application.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can in other embodiments be realized in the case where not departing from spirit herein or scope.Therefore, the application
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.
Claims (8)
1. a kind of SD card physical switch detects circuit, it is characterised in that including:PCH chips, SD card connector and power supply electricity
Road;
Wherein, the GPIO port of the PCH chips is connected with the WP_Switch pins of the SD card connector;
The power circuit is connected with the connecting line of the GPIO port and the WP_Switch pins;
The GPIO port of the PCH chips obtains WP_Switch pin state, and determines SD according to the pin state
Card physical switch state.
2. SD card physical switch according to claim 1 detects circuit, it is characterised in that the detection circuit includes:
When the WP_Switch pins of the SD card connector are hanging, the physical switch of SD card disconnects;
During the WP_Switch pins ground connection of the SD card connector, the physical switch closure of SD card.
3. SD card physical switch according to claim 1 or 2 detects circuit, it is characterised in that the power circuit includes:
The resistance of 3V voltages and 10K Ω.
4. a kind of SD card closing detecting apparatus, it is characterised in that including the SD card described in any one in the claims 1-3
Physical switch detects circuit.
5. a kind of SD card physical switch detection method, it is characterised in that methods described includes:
After the instruction for receiving detection SD card physical switch, the GPIO port state on PCH chips is determined;Wherein, described
Two GPIO ports are connected with the WP_Switch pins on SD card connector;
When the GPIO port is in first state, the physical switch of SD card disconnects;
When the GPIO port is in the second state, the physical switch closure of SD card.
6. detection method according to claim 5, it is characterised in that the first state is the SD card connector
The state of WP_Switch pins ground connection;Second state is the hanging shape of the WP_Switch pins of the SD card connector
State.
7. detection method according to claim 6, it is characterised in that methods described also includes:
During the WP_Switch pins ground connection of SD card connector so that the WP pins on SD card control chip are in low level, make institute
State SD card control chip control SD card logic switch closure.
8. detection method according to claim 5, it is characterised in that the second GPIO port on the determination PCH chips
Also include after state:
Suggestion device is according to the second GPIO port condition prompting SD card physical switch state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710457277.0A CN107256187A (en) | 2017-06-16 | 2017-06-16 | SD card physical switch detection circuit, method and SD card closing detecting apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710457277.0A CN107256187A (en) | 2017-06-16 | 2017-06-16 | SD card physical switch detection circuit, method and SD card closing detecting apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107256187A true CN107256187A (en) | 2017-10-17 |
Family
ID=60023838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710457277.0A Pending CN107256187A (en) | 2017-06-16 | 2017-06-16 | SD card physical switch detection circuit, method and SD card closing detecting apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107256187A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7836236B2 (en) * | 2004-02-12 | 2010-11-16 | Super Talent Electronics, Inc. | Extended secure-digital (SD) devices and hosts |
CN106776183A (en) * | 2016-12-22 | 2017-05-31 | 歌尔科技有限公司 | A kind of debug circuit, debugging apparatus, modulating system and a kind of electronic equipment |
-
2017
- 2017-06-16 CN CN201710457277.0A patent/CN107256187A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7836236B2 (en) * | 2004-02-12 | 2010-11-16 | Super Talent Electronics, Inc. | Extended secure-digital (SD) devices and hosts |
CN106776183A (en) * | 2016-12-22 | 2017-05-31 | 歌尔科技有限公司 | A kind of debug circuit, debugging apparatus, modulating system and a kind of electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103427460B (en) | A kind of power supply terminal, charge control method and device | |
CN104103924B (en) | High definition multimedia interface hdmi interface unit and multimedia terminal | |
US20110314201A1 (en) | Method and device for identifying universal serial bus (usb) insertion or charger insertion of mobile terminal | |
CN107273313A (en) | The USB mode of USB interface and the compatibility method and device of MHL patterns | |
CN208109980U (en) | USB on off test device and its system | |
CN109298266A (en) | Test macro, test method, test device and storage medium | |
Burroughs | X-10 home automation using the PIC16F877A | |
CN105071489B (en) | A kind of charging method and device of the terminal with data exchanging function | |
CN206832958U (en) | Fault testing apparatus | |
CN108548956A (en) | Power consumption test device and method for intelligent terminal | |
CN205450246U (en) | Portable smart electric meter supplements fault detection device with money | |
CN207219048U (en) | SIM card batch detecting device | |
CN109252804A (en) | Garage door remote control system and method based on GSM | |
CN105445604A (en) | USB 3.1 C type cable automatic test method | |
CN107256187A (en) | SD card physical switch detection circuit, method and SD card closing detecting apparatus | |
CN107742909A (en) | Charging circuit, intelligent terminal and its charging method | |
CN107333154A (en) | Separate television control system | |
CN204256725U (en) | A kind of pick-up unit | |
CN106502911A (en) | Multiple terminals access device | |
CN105676029A (en) | Intelligent detector compatible with rapid charger and test method of detector | |
CN105242757A (en) | Connection structure of tablet personal computer and base | |
CN104866451B (en) | A kind of electronic equipment, information processing method and control circuit | |
CN104991186B (en) | A kind of automatic recognition system of vehicle switch on-off function and recognition methods | |
CN107271766A (en) | A kind of power consumption detection method, consumption power detection circuit and mobile terminal | |
CN206363299U (en) | A kind of control circuit of RAM card |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171017 |