[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN1540529A - The method of CPLD to realize the mobile storage of CF card - Google Patents

The method of CPLD to realize the mobile storage of CF card Download PDF

Info

Publication number
CN1540529A
CN1540529A CNA2003101034204A CN200310103420A CN1540529A CN 1540529 A CN1540529 A CN 1540529A CN A2003101034204 A CNA2003101034204 A CN A2003101034204A CN 200310103420 A CN200310103420 A CN 200310103420A CN 1540529 A CN1540529 A CN 1540529A
Authority
CN
China
Prior art keywords
card
cpld
cpu
mobile storage
address
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
CNA2003101034204A
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.)
Huawei Technologies Co Ltd
Original Assignee
Harbour Networks Holdings 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 Harbour Networks Holdings Ltd filed Critical Harbour Networks Holdings Ltd
Priority to CNA2003101034204A priority Critical patent/CN1540529A/en
Publication of CN1540529A publication Critical patent/CN1540529A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Power Sources (AREA)

Abstract

本发明公开了一种CPLD实现CF卡移动存储的方法,该方法包括:选择CF卡的True IDE Mode接口模式,并使CF卡通过CPLD与CPU连接,即设置CPLD使CPU的地址线与CF卡的地址线及片选端连接;CPU对CF卡发出读写命令,对CF卡进行读写操作。并且,CF卡的socket槽中的CD0、CD1插针长度应该比电源插针短,两者之间的长度差应保证CF卡在拔出的时候,CD0和CD1已经和插槽脱离,CF还保持供电状态;CF卡的中断通过CPLD与CPU连接,如果CPU仅支持电平信号的中断触发,则在CPLD中把CD0、CD1跳变转换成电平中断信号。本发明通过的CPLD代替接口芯片,成本比较低。

The invention discloses a method for CPLD to realize mobile storage of a CF card. The method includes: selecting the True IDE Mode interface mode of the CF card, and connecting the CF card with the CPU through the CPLD, that is, setting the CPLD so that the address line of the CPU is connected to the CF card The address line and the chip selection terminal are connected; the CPU sends read and write commands to the CF card, and performs read and write operations on the CF card. In addition, the length of the CD0 and CD1 pins in the socket slot of the CF card should be shorter than the power pins. Keep the power supply status; the interrupt of the CF card is connected to the CPU through the CPLD. If the CPU only supports the interrupt trigger of the level signal, the transition of CD0 and CD1 is converted into a level interrupt signal in the CPLD. The CPLD adopted in the present invention replaces the interface chip, and the cost is relatively low.

Description

