1. Field of the Invention
The present invention relates to a flash memory accessing apparatus and a method thereof, and more particularly to a dual-channel flash memory accessing apparatus and a method thereof.
2. Description of Related Art
The flash memory is an electrically programmable read only memory which can be erased or programmed several times during operations. Usually, the flash memory includes the NOR flash memory or the NAND flash memory. No matter the flash memory is the NOR flash memory or the NAND flash memory, there is the number of times to erase or program the flash memory is limited. Taking the NAND flash memory as an example, the number of times to erase or program the multi-level cell NAND flash memory is usually about ten thousands. Also, the number of times to erase or program the single-level cell NAND flash memory is usually about hundred thousands.
In the current technology, there is a dual channel flash memory accessing apparatus. When this conventional dual channel flash memory accessing apparatus stores data, the data is divided into two data sections. The two data sections are stored into different flash memories through different channels at the same time. Therefore, the rate for storing data into the flash memories effectively doubles. That is, the bandwidth for accessing the data by the flash memory accessing apparatus doubles.
However, the flash memory may be damaged due to too many times of being erased or programmed. In the aforementioned dual channel flash memory accessing apparatus, when the flash memory of one of the channel is damaged, the data stored in the damaged flash memory is lost forever. That is, it is highly possible that the data in the flash memory can not be restored once the flash memory in the conventional dual channel flash memory accessing apparatus is damaged.
The invention provides a flash memory accessing apparatus and method thereof for providing a dual channel flash memory set capable of increasing the transmission bandwidth and providing data backup ability.
The invention provides a flash memory accessing apparatus comprising a controller, a first channel memory set and a second channel memory set. The first channel memory set is coupled to the controller through a first channel and comprises a first flash memory and at least a first memory expanding socket. The first flash memory is coupled to the controller, and the first memory expanding socket is coupled to the first flash memory and the controller. The second channel memory set is coupled to the controller through a second channel. The second channel memory set comprises a second flash memory coupled to the controller and a second memory expanding socket coupled to the second flash memory and the controller. The controller determines a reading operation or a programming operation to be implemented on the first flash memory and the second flash memory according to a detection of a flash memory insertion state of each of the first memory expanding socket and the second memory expanding socket.
According to one embodiment of the present invention, when the first memory expanding socket is connected to a third flash memory and the second memory expanding socket is connected to a fourth flash memory, the controller determines each of the first flash memory, the second flash memory, the third flash memory and the fourth flash memory as a main memory or a backup memory according to whether the reading operation or the programming operation is normally implemented on the first flash memory, the second flash memory, the third flash memory and the fourth flash memory.
According to one embodiment of the present invention, the controller determines the first flash memory and the second flash memory as the main memories and determines the third flash memory and the fourth flash memory as the backup memories when the controller detects the reading operation or the programming operation is normally implemented on each of the first flash memory, the second flash memory, the third flash memory and the fourth flash memory. Alternatively, the controller determines the third flash memory and the fourth flash memory as the main memories and determines the first flash memory and the second flash memory as the backup memories. It should be noticed that the flash memories configured in the same channel memory set can be the backup memories of each other.
According to one embodiment of the present invention, the third flash memory is used to store a copy of a data stored in the first flash memory and the fourth flash memory is used to store a copy of a data stored in the second flash memory.
According to one embodiment of the present invention, the first flash memory is used to store a copy of a data stored in the third flash memory and the second flash memory is used to store a copy of a data stored in the fourth flash memory.
According to one embodiment of the present invention, the controller determines the second flash memory as the main memory and determines the fourth flash memory as the backup memory when the controller detects the reading operation or the programming operation is abnormally implemented on each of the first flash memory and the third flash memory in the first channel memory set. Alternatively, the controller determines the fourth flash memory as the main memory and determines the second flash memory as the backup memory.
According to one embodiment of the present invention, the controller determines the first flash memory as the main memory and determines the third flash memory as the backup memory when the controller detects the reading operation or the programming operation is abnormally implemented on each of the second flash memory and the fourth flash memory in the second channel memory set. Alternatively, the controller determines the third flash memory as the main memory and determines the first flash memory as the backup memory.
According to an embodiment of the present invention, the first channel memory set, the second channel memory set and the controller are configured on a circuit board.
According to one embodiment of the present invention, the first channel memory set and the controller are configured on a circuit board and the second channel memory set is an open-type NAND flash memory interface set.
According to one embodiment of the present invention, the controller is configured on a circuit board and each of the first channel memory set and the second channel memory set is an open-type NAND flash memory interface set.
According to one embodiment of the present invention, the controller is configured on a circuit board, and each of the first channel memory set and the second channel memory set is an open-type NAND flash memory interface set and is directly configured on the circuit board.
The invention further provides an accessing method of a flash memory comprising providing a controller for implementing a reading operation or a programming operation on a first flash memory and a second flash memory in a first channel memory set and on a third flash memory and a fourth flash memory in a second channel memory set. Then, the controller determines whether each of the first flash memory, the second flash memory, the third flash memory and the fourth flash memory respectively in the first channel memory set and in the second channel memory set is normal according to the reading operation or the programming operation. The controller determines each of the first flash memory, the second flash memory, the third flash memory and the fourth flash memory as a main memory or a backup memory according to whether each of the first flash memory, the second flash memory, the third flash memory and the fourth flash memory is normally operated.
According to the above description, each of the flash memory sets of the present invention equipped with the flash memories as the backup memories. Thus, the data stored in the main flash memories can be copied into the backup memories. Moreover, it can effectively restore the data in the flash memory while it is damaged due to too many times of erasing operation and programming operation. Furthermore, in the present invention, by detecting whether the reading operation or the programming operation is normally implemented, the flash memories in the dual channel memory set can be determined to be the main memories for storing data and the backup memories for storing the copies of the data stored in the main memories. Therefore, the undamaged memories can be efficiently used to present the maximum efficacy thereof.
In order to make the aforementioned and other features and advantages of the invention more comprehensible, embodiments accompanying figures are described in detail below.
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
When there is no memory inserted into the memory expanding sockets 122 and 132, the controller 110 accesses the flash memories 121 and 131 through the first channel 150 and the second channel 160 respectively in a dual channel method according to a flash memory insertion-less state of the memory expanding sockets 122 and 132 detected by the controller 110.
Alternatively, when the memory expanding sockets 122 and 132 are connected to the flash memory 123 and 133 respectively as shown in
Thereafter, the controller 110 determines each of the flash memories as the main memory or the backup memory according to whether the reading operation or the programming operation can be normally implemented on the flash memories 121, 123, 131 and 133. The main memory is used to store the data and the backup memory is used to store the copies of the data stored in the main memory.
It should be noticed that the controller 110 periodically implements the detection operation for determining whether the reading operation or the programming operation of the flash memories 121, 123, 131 and 133 is normal. Because the flash memory may be damaged due to too many times of erasing operation and programming operation, the controller 110 needs to know whether the flash memories 121, 123, 131 and 133 in the flash memory accessing apparatus 100 are damaged and to dynamically adjust which of the flash memories is the main memory and which of the flash memories is the backup memory.
The following description details the controller 110 of the present embodiment implementing the designing method of the flash memories 121, 123, 131 and 133 according to whether the reading operation or the programming operation can be normally implemented on the flash memories 121, 123, 131 and 133, which is determined by the controller 110, so that the people skilled in the art can further understand the details of the present embodiment.
As shown in
Furthermore, the controller 110 can also determine the flash memory 121 and the flash memory 133 to be the main memories (as indicated by the dotted line 230). Further, the flash memory 123 and the flash memory 131 are determined as the backup memories. The flash memory 123 can be used to store the copy of the data stored in the flash memory 121. Similarly, the flash memory 131 can be used to store the copy of the data stored in the flash memory 133. Alternatively, the controller 110 can also determine the flash memory 123 and the flash memory 131 to be the main memories (as indicated by the dotted line 240). Further, the flash memory 121 and the flash memory 133 are determined as the backup memories. The flash memory 121 can be used to store the copy of the data stored in the flash memory 123. Similarly, the flash memory 133 can be used to store the copy of the data stored in the flash memory 131.
It can be easily understood that when the flash memories 121, 123, 131 and 133 are not damaged, the controller 110 can determines any of the flash memories in the first channel memory set 120 to be the main memory and determines the other flash memory in the first channel memory set 120 to be the backup memory. Meanwhile, the controller can determines any of the flash memories in the second channel memory set 130 to be the main memory and determines the other flash memory in the second channel memory set 130 to be the backup memory. Therefore, the flash memory accessing apparatus 100 can maintain the dual channel accessing method so that the data to be stored can be divided and then the divided data can be respectively stored into the maim memories in the first channel memory set 120 and the second channel memory set 130 at the same time.
It should be noticed that, in the method for backing-up data in the main memory into the backup memory, the controller 110 can periodically duplicate the data in the main memory into the backup memory. That is, the counter (not shown) to count the time, and when the counting number equals the predetermined cycle time, the controller 110 implements a backup operation to duplicate the data in the main memory to the backup memory so that the data in the main memory can be backup periodically to preserve the security of the data.
The aforementioned data backup method is only an exemplar embodiment and is not used to limit the present invention for only using the aforementioned data backup method to backup the data. The data backup methods well known by the people skilled in the art can be also applied on the embodiment of the present invention.
Alternatively, since the controller 110 can real-time detect whether the reading operation or the programming operation is normally implemented on the flash memories 121, 123, 131 and 133 to real-time control the states of the flash memories 121, 123, 131 and 133, the controller 110, for example, can re-determine the flash memory 123 used to be the backup memory of the flash memory 121 to be the main memory once the flash memory 121 as the main memory is damaged so that the flash memory accessing apparatus 100 can still normally operate.
As shown in
It should be noticed that the controller 310, the first channel memory set 320 and the second channel memory set 330 in the aforementioned embodiment can be configured on a circuit board, such as a mother board. Alternatively, the controller 310 is configured on the circuit board and the first channel memory set 320 and the controller 310 are configured on the same circuit board, wherein the second channel memory set 330 is an open-type NAND flash memory interface set. Further, the controller 310 is configured on the circuit board, and each of the first channel memory set 320 and the second channel memory set 330 is an open-type NAND flash memory interface set, wherein the first channel memory set 320 and the second channel memory set 330 can be, but are not necessary, configured on the circuit board as same as which the controller is configured on.
Moreover, the method for the controller determining each of the flash memories as the main memory or the backup memory according to whether each of the flash memories is normally operated is detailed described in the previous two embodiments about the flash memory accessing apparatuses 100 and 300 and is not further described herein.
According to the above description, the present invention provides a flash memory accessing apparatus and an accessing method of a dual channel memory set. According to whether each of the flash memories in the first channel memory set and the second channel memory set is damaged, the controller of the flash memory accessing apparatus determines each of the flash memories as the main memory or the backup memory. Therefore, the data stored in the main memory can be backup into the backup memory without being lost. Further, when the main memory is damaged, the controller can dynamically switch the backup memory to be the main memory to maintain the normal operation of the flash memory accessing apparatus.
Although the invention has been described with reference to the above embodiments, it will be apparent to one of the ordinary skill in the art that modifications to the described embodiment may be made without departing from the spirit of the invention. Accordingly, the scope of the invention will be defined by the attached claims not by the above detailed descriptions.