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

CN1367437A - Miniature memory with universal serial bus plug - Google Patents

Miniature memory with universal serial bus plug Download PDF

Info

Publication number
CN1367437A
CN1367437A CN 01102127 CN01102127A CN1367437A CN 1367437 A CN1367437 A CN 1367437A CN 01102127 CN01102127 CN 01102127 CN 01102127 A CN01102127 A CN 01102127A CN 1367437 A CN1367437 A CN 1367437A
Authority
CN
China
Prior art keywords
usb
driver
circuit
pin
operating system
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
CN 01102127
Other languages
Chinese (zh)
Other versions
CN1165003C (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.)
Feitian Technologies Co Ltd
Original Assignee
Beijing Feitian Technologies 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 Beijing Feitian Technologies Co Ltd filed Critical Beijing Feitian Technologies Co Ltd
Priority to CNB011021276A priority Critical patent/CN1165003C/en
Publication of CN1367437A publication Critical patent/CN1367437A/en
Application granted granted Critical
Publication of CN1165003C publication Critical patent/CN1165003C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The present invention relates to a micro-memory with universal serial bus plug and its reading-writing method. Said memory includes extenral shell and circuit board mounted in the interior of external shell, on the circuit board the USB interface circuit, microcontroller and flash memory are mounted, the described USB interface circuit is connected with USB interface of personal computer by means of USB plug, and the described microcontroller circuit, USB interface circuit and flash memory circuit are respectively connected on the address, data and control bus in the mode of multi-wire bidirectinoal connection, and the clock source of the described microcontrollers is provided by USB interface circuit. Said memory not only can conveniently make encryption and decryption treatment of data, and can provide several data protection modes, but also can reduce number of elements.

Description