CPLD realizes the method for CF card mobile storage
Technical field:
The present invention relates to a kind of method that realizes mobile storage, relate in particular to the method that CPLD realizes CF card mobile storage.
Background technology:
In existing Industry Control and commercial unit field, more and more used intelligent processor and CPU, the intellectuality of these equipment is improved greatly, can handle information more.Simultaneously, owing to used CPU in a large number, the combination of these equipment and software is also more and more tightr, the increase of data volume make equipment control also complicated more, and the capacity of software itself is also done bigger and bigger, use traditional serial ports, perhaps the network interface upgrade software becomes complicated more, slowly, and also unstable.Particularly in large-scale production, the efficient that slowly influences production with instability greatly of software download has influenced the production line output.Outside removable portable storage device for commercial unit provides a stable interface easily, can be carried out exchanges data easily with the outside, has therefore obtained using widely.
In the portable mobile memory system, general parallel bus is a kind of more common cpu control bus, it is divided into Intel structure and Motorola structure haply, with the Intel structure is example, it be divided into again address bus (Address), data bus (Data), sheet choosing (/CS), read (/OE), write (/WE) signal etc., if system supports slow devices, also just have ready signal (Ready).The principle of Motorola bus and Intel is similar, and just the definition of interface signal line is different.By simple logical transition, the Motorola bus also can change into the Intel bus.
In portable mobile memory system, the general parallel bus of CPU by chip selection signal (/CS) to need to select apparatus operating, with read signal (/OE) do the operation of read data, with write signal (/WE) do the operation of write data.CPU and peripheral hardware respectively /OE and/the rising edge sampled data of WE.For peripheral hardware at a slow speed, when peripheral hardware was busy, it can drag down the Ready signal, and CPU can insert latent period in operation so, up to Ready signal high jump again.
Nowadays portable movable storage device is widely used in various consumer electronics products.That storage medium mainly adopts is Flash, and the interface of memory device mainly contains CF (Compact Flash) Card, and another is PC Card.That be used widely is CF Card, and supports that the producer of this standard is a lot, mainly contains IBM, Hitachi, HP, Kodak etc.
Portable movable storage device can be more convenient for the importing and the derivation of information, is example with the Ethernet switch management, and present is large-scale, high-end switching equipment, and management is very complicated, needs a large amount of configuration informations, mainly is some route table items; If every switch is disposed respectively, require a great deal of time and energy, if but with in the burned CF card of configuration information, with the configuration that a card just can solve all machines, convenient and swift; In addition, the abnormal information for switch in the use occurs also can derive it easily by the CF card, is convenient to record.
Portable movable storage device has reliable and stable data channel, upgrades to example with Ethernet switch; By the CF card reader, can be with used upgrade software, burned CF card, the CF card is inserted in the equipment just can upgrades easily, speed loads fast than serial ports, load slow slightly than network interface, but owing to there is not physical connection, do not worry going offline, this mode is more reliable and more stable.
Because CF is stuck in all advantages in the use, makes it large-area widespread use on commercial unit.But general application mode is to adopt the adaptive chip of CF card, and this interface chip possesses interface accessing control and two kinds of functions of power management (support hot plug) simultaneously.But the cost of interface chip has increased the cost of equipment undoubtedly than higher, is unfavorable for the large-scale application of this advanced mode.
Summary of the invention:
At the existing problem and shortage of above-mentioned conventional portable movable storage device, the purpose of this invention is to provide the method that the lower CPLD of a kind of cost realizes CF card mobile storage.
The present invention is achieved in that a kind of CPLD realizes the method for CF card mobile storage, may further comprise the steps:
Select the True IDE Mode interface modes of CF card, and make the CF cartoon cross CPLD to be connected, the address wire of address wire that CPLD makes CPU and CF card and sheet promptly are set select to hold and be connected with CPU;
CPU sends read write command to the CF card, and CF is sticked into capable read-write operation.
Further, the CD0 in the socket groove of described CF card, CD1 contact pin length should be lacked than power pin, and length difference between the two should guarantee that CF is stuck in when extracting, and CD0 and CD1 break away from slot, and CF also keeps power supply state;
The interruption of CF card is connected with CPU by CPLD, if CPU only supports the down trigger of level signal, then in CPLD CD0, CD1 saltus step is converted to the level look-at-me.
Further, the address wire of the address wire of described CPU and CF card and sheet choosing end is connected to be specially to select to hold with two sheets with three address wires of CF card by CPLD with five address wires of CPU USB (universal serial bus) and is connected.
The present invention replaces interface chip by the lower CPLD of cost, selects the True IDE Mode interface modes of CF card, and CPLD is set, make it possess the adaptive chip functions of interface, like this, CPU just can finish the read-write capability to the CF card, and the CF card has just been realized Mobile Storage Function MSF.For making the CF card possess plug-and-play feature simultaneously, also by the CD0 in the socket groove of CF card, CD1 contact pin Design of length must be lacked than power pin, difference in length between the two, can guarantee that CF is stuck in when extracting, CD0 and CD1 break away from slot, but CF also keeps power supply state, and CPU must support the edge look-at-me to trigger, if CPU refers to support the down trigger of level signal, so just must be in CPLD handle/CD0 and/the CD1 saltus step converts the level look-at-me to, the CF card just can easily have been realized hot plug.Like this, use CPLD and special technique means, just can finish and be equivalent to the function that special interface chip is finished.
Description of drawings:
Below in conjunction with accompanying drawing, the present invention is made detailed description.
Fig. 1 is the syndeton synoptic diagram of CPU of the present invention and CF;
Fig. 2 is control on the throne of the present invention and hot plug control structure synoptic diagram.
Embodiment:
CF card mobile storage mechanism proposed by the invention is achieved in that
Select the True IDE Mode interface modes of CF card, and make the CF cartoon cross CPLD to be connected with CPU, CPLD promptly is set the address wire of CPU is connected with the address wire and the sheet choosing end of CF card, hold with two sheet choosings with three address wires of CF card by CPLD with five address wires of CPU USB (universal serial bus) to be connected.
CPU sends read write command to the CF card, and CF is sticked into capable read-write operation.
And, CD0 in the socket groove of CF card, CD1 contact pin Design of length must be lacked than power pin, difference in length between the two, should be able to guarantee that CF is stuck in when extracting, CD0 and CD1 break away from slot, but CF also keeps power supply state, according to actual conditions, CD0 in the CF card stocket groove of design, CD1 contact pin length are at least than the short 1.5mm of power pin, the interruption of CF card be connected with CPU by CPLD, if CPU only supports the down trigger of level signal, then in CPLD, CD0, CD1 saltus step are converted to the level look-at-me.
Introduce the CF card here: the CF card is supported three kinds of interface modes, be respectively PC Card MemoryMode, PC Card IO Mode, True IDE Mode, the present invention selects True IDE mode for use, True IDEMode connects the simplest from hardware, and can use the driver of ide interface on software in a large number, therefore has advantage relatively.
Following table is the truth table of CF card when being arranged to True IDE Mode:
?/CS1 ??/CS0 ?A2 ??A1 ?A0 ??/IORD ??/IOWR ????BIT?WITHE
?1 ??0 ?0 ??0 ?0 ??RD?Data ??WR?Data ????8?or?16bit
?1 ??0 ?0 ??0 ?1 ??Error?Register ??Features ????8bit
?1 ??0 ?0 ??1 ?0 ??Sector?Count ??Sector?Count ????8bit
?1 ??0 ?0 ??1 ?1 ??Sector?No. ??Sector?No. ????8bit
?1 ??0 ?1 ??0 ?0 ??Cylinder?Low ??Cylinder?Low ????8bit
?1 ??0 ?1 ??0 ?1 ??Cylinder?High ??Cylinder?High ????8bit
?1 ??0 ?1 ??1 ?0 ??Select ??Card/Head ??Select ??Card/Head ????8bit
?1 ??0 ?1 ??1 ?1 ??Status ??Command ????8bit
?0 ??1 ?1 ??1 ?0 ??Alt?Status ??Device?Control ????8bit
Like this, three address wires by the CF card (A2~A0) and two chip selection signals (/CS1 and/CS0), all registers in just can access list, by these registers, CPU just can realize the read-write operation to the CF card, the while can also be monitored the state of CF.
More important several registers are respectively in the CF card:
Error Register: whether monitoring sector mistake or can not the positive mistake of root occurs, and the sector whether occurs and overflow;
Sector Count, Sector No.Cylinder Low, Cylinder High: these four registers are to be used to locate the register that need carry out the space of read-write operation, similar with the IDE hard disk, if the CF card is in True IDE Mode, it also is to add the space that needs read-writes is located in the sector with cylinder so.CylinderLow, these two registers of Cylinder High all are 8Bits, form a 16bit Cylinder address.SectorNo. register has indicated the address that the sector begins, and Sector Count register has indicated the side-play amount of sector;
Whether Status: the contents table of this register is understood the current state of CF card, busy, the mistake of restorability whether occurs, operating mistake etc. whether occurs;
Control: this register mainly is to be used for controlling resetting and interrupting of CF card.
As shown in Figure 1, with these 5 address wires of AD0~AD4 of the general parallel bus of CPU add chip selection signal decoding obtain being used to visiting the CF register address space A0~A2 and/CS0 ,/CS1 certainly, comprises that also the interruption of CF connects, and below is the logical code among the CPLD:
CF_ADD(0)<=IO_AD_REG(0);
CF_ADD(1)<=IO_AD_REG(1);
CF_ADD(2)<=IO_AD_REG(2);
CF_CS(0)<=IO_CS_L?or?IO_AD4?or(not?IO_AD3);
CF_CS(1)<=IO_CS_L?or(not?IO_AD4)or(not?IO_AD3);
CF_WR<=IO_CS_L?or?IO_WR_L;
CF_RD<=IO_CS_L?or?IO_OE_L;
IO_RDY<=IO_CS_L?or?CF?RDY;
CPU_IRQ<=CF_IRQ。
Like this, just realized being connected of CF and CPU, CPU just can carry out read and write access to CF.
The CF card by/CD0 and/CD1 controls information on the throne.CF card inside/CD0 and/CD1 directly pulls down to ground by force, and in CF stocket ,/CD0 and/CD1 move 3.3V on weak.When the CF card inserts, CF stocket /CD0 and/CD1 dragged down by CF, triggers CPU INT with this, shows that this moment, CF inserted.This moment, CPU can open electronic switch by GPIO or general parallel bus, to the power supply of CF card, can begin the CF card is operated.Before extracting the CF card, CPU closes electronic switch by GPIO or general parallel bus, stops to after the power supply of CF card, and the CF card just can be extracted smoothly.But above hot plug operations also is not very intelligent when extracting, and must import an order of closing CF card power supply, guarantee that CF card power supply has been closed after, just can extract, can not accomplish plug and play.
As shown in Figure 2, in the stocket groove of CF/CD0 and/length of CD1 pin is as short as than the length of power pin and lacks 1.5mm.So when extracting CF ,/CD0 and/CD1 be power pin before the outage of CF card with before the CF card separates with regard to high jump, promptly/CD0 separates with the CF card than power supply is first with/CD1.Can cause going up of a CPU_INT this moment and jump, CPU jumps on monitoring this after signal, just can be the power-off of CF card, and just can extract smoothly this moment.If realize above hot plug, CPU must support the edge look-at-me to trigger so, if CPU only supports the down trigger of level signal, so just must be in CPLD handle/CD0 convert the level look-at-me to with/CD1 saltus step.Below be its logical code:
process(GRESET,GCLK)    begin       if(GRESET=′0′)then       CD0_REG<=′0′;       CD1_REG<=′0′;       CD0_REG_CMP<=′0′;       CD1_REG_CMP<=′0′;          Elsif(GCLK′event and GCLK=′1′)then            if(((CD0_REG_CMP=′0′)and(CD0_REG=′1′))and((CD1_REG_CMP=′0′)and(CD1_REG=′1′)))then                  CPU_INT<=′0′;            end if;            CD0_REG<=/CD0;            CD1_REG<=/CD1;            CD0_REG_CMP<=CD0_REG;           CD1_REG_CMP<=CD1_REG;        <!-- SIPO <DP n="4"> -->        <dp n="d4"/>  end if;end process.

