CN102831924A - Control method and control circuit for SD card - Google Patents

Control method and control circuit for SD card Download PDF

Info

Publication number
CN102831924A
CN102831924A CN2012102896397A CN201210289639A CN102831924A CN 102831924 A CN102831924 A CN 102831924A CN 2012102896397 A CN2012102896397 A CN 2012102896397A CN 201210289639 A CN201210289639 A CN 201210289639A CN 102831924 A CN102831924 A CN 102831924A
Authority
CN
China
Prior art keywords
card
pin
cpu
routine
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012102896397A
Other languages
Chinese (zh)
Other versions
CN102831924B (en
Inventor
李奎星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia Technology 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 Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201210289639.7A priority Critical patent/CN102831924B/en
Publication of CN102831924A publication Critical patent/CN102831924A/en
Application granted granted Critical
Publication of CN102831924B publication Critical patent/CN102831924B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a control method and a control circuit for an SD card. The method comprises the following steps that: CPU starts a boot program; the boot program detects the electrical levels of general IO pins connected with an ECC indicating circuit and determines the position of a set-up program based on the detected electrical levels; the boot program acquires the set-up program based on the determined position and starts the set-up program; and after the set-up program is running, the CPU controls the SD card through an SD interface, wherein a part of the pins in the SD interface are reused pins for ECC detection. According to the invention, the SD card is controlled by using the SD interface of the CPU, and ECC detection is realized by utilizing other general IO pins to simulate functions of ECC detection pins; and therefore, normal starting of the CPU can be guaranteed, an SD card control chip is not used for controlling of the SD card, and the purpose of saving circuit cost and circuit space is achieved.

Description

SD card control method and control circuit
Technical field
The present invention relates to memory technology, relate in particular to a kind of SD card control method and control circuit.
Background technology
SD card (Secure Digital Memory Card; Safe digital card) is a kind of memory device of new generation of based semiconductor fast-flash memory device; It is used on mancarried device widely, for example digital camera, personal digital assistant (PDA) and multimedia player etc.At present, the SD card is used for MP3 walkman, DV, digital camera, mobile phone etc. more, also is useful on the notebook computer.
Three kinds of transmission modes of the general support of SD card: a kind of is SPI (Serial Peripheral Interface, Serial Peripheral Interface (SPI)) pattern (independent sequence input and sequence output); Another kind is 1 SD pattern (independent instruction and data channel, an exclusive transformat); Another is 4 SD patterns (supporting the data parallel transmission of four bit wides).
The low speed cartoon often adopts SPI and 1 SD transmission mode; Card is supported 0~100 mbit/data transmission rate at a high speed, then adopts 4 SD transmission modes.Jumbo SD card generally all is to block at a high speed, adopts 4 SD transmission modes.
Control mode for jumbo SD card; Usually as shown in Figure 1; CPU (Central Processing Unit, central processing unit) is through USB (Universal Serial Bus, USB) interface and SD card control chip communication; SD card control chip carries out interface conversion, adopts 4 SD transmission modes to link to each other with the SD card; CPU realizes controlling the read-write of SD card through SD card control chip.Yet this method is owing to need to adopt SD card control chip, causes the circuit cost of equipment can be than higher, and need take more circuit space.
Summary of the invention
The embodiment of the invention provides a kind of SD card control method and control circuit, in order to circuit cost, the saving circuit space of practicing thrift control SD card.
According to an aspect of the present invention, a kind of SD card control method is provided, has comprised:
CPU moves boot; Level on the universal I pin that said boot detects with the ECC indicating circuit links to each other, and confirm the start-up routine position according to the level of detection;
Said boot is obtained said start-up routine and operation according to the position of confirming;
After the start-up routine operation, said CPU is through SD card control SD card; Wherein, the part pin in the said SD card is that ECC detects multiplexing pins.
Wherein, said SD card specifically comprises 4 data wire pins, 1 clock line pin, 1 order line pin.
The number of the said universal I pin that links to each other with the ECC indicating circuit is 2 or 3.
Said level according to detection confirms that the start-up routine position is specially:
Said boot according to detect each with universal I pin that the ECC indicating circuit links to each other on level, confirm that said start-up routine position is in the said CPU sheet, perhaps said start-up routine position is one of said CPU sheet storer outward.
Further, before said CPU is through SD card control SD card, also comprise:
The universal I pin of said CPU through linking to each other with SD card electrifying control circuit controlled powering on of said SD card.
According to another aspect of the present invention, a kind of SD card control circuit is provided also, has comprised: CPU and SD card;
Wherein, said CPU links to each other with said SD card through the SD card, in order to control said SD card through said SD card; Part pin in the said SD card is that ECC detects multiplexing pins;
Said CPU links to each other with the ECC indicating circuit through the universal I pin, and said CPU obtains, moves said start-up routine according to the position of confirming and start in order to confirm the start-up routine position according to the level on the said universal I pin.
Wherein, said CPU confirms that according to the level on the said universal I pin start-up routine position is specially:
Said CPU according to detect each with universal I pin that the ECC indicating circuit links to each other on level, confirm that said start-up routine position is in the said CPU sheet, perhaps said start-up routine position is one of said CPU sheet storer outward.
Further, said CPU also links to each other with SD card electrifying control circuit through other universal I pin, in order to control powering on of said SD card.
In the technical scheme of the embodiment of the invention,, utilize other universal I pin simulation ECC to detect functions of pins and realize that ECC detects owing to utilize the SDIO interface of CPU directly to control the SD card; Thereby both can guarantee the normal startup of CPU, and can not adopt SD card control chip to carry out the SD card control again, reach the purpose of practicing thrift circuit cost, practicing thrift circuit space.
Description of drawings
Fig. 1 is the control mode synoptic diagram of the jumbo SD card of prior art;
Fig. 2 is the SD card control circuit synoptic diagram of the embodiment of the invention;
Fig. 3 is the circuit diagram of the ECC indicating circuit in the SD card control circuit of the embodiment of the invention;
Fig. 4 is the circuit diagram of the SD card electrifying control circuit in the SD card control circuit of the embodiment of the invention;
Fig. 5 is the SD card control method process flow diagram of the embodiment of the invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, below with reference to accompanying drawing and enumerate preferred embodiment, to further explain of the present invention.Yet, need to prove that many details of listing in the instructions only are in order to make the reader to one or more aspects of the present invention a thorough understanding arranged, even if there are not these specific details also can realize these aspects of the present invention.
Terms such as " module " that the application uses, " system " are intended to comprise the entity relevant with computing machine, such as but not limited to hardware, firmware, combination thereof, software or executory software.For example, module can be, but be not limited in: the thread of the process of moving on the processor, processor, object, executable program, execution, program and/or computing machine.For instance, the application program of moving on the computing equipment can be a module with this computing equipment.One or more modules can be positioned at an executory process and/or thread.
Inventor of the present invention notices that the CPU that has itself just has the interface that connects high capacity SD card, i.e. SDIO interface; Yet it is multiplexing pins that the part pin is arranged in the pin of these SDIO interfaces, multiplexingly detects in ECC (Error checking and correction, Error Checking and Correction).If utilize these SDIO pins and SD card connection, CPU just can directly control the SD card, and need not carry out the SD card control through SD card control chip; But the wherein multiplexing pin that detects in ECC just can't carry out ECC and detect; CPU can't normally start.
Based on above-mentioned analysis, inventor of the present invention considers that other pin that adopts CPU simulates ECC and detect functions of pins, that is to say, utilizes other universal I pin (general input and output pin) to realize that ECC detects, and utilizes the SDIO pin to realize the SD card control; Thereby both can guarantee the normal startup of CPU, and can not adopt SD card control chip to carry out the SD card control again.
Specify the technical scheme of the embodiment of the invention below in conjunction with accompanying drawing.SD card control circuit in the equipment of the embodiment of the invention, as shown in Figure 2, comprising: CPU201, SD card 202, ECC indicating circuit 203.
Wherein, the SDIO interface of CPU201 (or claiming the SD card) comprises 6 pins; Wherein, 4 pins are data line pin SD_CDATA (0-3), and 1 pin is clock line pin SD_CCLK_OUT, and 1 pin is order line pin SD_CCMD.
In the SD of CPU201 card, the part pin is that ECC detects multiplexing pins; That is to say that the part pin in the SD card is a multiplexing pins, both can be used as the pin of SDIO interface, can be used as the pin that ECC detects again.In the prior art, usually these multiplexing pins are linked to each other with the ECC indicating circuit,, thereby can't use these pins to connect the SD card its pin that detects as ECC.
In the technical scheme of the embodiment of the invention; The SDIO interface of CPU201 links to each other with SD card 202; CPU201 can directly control SD card 202 through this SD card, realizes the read-write operation of SD card 202 etc., and needn't control SD card 202 through SD card control chip; Practice thrift the circuit cost of equipment, also practiced thrift the circuit space of equipment.
Because the multiplexing pins that can be used for the ECC detection is used as the SDIO interface, therefore, can't uses these ECC to detect multiplexing pins and carry out the ECC detection; Thus; In the technical scheme of the embodiment of the invention; CPU201 is through universal I pin (GPIO pin; Or claim general input and output pin) link to each other with ECC indicating circuit 203, CPU201 confirms the start-up routine position according to the level on the said universal I pin, obtains, moves said start-up routine according to the position of confirming and start.
Particularly, the number of the universal I pin that links to each other with ECC indicating circuit 203 can be 1,2,3, even more than 3, and those skilled in the art can be according to actual conditions, look memory device that CPU201 connects what and decide.The number of the universal I pin that generally speaking, links to each other with ECC indicating circuit 203 be 3 just enough.
CPU201 according to detect each with universal I pin that ECC indicating circuit 203 links to each other on level, confirm that the start-up routine position is in the said CPU sheet, perhaps the start-up routine position is one of said CPU sheet storer outward.For example, suppose that 3 universal I pins that link to each other with ECC indicating circuit 203 are respectively ECC0, ECC1, ECC2; If preestablished: when the level of ECC0, ECC1, ECC2 was respectively 0,0,0, expression start-up routine position was in the said CPU sheet; When the level of ECC0, ECC1, ECC2 was respectively 0,0,1, expression start-up routine position was first memory spare T-FLASH; When the level of ECC0, ECC1, ECC2 was respectively 0,1,0, expression start-up routine position was second memory spare NAND FLASH; When the level of ECC0, ECC1, ECC2 was respectively 1,0,0, expression start-up routine position was the 3rd memory device EEPROM.
So, be respectively 0,0,0 o'clock if CPU201 detects the level of ECC0, ECC1, ECC2, then CPU201 reads, moves start-up routine in sheet, starts; If CPU201 detects the level of ECC0, ECC1, ECC2 and was respectively 0,0,1 o'clock, then CPU201 reads start-up routine and operation from first memory spare T-FLASH, starts; If CPU201 detects the level of ECC0, ECC1, ECC2 and was respectively 0,1,0 o'clock, then CPU201 reads start-up routine and operation from second memory spare NANDFLASH, starts.
ECC indicating circuit 203 is in order to be provided with the level on the coupled universal I pin; That is to say that through ECC indicating circuit 203, the user can be provided with the level on the CPU universal I pin that links to each other with ECC indicating circuit 203 easily.ECC indicating circuit 203 can adopt ECC indicating circuit commonly used in the prior art.A kind of concrete ECC indicating circuit 203, as shown in Figure 3.As can beappreciated from fig. 3, the user can control the level of ECC0, ECC1, ECC2 through the wire jumper of R1, R2, R3 is set.For example, if the user is provided with the wire jumper of R1, then R1 is by short circuit, and the level of ECC0 is drawn high is power level; If the user breaks off the wire jumper of R1, then the level step-down of ECC0.
Further, can also comprise in the SD card control circuit of the embodiment of the invention: SD card electrifying control circuit 204.
CPU201 links to each other with SD card electrifying control circuit 204 through other universal I pin, in order to powering on through SD card electrifying control circuit 204 control SD cards 202.SD card electrifying control circuit 204 can adopt SD card electrifying control circuit commonly used in the prior art.A kind of concrete SD card electrifying control circuit, as shown in Figure 4.As can beappreciated from fig. 4, CPU201 links to each other (being connected with resistance therebetween) through the base stage of the triode in other universal I pin and the SD card electrifying control circuit 204, the break-make of control triode; The collector of triode links to each other with the grid of metal-oxide-semiconductor through resistance; When the triode conducting, MOS (Metal Oxide Semiconductor, metal-oxide semiconductor (MOS)) manages also conducting, thereby the power supply of the power end of SD card and equipment is conducted, and the SD card powers on; When triode broke off, metal-oxide-semiconductor also broke off, thereby the power supply of the power end of SD card and equipment breaks off, the outage of SD card.
Above-mentioned SD card control circuit carries out the method flow of SD card control, and is as shown in Figure 5, comprises the steps:
S501:CPU201 reads, moves boot.
S502: the level on the universal I pin that boot detects with ECC indicating circuit 203 links to each other, and confirm the start-up routine position according to the level of detection.
Particularly, the number of the universal I pin that links to each other with ECC indicating circuit 203 can be 1,2,3, even more than 3; Boot according to detect each with universal I pin that ECC indicating circuit 203 links to each other on level, confirm that said start-up routine position is in the said CPU sheet, perhaps said start-up routine position is one of said CPU sheet storer outward.
S503: boot is obtained said start-up routine and operation according to the position of confirming, CPU201 begins to start.
If confirm that said start-up routine position is in the said CPU sheet, then boot is moved the start-up routine in the CPU sheet, and CPU201 begins to start;
If confirming said start-up routine position is certain outer memory device of CPU sheet, then boot reads start-up routine and operation from this memory device, and CPU201 begins to start.
S504: after CPU201 starts, i.e. after the start-up routine operation, the universal I pin of CPU through linking to each other with SD card electrifying control circuit 204 controlled powering on of said SD card 202.
S505:CPU201 realizes the read-write operation of SD card 202 etc. through SD card control SD card 202.
After SD card 202 powered on, CPU201 can realize the read-write operation of SD card 202 etc. through SD card control SD card 202.
In the technical scheme of the embodiment of the invention,, utilize other universal I pin simulation ECC to detect functions of pins and realize that ECC detects owing to utilize the SDIO interface of CPU directly to control the SD card; Thereby both can guarantee the normal startup of CPU, and can not adopt SD card control chip to carry out the SD card control again, reach the purpose of practicing thrift circuit cost, practicing thrift circuit space.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to accomplish through program; This program can be stored in the computer read/write memory medium, as: ROM/RAM, magnetic disc, CD etc.
The above only is a preferred implementation of the present invention; Should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; Can also make some improvement and retouching, these improvement and retouching also should be regarded as protection scope of the present invention.

Claims (10)

1. SD card control method comprises:
CPU moves boot; Level on the universal I pin that said boot detects with the ECC indicating circuit links to each other, and confirm the start-up routine position according to the level of detection;
Said boot is obtained said start-up routine and operation according to the position of confirming;
After the start-up routine operation, said CPU is through SD card control SD card; Wherein, the part pin in the said SD card is that ECC detects multiplexing pins.
2. the method for claim 1 is characterized in that, said SD card specifically comprises 4 data wire pins, 1 clock line pin, 1 order line pin.
3. method as claimed in claim 2 is characterized in that, the number of the said universal I pin that links to each other with the ECC indicating circuit is 2 or 3.
4. method as claimed in claim 3 is characterized in that, said level according to detection confirms that the start-up routine position is specially:
Said boot according to detect each with universal I pin that the ECC indicating circuit links to each other on level, confirm that said start-up routine position is in the said CPU sheet, perhaps said start-up routine position is one of said CPU sheet storer outward.
5. like the arbitrary described method of claim 1-4, it is characterized in that, before said CPU is through SD card control SD card, also comprise:
The universal I pin of said CPU through linking to each other with SD card electrifying control circuit controlled powering on of said SD card.
6. a SD card control circuit comprises: CPU and SD card;
Wherein, said CPU links to each other with said SD card through the SD card, in order to control said SD card through said SD card; Part pin in the said SD card is that ECC detects multiplexing pins;
Said CPU links to each other with the ECC indicating circuit through the universal I pin, and said CPU obtains, moves said start-up routine according to the position of confirming and start in order to confirm the start-up routine position according to the level on the said universal I pin.
7. circuit as claimed in claim 6 is characterized in that, said SD card specifically comprises 4 data wire pins, 1 clock pin, 1 instruction pin.
8. circuit as claimed in claim 7 is characterized in that, the number of the said universal I pin that links to each other with the ECC indicating circuit is 2 or 3.
9. circuit as claimed in claim 8 is characterized in that, said CPU confirms that according to the level on the said universal I pin start-up routine position is specially:
Said CPU according to detect each with universal I pin that the ECC indicating circuit links to each other on level, confirm that said start-up routine position is in the said CPU sheet, perhaps said start-up routine position is one of said CPU sheet storer outward.
10. like the arbitrary described circuit of claim 6-9, it is characterized in that said CPU also links to each other with SD card electrifying control circuit through other universal I pin, in order to control powering on of said SD card.
CN201210289639.7A 2012-08-14 2012-08-14 Sd card control method and control circuit Active CN102831924B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210289639.7A CN102831924B (en) 2012-08-14 2012-08-14 Sd card control method and control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210289639.7A CN102831924B (en) 2012-08-14 2012-08-14 Sd card control method and control circuit

Publications (2)

Publication Number Publication Date
CN102831924A true CN102831924A (en) 2012-12-19
CN102831924B CN102831924B (en) 2015-10-28

Family

ID=47335017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210289639.7A Active CN102831924B (en) 2012-08-14 2012-08-14 Sd card control method and control circuit

Country Status (1)

Country Link
CN (1) CN102831924B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106098092A (en) * 2016-06-21 2016-11-09 浙江众合科技股份有限公司 Realize the circuit of memory card write-protect switch and reset

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040268074A1 (en) * 2003-04-24 2004-12-30 Hideki Yagi Data processing apparatus and memory card
CN101021794A (en) * 2006-05-25 2007-08-22 杭州晟元芯片技术有限公司 Program bootstrap method after chip power-on
CN201904869U (en) * 2010-12-16 2011-07-20 南京久显信息技术有限公司 Video call terminal
CN102541671A (en) * 2011-12-29 2012-07-04 广东步步高电子工业有限公司 Method and equipment for increasing recognition rate of electronic equipment to SD (Secure Digital) card
CN202838968U (en) * 2012-08-14 2013-03-27 青岛海信宽带多媒体技术有限公司 Device and secure digital (SD) card control circuit thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040268074A1 (en) * 2003-04-24 2004-12-30 Hideki Yagi Data processing apparatus and memory card
CN101021794A (en) * 2006-05-25 2007-08-22 杭州晟元芯片技术有限公司 Program bootstrap method after chip power-on
CN201904869U (en) * 2010-12-16 2011-07-20 南京久显信息技术有限公司 Video call terminal
CN102541671A (en) * 2011-12-29 2012-07-04 广东步步高电子工业有限公司 Method and equipment for increasing recognition rate of electronic equipment to SD (Secure Digital) card
CN202838968U (en) * 2012-08-14 2013-03-27 青岛海信宽带多媒体技术有限公司 Device and secure digital (SD) card control circuit thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106098092A (en) * 2016-06-21 2016-11-09 浙江众合科技股份有限公司 Realize the circuit of memory card write-protect switch and reset

Also Published As

Publication number Publication date
CN102831924B (en) 2015-10-28

Similar Documents

Publication Publication Date Title
CN102662898B (en) Host-slave compatibility method, device and system for USB (universal serial bus) device
CN104239097B (en) A kind of method, system and mobile terminal by updating mobile terminal accessory
CN103019758A (en) Method for speeding up the boot time of electric device and electric device using the same
CN103761129A (en) Method of implementing SDIO (secure digital input/output) interface drive in Boot loader layer
CN210954874U (en) Domestic computer mainboard based on Shenwei SW421 treater
CN102147650A (en) Peripheral device and method of operating the same
CN101599035A (en) USB port proving installation and method
CN101872308A (en) Memory bar control system and control method thereof
CN103870429A (en) High-speed-signal processing board based on embedded GPU
CN103853638A (en) Method for refreshing firmware and electronic equipment
CN107451067B (en) Processing method for downloading test and related product
CN202838968U (en) Device and secure digital (SD) card control circuit thereof
CN102831924A (en) Control method and control circuit for SD card
CN102654857A (en) Communication method capable of simulating SPI protocol by adopting GPIO interface
US8566575B2 (en) Computer apparatus and method for charging portable electronic device using the computer apparatus
CN210006035U (en) USB and OTG function switching control circuit, device and mobile terminal
CN107480086B (en) Terminal and control method thereof
CN102866755A (en) Power-on reset device for integrated test system
CN103366830A (en) Testing device of memory card
CN104731681A (en) Diagnostic device and information processing method
CN101521956A (en) Method for reading and writing T card through GPIO port, system and mobile phone
CN108132847A (en) A kind of data processing method, the first electronic equipment and computer storage media
CN101470681A (en) Method for working in digital security mode by employing universal input/output analog memory card
CN107294768A (en) EMMC firmware upgrade methods, equipment and storage device
CN113485672B (en) Information generation method, device, equipment and medium based on FIFO memory

Legal Events

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