The micro memory and the reading/writing method thereof of band USB (universal serial bus) plug
The present invention relates to a kind of micro memory and reading/writing method thereof, more specifically say so and insert the USB interface that the individual calculates, carry out the micro memory of data processing with the USB (universal serial bus) plug.
In the prior art, CN2405269 China utility model patent instructions, a kind of flash electronic type external memory device that is used for data handling system is disclosed, comprise storage medium, direct supply and storage control circuit, this storage control circuit comprises microprocessor, USB (universal serial bus) controller, USB (universal serial bus) socket and dormancy and wake-up circuit; Described storage medium is flash memory (Flash Memory); Described microprocessor is connected with flash memory with USB (universal serial bus) controller, dormancy and wake-up circuit respectively; The USB (universal serial bus) controller is connected with flash memory with this bus hub, dormancy and wake-up circuit respectively; The USB (universal serial bus) socket is connected with the data handling system main frame by this bus cable.The weak point of this flash electronic type external memory device is hardware circuit and control corresponding software design more complicated.
The objective of the invention is to overcome the deficiency of above-mentioned prior art, provide a kind of hardware circuit and control corresponding software design comparatively simply with the micro memory of USB (universal serial bus) plug.
Micro memory according to band USB (universal serial bus) plug provided by the invention, comprise that shell and part are loaded on its inner circuit board, usb circuit, microcontroller and flash memory are installed on this circuit board, described usb circuit is connected with the USB interface of personal computer by USB plug, multi-thread respectively two-way being connected on address, data, the control bus of described microcontroller circuit and described usb circuit and flash memory circuit, the clock source of described microcontroller is provided by described usb circuit.
Micro memory according to band USB (universal serial bus) plug provided by the invention, because its usb circuit is controlled and communicate by letter (being that usb circuit and flash memory can not directly carry out the transmission of signal) by microcontroller with flash memory, so its hardware circuit is comparatively simple with its Control Software design.
Below in conjunction with the embodiment that accompanying drawing provides, the present invention is described in detail:
Fig. 1 is the structural representation according to a kind of embodiment of the micro memory of band USB (universal serial bus) plug of the present invention;
Fig. 2 is the circuit theory diagrams of an embodiment of the present invention shown in Figure 1;
Fig. 3 is the detailed circuit structural drawing of embodiment circuit theory diagrams shown in Figure 2;
Fig. 4 is the Control Software hierarchy chart of micro memory under WINDOWS98 operating system according to band USB (universal serial bus) plug of the present invention;
The device driver operational flowchart that Fig. 5 provides for the micro memory with band USB (universal serial bus) plug of the present invention;
Fig. 6 is the control program process flow diagram according to the microcontroller of the micro memory of band USB (universal serial bus) plug of the present invention;
Fig. 7 is the circuit principle structure figure of another kind of embodiment of the micro memory of band USB (universal serial bus) plug of the present invention shown in Figure 1;
Fig. 8 is the flow chart of steps according to the little computing machine reading of data of the micro memory of band USB (universal serial bus) plug of the present invention;
Fig. 9 is for writing the flow chart of steps of data according to the little computing machine of micro memory of band USB (universal serial bus) plug of the present invention;
Referring to Fig. 1, micro memory according to band USB (universal serial bus) plug provided by the invention, comprise that a flat package 100 and part are loaded on its inner circuit board (dotting among the figure), be formed with a rectangular depression portion on the shell, so that insert the USB interface of personal computer and pull up this micro memory from this USB interface, USB interface wherein is denoted as J1, and this shell can also be used translucent material, is convenient to see the pilot lamp that is loaded on the internal circuit board.
Referring to Fig. 2 and 3, as a preferred embodiment of the present invention, usb circuit 1 is installed on the described circuit board, microcontroller 2 and flash memory 3, described usb circuit 1 is connected with the USB interface of personal computer by USB plug, described microcontroller circuit 2 and described usb circuit 1 and the multi-thread respectively two-way address that is connected in of flash memory circuit 3, data, on the control bus, the data that personal computer will be preserved are delivered to usb circuit 1 by USB interface earlier, usb circuit 1 is delivered to microcontroller circuit 2 to data by bus again, 2 pairs of data of microcontroller circuit are handled, and then by bus data are delivered to flash circuit 3; The data that read are delivered to microcontroller circuit 2 by flash circuit 3 by bus, 2 pairs of data of microcontroller circuit are handled, and then data are delivered to usb circuit 1 by bus, usb circuit 1 is sent personal computer back to by USB interface again, and the clock source of described microcontroller (2) is provided by described usb circuit (1).Therefore this mode not only can be carried out the encryption and decryption processing of data easily, and the several data protected mode is provided; But also minimizing components and parts number that can amplitude peak reduces cost, and improved the yield rate of reliability and product.
As another kind of preferred embodiment of the present invention, as shown in Figure 7, multi-thread respectively two-way address, the data bus of being connected to of described usb circuit 1, described microcontroller circuit 2 and described flash memory circuit 3; The control bus of described microcontroller 2 is electrically connected with described usb circuit 1 and described flash memory 3 by analog switching circuit 4.Its concrete circuit is as follows: the two-way connection analog switching circuit 4 of described microcontroller circuit 2 control buss, and other has many control lines to connect analog switching circuit 4 and it is controlled; The two-way connection analog switching circuit 4 of the control bus of usb circuit 1; The two-way connection analog switching circuit 4 of the control bus of flash memory circuit 3.The data that personal computer will be preserved are delivered to usb circuit 1 by USB interface earlier, usb circuit 1 is delivered to microcontroller circuit 2 to message by control bus again, 2 pairs of analog switching circuits 4 of microcontroller circuit are controlled, make analog switching circuit 4 be in special state, 2 pairs of control buss of microcontroller circuit are controlled, and make data directly deliver to flash memory circuit 3 by data bus by usb circuit 1 and store; During reading of data, control by 2 pairs of analog switching circuits 4 of microcontroller circuit earlier, make analog switching circuit 4 be in special state, 2 pairs of control buss of microcontroller circuit are controlled, make data directly deliver to usb circuit 1 by data bus by flash memory circuit 3, usb circuit 1 is sent personal computer back to by USB interface again; This mode can reduce the intermediate link of streams data, can improve the throughput of data, reduces data time.
As shown in Figure 3, in the above preferred embodiment that provides, described microcontroller 2 is electrically connected with a condition indication circuit, described condition indication circuit comprises a light emitting diode D2 and resistance R 8, D2 and R8 series connection, the D2 positive pole connects positive source, 14 pin (I/O port) of another termination of R8 U2, show that by this light emitting diode D2 realization state it can show the duty of this micro memory.
As shown in Figure 3, in the above preferred embodiment that provides, described usb circuit 1 is that interface chip U1, crystal resonator Y1, resistance R 1~R4, capacitor C 1~C4, light emitting diode D1, diode D3 and D4, magnetic bead FB1 and FB2, the USB plug J1 of PDIUSBD12 constitutes by model, wherein, D1 and R1 series connection, the anodal positive source that connects of D1,21 pin of another termination of R1 U1 are used for showing the state of USB circuit; C3 and C4 parallel connection, two ends connect positive source and ground respectively, D3 and D4 series connection, and positive pole meets FB1, and negative pole connects positive source, constitutes the step-down filtering circuit, powers to system; The Y1 two ends connect 22,23 pin of C1, C2 and U1 respectively, and C1, C2 other end ground connection are formed oscillatory circuit; The FB1 two ends connect 1 pin and the D4 positive pole of J1 respectively, and the FB2 two ends connect 4 pin and the ground of J1 respectively, constitute low-pass filter, can reduce high frequency interference; 25,26 pin of U1 connect 2,3 pin of J1 respectively through R2, R3, with main-machine communication; 18,19 pin of R4 two termination U1; 18,20,24,27 pin of U1 connect positive source; The 5 pin ground connection of U1, U1 meets USB1.0 and USB1.1 agreement, finishes the data communication of USB.
As shown in Figure 3, in the above preferred embodiment that provides, described microcontroller 2 is made up of microprocessor chip U2, resistance R 5~R8, light emitting diode D2, and the termination power positive pole of R5, R6, the other end connect 13,12 pin of U2 respectively, and pull-up current is provided; The termination power positive pole of R7,9 pin of another termination U2 provide power-on reset signal; D2 and R8 series connection, the D2 positive pole connects positive source, 14 pin of another termination of R8 U2, the state of demonstration microcontroller; Data bus 32~39 pin of U2 are connected with control line with the data of usb circuit U1 respectively with control line 30,16,17,12,28 pin, and U1 is controlled and communicates by letter; Clock incoming line 19 pin of U2 connect clock division output line 13 pin of U1, provide the clock source by U1 to U2.
In the above preferred embodiment that provides, described microprocessor chip U2 can adopt AVR90 or 8051 series, when adopting AVR90 series, microcontroller 2 is electrically connected with an interface J2,1,2,3,4 pin of J2 connect 9,8,7,6 pin of U2 respectively, utilize this interface can realize the function of online programming.
As shown in Figure 3, in the above preferred embodiment that provides, described flash memory 3 is that the flash memory chip U3 by TC58 or K9 series constitutes, and data line 29~32,41~44 pin of U3 are connected with data line 32~39 pin of U2; The control line 6~9 of described U3 and 16~19 pin are connected with control line 4,13,17,27,3,2,16,1 pin of U2 respectively and are connected, by the read-write process of described microcontroller 2 these flash memories 3 of control.
The present invention does not need mechanical fetch equipment, is pure electronics mode access data, and its operation is realized by software.
Before the reading/writing method of the micro memory that describes band USB (universal serial bus) plug provided by the invention in detail, at first explain or define some relevant technical terms that relate to:
So-called USB interface, USB wherein is the abbreviation of original text Universal Serial Bus, i.e. USB (universal serial bus), and its standard is formulated jointly by Compaq, Intel, Microsoft, NEC, be intended to make be connected more simple and conveniently between personal computer and peripheral hardware, versatility is better;
" operating system upper layer drivers ", meaning by operating system provides, and the program of service is provided to application program.This instructions special secondary school refers to file system driver and SCSI class driver;
" device driver " means the specific program corresponding to certain equipment, service is provided for the operating system upper layer drivers, and this instructions special secondary school refers to the device driver of USB interface quickflashing external memory device;
" operating system bsp driver ", meaning by operating system provides, and aims at the program that some general-purpose interface is controlled, and it provides service for some device driver.This instructions special secondary school refers to the USB interface bsp driver;
" microcontroller program ", mean in the microcontroller of the equipment of being solidificated in the Host Command that receives by certain general-purpose interface to be responded, make corresponding operation, and result or state turned back to main frame, the operating system bsp driver of it and main frame is communicated by letter.This instructions specially refers to the program of microcontroller in the USB interface quickflashing external memory device;
The invention provides data in the micro memory of band USB (universal serial bus) plug to deposit in and read with the data block be that unit carries out, wherein the data block size is determined by used flash memory chip characteristic.
Describe the reading/writing method of the micro memory of band USB (universal serial bus) plug provided by the invention in detail below in conjunction with accompanying drawing:
Referring to Fig. 4, shown in it according to the Control Software hierarchy chart of micro memory under WINDOWS98 operating system of band USB (universal serial bus) plug of the present invention.This Control Software is a driver, comprises operating system upper layer drivers (comprising file system driver and SCSI class driver), device driver (comprising SCSI miniport driver and USB driver), USB bsp driver (comprising usb hub driver and usb host controller driver) and microcontroller program.Wherein said microcontroller program is moved solidifying in microcontroller U1 and in microcontroller U1, and control flash memory chip U3 and USB interface chip U1 communicate by letter with the USB bsp driver; Described USB bsp driver is to be provided by operating system under WINDOWS98/2000, LINUX and MAC OS, the bsp driver that under WINDOWS NT, uses the applicant to provide, and it is responsible for communicating by letter of main control system USB interface and device driver; Described device driver is based upon on the USB bsp driver, explain and operation requests that complete operation system or application program are sent the micro memory of band USB (universal serial bus) plug, described operating system upper layer drivers is provided by operating system, and provide service to application program, be responsible for simultaneously sending the read-write requests of application program to device driver.
As shown in Figure 4, after application program sends a read request, this read request at first is sent to file system driver and SCSI class driver, be given to the SCSI miniport driver again, the SCSI miniport driver can be the form of current request conversion cost matching requirements, and passing to the USB driver of this device, the USB driver can send to the request of changing the USB bsp driver, and finally passes to the usb circuit of this device by USB interface.
Referring to Fig. 5, wherein show the driver process flow diagram that the micro memory with band USB (universal serial bus) plug of the present invention provides.Its basic operation process in turn includes the following steps:
As step S 501Shown in, after the micro memory of band USB (universal serial bus) plug inserted the USB socket of main frame, foregoing circuit in the storer will obtain power supply from USB interface, microcontroller U2 resets thereupon and begins to carry out built-in microcontroller program: at first carry out initialization, the effect of this part program is an initial parameter of setting microcontroller U2 and USB interface chip U1; After the work of setting is finished, microcontroller U2 will enter waiting status, wait for that main frame sends request (being that the USB interface chip produces interruption);
As step S 502Shown in, after the USB interface chip U1 initialization, main frame will detect has equipment to connect on the USB interface.The USB bsp driver that is provided by operating system will send a series of requests and install to this, and microcontroller U2 can carry out by USB interface chip U1 and interrupt the interrupt service routine that causes, by each request of interrupt service routine processing host;
As step S 503Shown in, after above-mentioned Request Processing finishes, host operating system will at first load the USB driver in the device driver of writing for this storer that is installed in advance in the host hard drive;
As step S 504Shown in, behind above-mentioned USB driver loaded, the USB driver can at first create a device object and the notifying operation system has new equipment to connect;
As step S 514Shown in, operating system loads the SCSI miniport driver of this storer;
Enter step S then 515, after the USB of this storer driver and SCSI miniport driver all were loaded in the system, main frame carried out initialization and creates a new driver symbol according to device signal;
Enter afterwards and wait for operation steps S 516, after main frame sends a request, then enter step S 517, the operating system upper layer drivers judges whether to be the file read operation, if judged result is sure, then enters step S 518, by calling USB driver read block; As judged result is to negate, and then enters step S 519, judge whether to be the file write operation, if judged result is sure, then enter step S 520,, enter step S then by calling USB driver read block 521, merge new data block and call USB driving writing data blocks; If judged result negates then to enter step S 522, the operating system upper layer drivers judges whether to be unit deletion, if judged result is sure, then enters step S 524, the present invention is unloaded by system; As judged result is to negate, and then enters step S 523, return error message.
As shown in Figure 5, in above-mentioned steps, step S 518, S 521, S 523Promptly enter step S after complete 505, enter the wait solicited status;
As step S 506Shown in, after this storer obtains a request, judge that at first whether this request is read request, if judged result is sure, then enters step S 507, by calling USB bottom layer driving, reading of data; If judged result negates then to enter the determining step S of write request 508If judged result is sure, then enter step S 509,, write data by calling the USB bottom layer driving; If judged result negates then to enter the determining step S of the request of extracting 510If judged result is sure, then enter step S 512, handle and the sweep equipment connection, enter step S then 513, unloaded by system; If judged result negates then to return error message.
When said process carried out, the microcontroller program was also carried out control corresponding, and its flow process in turn includes the following steps as shown in Figure 6: step S 601, this storer inserts computing machine; Step S 602, hardware initialization; Step S 603, wait for and interrupting; Step S 604, the microcontroller program judges whether into USB interrupts, if judged result negates then to turn back to step S 603, wait for and interrupting; If judged result is sure, then enter interrupt service routine, this program at first judges whether to be control transmission, enters step S 605If judged result is sure, then enter step S 606, the disposal system request after disposing, then turns back to step S 603, wait for and interrupting; If judged result negates then to enter step S 607, this program judges whether into the piece transmission, if judged result negates then to turn back to step S 603, wait for and interrupting; If judged result is sure, then enter step S 608, handle self-defined request, after disposing, turn back to step S 603, wait for and interrupting.Afterwards when this device when USB interface is pulled up, then enter S 609Extract step, this microcontroller program quits work, main frame can detect above-mentioned state automatically simultaneously, and notifies the USB driver equipment of this device to remove.The USB driver can carry out some necessary processing, cancels the read-write requests that those are not finished, the sweep equipment object.Because the USB driver has been deleted the device object of being created by it, so after the unloading of the USB driver of this device, the SCSI miniport driver also can be operated system's unloading thereupon.
After above-mentioned preparation was finished substantially, the SCSI miniport driver can first fetch equipment information specific, began then to wait for that application program sends " read/write " request, and so far the initial work of hardware and software is finished, and the present invention enters the read-write requests state of waiting for;
After the USB interface chip received the request that main frame sends by USB interface, the USB interface chip can send a look-at-me to microcontroller, and microcontroller can change carries out interrupt service routine.Interrupt service routine can be analyzed the request that main frame is sent, microcontroller can write down the block description that main frame will read after finding to be read request, can from flash memory chip, read a blocks of data then at every turn and beam back main frame, all send up to the data of all requirements by the USB interface chip.
Issue these data of main frame and can pass to the SCSI miniport driver by the USB driver of this device, and finally pass to application program, read operation is so far finished.
Similar with said process, after operating system is received the write request that application program sends, also can earlier the SCSI miniport driver be passed in this request, convert thereof into the form of this matching requirements by the SCSI miniport driver.But because flash memory chip can only monoblock write, so the SCSI miniport driver can read earlier a part of data from this device, and the data that will write are merged into complete data block with the data of reading back and write this device afterwards more then.After data write and finish, the SCSI miniport driver can return to file system driver to mode of operation.
Be described in detail the read operation process of this micro memory below in conjunction with accompanying drawing 8, in turn include the following steps:
1) as step S among the figure 801, S 802Expression, at first the application program of host operating system is sent a read command to the operating system upper layer drivers;
2) as step S 803Shown in, the operating system upper layer drivers judges whether mentioned order is the read operation of this device, is to negate as judged result, then enters S 804Shown step stops carrying out this order; As judged result is sure, then enters step S 805, read request is given to device driver;
3) at step S 805, device driver is converted to the command sequence of operating system bsp driver to read request, enters step S then 806
4) at step S 806, device driver is according to command sequence calling system bsp driver;
5) after above-mentioned steps is finished, enter step S 807, the operating system bsp driver is passed to the microcontroller program by USB interface;
6) after above-mentioned steps is finished, enter step S 808, the microcontroller program is made respective operations, and promptly microcontroller writes down the block description that main frame will read, and reads a blocks of data then at every turn and beam back main frame by the USB interface chip from flash memory chip, enters step S then 809, the microcontroller program is sent result and state back to the operating system bsp driver; " result " described herein is meant the data that read from this micro memory, and " state " is meant whether read operation is finished;
7) at step S 809In, the operating system bsp driver is with result and state Returning equipment driver;
8) enter step S then 810, device driver repeats to finish 4,5,6,7 steps according to result and state, up to finishing the operation that total data reads, enters step S then 811, data and state are returned to the operating system upper layer drivers;
9) after above-mentioned steps is finished, enter step S 811, the operating system upper layer drivers returns to application program with data and state again, promptly enters step S 812
As shown in Figure 9, main frame is as follows to the step that the micro memory of band USB (universal serial bus) plug of the present invention writes data:
1) as step S among the figure 901, S 902Expression, host application program sends a write order to the operating system upper layer drivers;
2) as step S 903, the operating system upper layer drivers judges whether this order is the write operation of this device, is to negate as judged result, then enters step S 904, stop carrying out this order; As judged result is sure, then enters step S 905, write request is given to device driver;
3) enter step S then 906, device driver is carried out the read operation of corresponding data piece earlier, and " corresponding data piece " described herein is meant the inner original data of micro memory of the present invention;
4) at step S 906, device driver is converted to read request the command sequence of operating system bsp driver;
5) at step S 906, device driver is according to command sequence call operation system bottom driver;
6) at step S 906, the command code that the operating system bsp driver will define is passed to the microcontroller program by USB interface;
7) at step S 906, the microcontroller program is made respective operations, and sends result and state back to the operating system bsp driver;
8) at step S 906, the operating system bsp driver is with result and state Returning equipment driver;
9) at step S 906, device driver repeats to finish 5,6,7,8 steps according to result and state, reads up to finishing data block, and data are stored in buffer zone, because the process of above-mentioned reading of data is identical with aforementioned read operation process, so is reduced to step S in the process flow diagram 906
10) after above-mentioned steps is finished, enter step S 907, unchanged data are merged into new data block and are stored in buffer zone in data that device driver will be rewritten and the buffer zone;
11) enter step S then 908, device driver is converted to write request the command sequence of operating system bsp driver;
12) enter step S then 909, device driver is according to command sequence call operation system bottom driver;
13) enter step S then 910, the command code that the operating system bsp driver will define is passed to the microcontroller program by USB interface;
14) enter step S then 911, the microcontroller program is made respective operations, comprising wiping and write operation, enters step S then 912, and send state back to the operating system bsp driver; " state " is meant whether write operation is finished;
15) at step S 912, the operating system bsp driver is with result and state Returning equipment driver;
16) enter step S then 913, device driver repeats to finish 12,13,14,15 steps according to result and state, all writes up to the data of finishing in the buffer zone, enters step S then 914, state is returned to the operating system upper layer drivers;
17) after above-mentioned steps is finished, enter step S 915, the operating system upper layer drivers returns to application program with state.

