MEMORY CONTROLLER, MEMORY DEVICE AND METHOD FOR DETERMINING TYPE OF MEMORY DEVICE
A memory controller includes a clock detector and a microprocessor. The clock detector is utilized for detecting if a specific pin of the memory controller has a clock signal thereon to generate a detecting result. The microprocessor is coupled to the clock generator, and is utilized for determining which type of memory devices that the memory controller is applied to according to the detecting result.
1. Field of the Invention
The present invention relates to a memory device, and more particularly, to a flash memory controller, a flash memory device and a method for determining a type of a memory device.
2. Description of the Prior Art
The flash memory devices can be classified into two types, double data rate NAND-type (DDR NAND-type) flash memory device and single data rate NAND-type (SDR NAND-type) flash memory device. A flash memory controller, built in the flash memory device, will detect a type of the flash memory device automatically when the flash memory controller starts up, and then the flash memory controller can be correctly operated.
The conventional flash memory controller determines the type of the flash memory device by reading a content of a specific bit stored in a flash memory chip. However, because an error may be occurred when the flash memory controller reads the content of the specific bit, and an address of the specific bit may be varied when flash memory controllers are provided by different manufactures, the flash memory controller may erroneously determine the type of the flash memory device when a single bit is used in this determination step, which influences the operations of the flash memory device.
SUMMARY OF THE INVENTIONIt is therefore an objective of the present invention to provide a memory controller, a memory device and a method for determining a type of a memory device, which can correctly determine the type of the memory device, to solve the above-mentioned problems.
According to one embodiment of the present invention, a memory controller comprises a clock detector and a microprocessor. The clock detector is utilized for detecting if a specific pin of the memory controller has a clock signal thereon to generate a detecting result. The microprocessor is coupled to the clock generator, and is utilized for determining which type of memory devices that the memory controller is applied to according to the detecting result.
According to another embodiment of the present invention, a method for determining a type of a memory device comprises: detecting if a specific pin of a memory controller placed in the memory device has a clock signal thereon to generate a detecting result; and determining the type of the memory device according to the detecting result.
According to another embodiment of the present invention, a memory device comprises at least a memory chip and a memory controller coupled to the memory chip, where the memory controller comprises a clock detector and a microprocessor. The clock detector is utilized for detecting if a specific pin of the memory controller has a clock signal thereon to generate a detecting result. The microprocessor is coupled to the clock generator, and is utilized for determining which type of memory devices that the memory controller is applied to according to the detecting result.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
Typically, the flash memory 120 comprises a plurality of blocks, and the controller (e.g. the memory controller 110 that executes the program code 112C by utilizing the microprocessor 112) performs data copying, erasure and combining operations on the flash memory 120 by copying, erasing and combining in units of blocks. In addition, a block can be utilized for recording a specific amount of pages, where the controller (e.g. the memory controller 110 that executes the program code 112C by utilizing the microprocessor 112) performs data writing operations on the flash memory 120 by writing/programming in units of pages.
In practice, the memory controller 110 that executes the program code 112C by utilizing the microprocessor 112 is capable of performing various control operations by utilizing the internal components within the memory controller 110. For example, the memory controller 110 utilizes the control logic 114 to control access to the flash memory 120 (e.g. operations of accessing at least one block or at least one page), utilizes the buffer memory 116 to perform buffering operations for the memory controller 110, and utilizes the interface logic 118 to communicate with a host device.
In addition, when the memory device 100 is a DDR NAND-type flash memory device, the pin 111—n is electrically connected to the flash memory 120, and the memory controller 110 uses the clock signal DQS to transmit data to the flash memory 120 (especially from the host device to the flash memory 120) or to read data from the flash memory 120 (especially the data read by the host device). When the memory controller 110 intends to store data into the flash memory 120, the memory controller 110 transmits the clock signal DQS to the flash memory 120; and when the memory controller 110 intends to read data from the flash memory 120, the memory controller 110 receives the clock signal DQS from the flash memory 120. Furthermore, the memory controller 110 uses the clock signal WE to transmit commands or addresses to the flash memory 120. In addition, when the memory controller 110 intends to read data from the flash memory 120, first, the microprocessor 112 transmits a read command to the flash memory 120, and after the microprocessor 112 transmits the read command to the flash memory 120, the flash memory 120 will transmit the clock signal DQS and the data synchronously to the memory controller 110. On the other hand, when the memory device 100 is a SDR NAND-type flash memory device, the pin 111—n is not electrically connected to the flash memory 120 (i.e., the pin 111—n is floating).
In addition, please refer to
Therefore, because the DDR NAND-type flash memory device has the clock signal DQS and the SDR NAND-type flash memory device does not have the clock signal DQS, an embodiment of the present invention provides a method to determine a type of the memory device 100 by detecting if a specific pin (i.e., the pin 111—n) of the memory controller 110 has a clock signal (i.e., the clock signal DQS). Particularly, the type of the memory device 100 is determined by detecting if the specific pin receives the clock signal DQS from the flash memory 120.
Please refer to
In Step 200, the flow is started, and the memory device 100 starts up. Then, in Step 202, the microprocessor 112 transmits a read command to the flash memory 120 to ask for data stored in the flash memory 120. Then, in Step 204, after the microprocessor 112 transmits the read command to the flash memory 120, the clock detector 113 detects if the pin 111—n has the clock signal DQS thereon. If the pin 111—n has the clock signal DQS thereon, the flow enters Step 206 to set the memory controller 110 to be operated at a DDR NAND-type mode; and if the pin 111—n does not have the clock signal DQS thereon, the flow enters Step 208 to set the memory controller 110 to be operated at a SDR NAND-type mode. When the memory controller 110 is set to be operated at the DDR NAND-type mode, the memory controller 110 will notice the related circuit (i.e., the control logic 114) to use the clock signal DQS to sample the data DATA, that is using the rising edge and the falling edge of the clock signal DQS to sample the data DATA.
In addition, please refer to
Please refer to
It is noted that, because the voltage level at the pin 111—n may be varied due to noises, a plurality of flip-flops 320_1-320_M are arranged in the flip-flop group 320 to prevent from erroneously determining a SDR NAND-type flash memory device to be a DDR NAND-type flash memory device. In other words, the enable signal EN is transmitted to the checking logic 340 only if the voltage level of the clock signal DQS varies between logics “0” and “1” many times. Therefore, the erroneous determination can be avoided. It is noted that, the clock detector 300 shown in
Please refer to
Briefly summarized, in the memory controller, memory device and method for determining the type of the memory device of the present invention, the type of the memory device is determined by detecting if a specific pin of the memory controller has a clock signal thereon. Therefore, compared with the prior art flash memory device, the present invention can determine the type of the memory device more accurately to prevent from influencing the operations of the memory device.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.
Claims
1. A memory controller, comprising:
- a clock detector, for detecting if a specific pin of the memory controller has a first clock signal thereon to generate a detecting result; and
- a microprocessor, coupled to the clock detector, for determining which type of memory devices that the memory controller is applied to according to the detecting result.
2. The memory controller of claim 1, wherein when the memory controller starts up, the microprocessor transmits a read command to a memory; and after the microprocessor transmits the read command to the memory, the clock detector detects if the specific pin of the memory controller has the first clock signal thereon, where the first clock signal is outputted from the memory in response to the read command.
3. The memory controller of claim 1, wherein when the detecting result represents that the specific pin has the first clock signal thereon, the microprocessor determines that the memory controller is applied to a double data rate NAND-type (DDR NAND-type) flash memory device.
4. The memory controller of claim 1, wherein when the detecting result represents that the specific pin does not have the first clock signal thereon, the microprocessor determines that the memory controller is applied to a single data rate NAND-type (SDR NAND-type) flash memory device.
5. The memory controller of claim 1, wherein the clock detector comprises:
- a control unit, wherein when the memory controller starts up, the control unit outputs a state signal;
- at least one flip-flop, having a data input terminal coupled to the control unit, a clock receiving terminal coupled to the specific pin, and a data output terminal; and
- a checking logic, coupled to the data output terminal of the at least one flip-flop, and generating the detecting result according to a state at the data output terminal of the at least one flip-flop.
6. The memory controller of claim 1, wherein the clock detector generates the detecting result after detecting if the specific pin has the first clock signal a plurality of times.
7. The memory controller of claim 6, wherein when the detecting result represents that a number of times that the specific pin is detected to have the first clock signal thereon is greater than a threshold value, the microprocessor determines that the memory controller is applied to a DDR NAND-type flash memory device.
8. The memory controller of claim 6, wherein when the detecting result represents that a number of times that the specific pin is detected to have the first clock signal thereon is not greater than a threshold value, the microprocessor determines that the memory controller is applied to a SDR NAND-type flash memory device.
9. The memory controller of claim 6, wherein the clock detector comprises:
- a sampling unit, for utilizing a second clock signal to sample a voltage level at the specific pin to generate a sampled signal; and
- a counter, coupled to the sampling unit, for accumulating a number of times that the voltage level at the specific pin is varied to generate the detecting result according to the sampled signal.
10. A method for determining a type of a memory device, comprising:
- detecting if a specific pin of a memory controller of the memory device has a first clock signal thereon to generate a detecting result; and
- determining the type of the memory device according to the detecting result.
11. The method of claim 10, further comprising:
- when the memory controller starts up, transmitting a read command to a memory; and
- the step of generating the detecting result comprises: after transmitting the read command to the memory, detecting if the specific pin of the memory controller has the first clock signal thereon, where the first clock signal is outputted from the memory in response to the read command.
12. The method of claim 10, wherein the step of determining the type of the memory device according to the detecting result comprises:
- when the detecting result represents that the specific pin has the first clock signal thereon, determining that the memory controller is applied to a double data rate NAND-type (DDR NAND-type) flash memory device.
13. The method of claim 10, wherein the step of determining the type of the memory device according to the detecting result comprises:
- when the detecting result represents that the specific pin does not have the first clock signal thereon, determining that the memory controller is applied to a single data rate NAND-type (SDR NAND-type) flash memory device.
14. The method of claim 10, wherein the step of generating the detecting result comprises:
- when the memory controller starts up, outputting a state signal;
- providing at least one flip-flop having a data input terminal coupled to the control unit, a clock receiving terminal coupled to the specific pin, and a data output terminal; and
- generating the detecting result according to a state at the data output terminal of the at least one flip-flop.
15. The method of claim 10, wherein the step of generating the detecting result comprises:
- generating the detecting result after detecting if the specific pin has the first clock signal a plurality of times.
16. The method of claim 15, wherein the step of determining the type of the memory device according to the detecting result comprises:
- when the detecting result represents that a number of times that the specific pin is detected to have the first clock signal thereon is greater than a threshold value, determining that the memory controller is applied to a DDR NAND-type flash memory device.
17. The method of claim 15, wherein the step of determining the type of the memory device according to the detecting result comprises:
- when the detecting result represents that a number of times that the specific pin is detected to have the first clock signal thereon is not greater than a threshold value, determining that the memory controller is applied to a SDR NAND-type flash memory device.
18. The method of claim 15, wherein the step of generating the detecting result comprises:
- utilizing a second clock signal to sample a voltage level at the specific pin to generate a sampled signal; and
- accumulating a number of times that the voltage level at the specific pin is varied to generate the detecting result according to the sampled signal.
19. A memory device, comprising:
- at least one memory chip; and
- a memory controller, coupled to the at least one memory chip, comprising: a clock detector, for detecting if a specific pin of the memory controller has a first clock signal thereon to generate a detecting result; and a microprocessor, coupled to the clock detector, for determining the type of the memory device according to the detecting result.
20. The memory device of claim 19, wherein when the memory controller starts up, the microprocessor transmits a read command to a memory; and after the microprocessor transmits the read command to the memory, the clock detector detects if the specific pin of the memory controller has the first clock signal thereon, where the first clock signal is outputted from the memory in response to the read command.
21. The memory device of claim 19, wherein the clock detector generates the detecting result after detecting if the specific pin has the first clock signal a plurality of times.
Type: Application
Filed: Aug 18, 2011
Publication Date: Jul 5, 2012
Patent Grant number: 8984250
Inventors: Chi-Chih Kuan (Nantou County), Chun-Yu Chen (New Taipei City)
Application Number: 13/213,052
International Classification: G06F 1/10 (20060101); G06F 12/00 (20060101);