Claims (3)

1. a CPLD realizes the method for CF card mobile storage, may further comprise the steps:
Select the True IDE Mode interface modes of CF card, and make the CF cartoon cross CPLD to be connected, the address wire of address wire that CPLD makes CPU and CF card and sheet promptly are set select to hold and be connected with CPU;
CPU sends read write command to the CF card, and CF is sticked into capable read-write operation.
2. CPLD as claimed in claim 1 realizes the method for CF card mobile storage, it is characterized in that, CD0 in the socket groove of described CF card, CD1 contact pin length should be lacked than power pin, length difference between the two should guarantee that CF is stuck in when extracting, CD0 and CD1 break away from slot, and CF also keeps power supply state;
The interruption of CF card is connected with CPU by CPLD, if CPU only supports the down trigger of level signal, then in CPLD CD0, CD1 saltus step is converted to the level look-at-me.
3. CPLD as claimed in claim 1 realizes the method for CF card mobile storage, it is characterized in that the address wire of the address wire of described CPU and CF card and sheet choosing end are connected to be specially to select to hold with two sheets with three address wires of CF card by CPLD with five address wires of CPU USB (universal serial bus) and are connected.
CNA2003101034204A 2003-10-31 2003-10-31 The method of CPLD to realize the mobile storage of CF card Pending CN1540529A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2003101034204A CN1540529A (en) 2003-10-31 2003-10-31 The method of CPLD to realize the mobile storage of CF card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2003101034204A CN1540529A (en) 2003-10-31 2003-10-31 The method of CPLD to realize the mobile storage of CF card