Claims (10)

1, a kind of micro memory with the USB (universal serial bus) plug, comprise that shell and part are loaded on its inner circuit board, usb circuit (1) is installed on the circuit board, microcontroller (2) and flash memory (3), described usb circuit (1) is connected with the USB interface of personal computer by USB plug, it is characterized in that: described microcontroller circuit (2) and described usb circuit (1) and the multi-thread respectively two-way address that is connected in of flash memory circuit (3), data, on the control bus, the clock source of described microcontroller (2) is provided by described usb circuit (1).
2, the micro memory of band USB (universal serial bus) plug according to claim 1 is characterized in that: the control bus of described microcontroller (2) is electrically connected with described usb circuit (1) and described flash memory (3) by analog switching circuit (4).
3, the micro memory of band USB (universal serial bus) plug according to claim 1, it is characterized in that: described microcontroller (2) is electrically connected with a condition indication circuit, described condition indication circuit comprises a light emitting diode D2, is shown by this light emitting diode D2 realization state.
4, the micro memory of band USB (universal serial bus) plug according to claim 3, it is characterized in that: described condition indication circuit comprises light emitting diode D2 and resistance R 8, D2 and R8 series connection, the D2 positive pole connects positive source, the I/O pin of another termination of R8 U2 is shown by this light emitting diode D2 realization state.
5, the micro memory of band USB (universal serial bus) plug according to claim 1, it is characterized in that: described usb circuit (1) is that interface chip U1, crystal resonator Y1, resistance R 1~R4, capacitor C 1~C4, light emitting diode D1, diode D3 and D4, magnetic bead FB1 and FB2, the USB plug J1 of PDIUSBD12 constitutes by model, wherein, D1 and R1 series connection, the anodal positive source that connects of D1,21 pin of another termination of R1 U1 are used for showing the state of USB circuit; C3 and C4 parallel connection, two ends connect positive source and ground respectively, D3 and D4 series connection, and positive pole meets FB1, and negative pole connects positive source, constitutes the step-down filtering circuit; The Y1 two ends connect 22,23 pin of C1, C2 and U1 respectively, and C1, C2 other end ground connection are formed oscillatory circuit; The FB1 two ends connect 1 pin and the D4 positive pole of J1 respectively, and the FB2 two ends connect 4 pin and the ground of J1 respectively, constitute low-pass filter; 25,26 pin of U1 connect 2,3 pin of J1 respectively through R2, R3, with main-machine communication; 18,19 pin of R4 two termination U1; 18,20,24,27 pin of U1 connect positive source; The 5 pin ground connection of U1.
6, the micro memory of band USB (universal serial bus) plug according to claim 1 is characterized in that: described microcontroller (2) is made up of microprocessor chip U2, resistance R 5~R8, light emitting diode D2; The termination power positive pole of R5, R6, the other end connect 13,12 pin of U2 respectively, and pull-up current is provided; The termination power positive pole of R7,9 pin of another termination U2 provide power-on reset signal; D2 and R8 series connection, the D2 positive pole connects positive source, 14 pin of another termination of R8 U2, the state of demonstration microcontroller; Data bus 32~39 pin of U2 are connected with control line with the data of usb circuit U1 respectively with control line 30,16,17,12,28 pin, and U1 is controlled and communicates by letter; Clock incoming line 19 pin of U2 connect clock division output line 13 pin of U1, provide the clock source by U1 to U2.
7, the micro memory of band USB (universal serial bus) plug according to claim 6, it is characterized in that: described microprocessor chip U2 is AVR90 or 8051 series, when adopting AVR90 series, microcontroller (2) is electrically connected with an interface J2,1,2,3,4 pin of J2 connect 9,8,7,6 pin of U2 respectively, realize online programming.
8, the micro memory of band USB (universal serial bus) plug according to claim 1, it is characterized in that: described flash memory (3) is that the flash memory chip U3 by TC58 or K9 series constitutes, and data line 29~32,41~44 pin of U3 are connected with data line 32~39 pin of U2; The control line 6~9 of described U3 and 16~19 pin are connected with control line 4,13,17,27,3,2,16,1 pin of U2 respectively and are connected.
9, the reading/writing method of the micro memory of band USB (universal serial bus) plug comprises following operation steps:
(1) initialization, following operation steps is specifically arranged: the USB socket that this micro memory is inserted main frame, circuit obtains power supply from USB interface in this micro memory, microcontroller U2 resets and begins to carry out built-in microcontroller program, carry out initialization, set the initial parameter of microcontroller U2 and USB interface chip U1; Main frame detects has equipment to connect on the USB interface, according to the standard of host operating system, operating system bonding apparatus driver is done respective handling, up to produce available memory device in system;
(2) the wait application program is sent " read/write " request;
It is characterized in that:
" A " comprises the steps: from the process of this micro memory reading of data
1) the operating system upper layer drivers receives the application program read command;
2) the operating system upper layer drivers judges whether the read operation into this micro memory, is to negate as judged result, then stops carrying out; As judged result is sure, then device driver is given in request;
3) device driver is converted to read request the command sequence of operating system bsp driver;
4) device driver is according to command sequence calling system bsp driver;
5) the operating system bsp driver command code that will define is passed to the microcontroller program by USB interface;
6) the microcontroller program is made respective operations, and sends result and state back to the operating system bsp driver;
7) the operating system bsp driver is with result and state Returning equipment driver;
8) device driver repeats to finish 4,5,6,7 steps according to result and state, up to finishing the operation that data block reads, data and state is returned to the operating system upper layer drivers;
9) the operating system upper layer drivers returns to application program with data and state again.
" B " main frame comprises the steps: the process that the micro memory of being with the USB (universal serial bus) plug writes data
1) system's upper layer drivers receives the application program write order;
2) the operating system upper layer drivers judges whether the write operation into this micro memory, is to negate as judged result, then stops carrying out; As judged result is sure, then device driver is given in request;
3) device driver is carried out the read operation of corresponding data piece earlier;
4) device driver is converted to read request the command sequence of operating system bsp driver;
5) device driver is according to command sequence call operation system bottom driver;
6) the operating system bsp driver command code that will define is passed to the microcontroller program by USB interface;
7) the microcontroller program is made respective operations, and sends result and state back to the operating system bsp driver;
8) the operating system bsp driver is with result and state Returning equipment driver;
9) device driver repeats to finish 5,6,7,8 steps according to result and state, reads up to finishing data block, and data are stored in buffer zone;
10) unchanged data are merged into new data block and are stored in buffer zone in the data that will preserve of device driver and the buffer zone;
11) device driver is converted to write request the command sequence of operating system bsp driver;
12) device driver is according to command sequence call operation system bottom driver;
13) the operating system bsp driver command code that will define is passed to the microcontroller program by USB interface;
14) the microcontroller program is made respective operations, comprising erase operation and write operation, and sends result and state back to the operating system bsp driver;
15) the operating system bsp driver is with result and state Returning equipment driver;
16) device driver repeats to finish 12,13,14,15 steps according to result and state, all writes up to the data of finishing in the buffer zone, and result and state are returned to the operating system upper layer drivers;
17) the operating system upper layer drivers returns to application program with result and state.
10, the reading/writing method of the micro memory of band USB (universal serial bus) plug according to claim 9: it is characterized in that: the data in the micro memory of described band USB (universal serial bus) plug to deposit in and read with the data block be that unit carries out.
CNB011021276A 2001-01-21 2001-01-21 Miniature memory with universal serial bus plug Expired - Lifetime CN1165003C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB011021276A CN1165003C (en) 2001-01-21 2001-01-21 Miniature memory with universal serial bus plug

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB011021276A CN1165003C (en) 2001-01-21 2001-01-21 Miniature memory with universal serial bus plug

Publications (2)

Publication Number Publication Date
CN1367437A true CN1367437A (en) 2002-09-04
CN1165003C CN1165003C (en) 2004-09-01

Family

ID=4652491

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB011021276A Expired - Lifetime CN1165003C (en) 2001-01-21 2001-01-21 Miniature memory with universal serial bus plug

Country Status (1)

Country Link
CN (1) CN1165003C (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1300711C (en) * 2003-04-30 2007-02-14 日商.萩原科技股份有限公司 Usb storage device and program
CN106201960A (en) * 2016-06-29 2016-12-07 联想(北京)有限公司 A kind of general-purpose serial bus USB interface, input equipment and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1300711C (en) * 2003-04-30 2007-02-14 日商.萩原科技股份有限公司 Usb storage device and program
CN106201960A (en) * 2016-06-29 2016-12-07 联想(北京)有限公司 A kind of general-purpose serial bus USB interface, input equipment and electronic equipment

Also Published As

Publication number Publication date
CN1165003C (en) 2004-09-01

Similar Documents

Publication Publication Date Title
CN1088218C (en) Electronic flash storage method and device for data processing system
CN1282100C (en) General serial bus-unit controlling method and general serial bus-unit controller
CN1251105C (en) Data processing system and data processor
CN1761935A (en) Semiconductor memory card, semiconductor memory control apparatus, and semiconductor memory control method
CN1150851A (en) Portable computer keyboard for use with plurality of different host computers
US20070162679A1 (en) Bus device
CN1154937C (en) Data processing system and method for remotely inhibiting work of subscriber's computer system
CN1317744A (en) Semiconductor memory device
CA2021832A1 (en) Apparatus and method for improving the communication efficiency between a host processor and peripheral devices connected by an scsi bus
CN2479547Y (en) Micro memory with USB plug
CN1825266A (en) Flash memory controller utilizing multiple voltages and a method of use
CN101051242A (en) Power supply control method and device for computer system
CN1165003C (en) Miniature memory with universal serial bus plug
CN101042672A (en) High speed emulator used for digital signal processor and operation method thereof
CN1731362A (en) Harddisk hot-swap protection system and method
CN1845087A (en) Interrupt handling method and interrupt handling apparatus
CN1152307C (en) Method and device for implementing fully electronic flash storage
CN1270253C (en) Large-scale integrated circuit comprising central processing unit
CN1527974A (en) Kernel function realizing mechanism, entertainment apparatus having same, and peripheral device control method by same
CN1549147A (en) Memory storage device control system with double interfaces
CN1661582A (en) Data processing chip and memory device
CN2513159Y (en) Micro flashing storage card with serial bus interface
CN1534499A (en) SATA flash storage device
CN1294494C (en) System for detecting master USB interface transfer rate and method thereof
CN2748971Y (en) Universal Serial Bus host controller with block device parallel interface

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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
C56 Change in the name or address of the patentee

Owner name: FEITIAN TECHNOLOGIES CO., LTD.

Free format text: FORMER NAME: BEIJING FEITIAN CHENGXIN SCIENCE + TECHNOLOGY CO. LTD.

CP03 Change of name, title or address

Address after: 100085 Beijing city Haidian District Xueqing Road No. 9 Ebizal building B block 17 layer

Patentee after: Feitian Technologies Co., Ltd.

Address before: 100088 Beijing city Haidian District Xueyuan Road five Jimen Hotel No. three layer

Patentee before: Beijing Feitian Chengxin Science & Technology Co., Ltd.

CX01 Expiry of patent term
CX01 Expiry of patent term

Granted publication date: 20040901