Publications (1)

Publication Number Publication Date
CN1540529A true CN1540529A (en) 2004-10-27

Family

ID=34333290

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2003101034204A Pending CN1540529A (en) 2003-10-31 2003-10-31 The method of CPLD to realize the mobile storage of CF card

Country Status (1)

Country Link
CN (1) CN1540529A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101277105B (en) * 2007-03-30 2010-05-26 陈钜泯 Rhythm signal coding control system
CN102508801A (en) * 2011-11-07 2012-06-20 杭州华三通信技术有限公司 Host drive device and host drive method, and transmission control device and transmission control method
CN102541781A (en) * 2011-12-15 2012-07-04 北京科诺伟业科技有限公司 DMA (direct memory access) method for realizing converter fault storage by using CF (compact flash) card
CN111163131A (en) * 2019-12-09 2020-05-15 杭州迪普科技股份有限公司 Removable storage device and data transmission method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101277105B (en) * 2007-03-30 2010-05-26 陈钜泯 Rhythm signal coding control system
CN102508801A (en) * 2011-11-07 2012-06-20 杭州华三通信技术有限公司 Host drive device and host drive method, and transmission control device and transmission control method
CN102508801B (en) * 2011-11-07 2014-07-02 杭州华三通信技术有限公司 Host drive device and host drive method, and transmission control device and transmission control method
CN102541781A (en) * 2011-12-15 2012-07-04 北京科诺伟业科技有限公司 DMA (direct memory access) method for realizing converter fault storage by using CF (compact flash) card
CN102541781B (en) * 2011-12-15 2014-09-24 北京科诺伟业科技股份有限公司 A DMA Method for Converter Fault Storage Using CF Card
CN111163131A (en) * 2019-12-09 2020-05-15 杭州迪普科技股份有限公司 Removable storage device and data transmission method

Similar Documents

Publication Publication Date Title
US20200089403A1 (en) Extended utilization area for a memory device
US5493574A (en) Power efficient RAM disk and a method of emulating a rotating memory disk
CN1514332A (en) Method and device for accessing flash memory card
CN101051279A (en) Peripheral equipment operation method, peripheral equipment and host
CN1540530A (en) The Method of Realizing Hot Swapping of CF Card
CN1540529A (en) The method of CPLD to realize the mobile storage of CF card
CN1241096C (en) IDE hard disc interface for supporting hot inserting and startup as inserting memory card
CN1435796A (en) Memroy drive device compatible with multiple mobile memory cards
CN112015671A (en) Flash memory controller, memory device, and method of accessing a flash memory module
CN212084122U (en) NVMe controller
CN1242324C (en) Method of large capacity movable memory for mobile telephone
CN1464363A (en) Switching and judging method of memory card common connection device and its common terminal
CN101599295B (en) integrated storage device and control method thereof
CN2854695Y (en) Mobile storage device with storage and card reading function
CN112052189A (en) Memory device, electronic device, and reading method associated therewith
CN114356224B (en) File address optimization method, terminal, server and computer readable storage medium
US20070043887A1 (en) [adaptor device for ms memory card interface]
CN1553356A (en) Computer system capable of dynamic access external storage device
CN112988068B (en) Memory control method, memory storage device and memory controller
CN1317655C (en) DMA transmission method adapted for SD cards
CN2529322Y (en) CF expansion card
CN2802659Y (en) DataPlay movement control circuit
HK40009715A (en) Extended utilization area for a memory device
CN1786931A (en) Flash memory card access device and method
CN2627591Y (en) A device for automatically switching card slots of PCMCIA riser cards

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: HUAWEI TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: GANGWAN NETWORK CO., LTD.

Effective date: 20060922

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20060922

Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant after: Huawei Technologies Co., Ltd.

Address before: 100089, No. 21 West Third Ring Road, Beijing, Haidian District, Long Ling Building, 13 floor

Applicant before: Harbour Networks Holdings Limited

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication