Not applicable.
1. Field of the Invention
The present invention relates to a digital television, a memory controller, and a method for controlling access of a memory device; more specifically, relates to a digital television, a memory controller and a method for maintaining an appropriate delay during data access.
2. Descriptions of the Related Art
Double data rate (DDR) memories are used frequently nowadays because data in a DDR memory can be accessed at both rising edges and falling edges. In addition to DDR memories, some electrical devices are also required to control data access. A conventional memory control system 1 is shown as
The memory controller 13 further comprises wires and buffers 1305, 1307, 1309, a delay element 1311, a latch 1313, a delay loop lock (DLL) 1315, and a command unit 1317. The data DQ is transmitted through the pad 111, the PCB trace 15, the pad 1301, the wires and buffers 1305 and becomes a data DQX before it reaches the latch 1313. Compared to the data DQ, the data DQX has a delay. The clock DQS is transmitted through the pad 113, the PCB trace 17, the pad 1303, the wires and buffers 1307, the delay element 1311, the wires and buffers 1309 and becomes a clock DQSX before it reaches the latch 1313. Compared to the clock DQS, the clock DQSX has a delay as well.
The timing diagram of the data DQ, DQX, and the clocks DQS, DQSX is shown in
The mark X in
According to the above descriptions, (X-Y) must be equal to ¼ clock cycle to get enough setup time and hold time. In order to accomplish this goal, at least the following requirements should be met. First, the I/O delays of the pad 111 and the pad 113 are well balanced. Second, the delays of the PCB trace 15 and the PCB trace 17 are well balanced. Third, the delays of the pad 1301 and the pad 1303 are well balanced. Fourth, the delays of the wires and buffers inside the memory controller 13 without considering the delay element 1311 are well balanced. Finally, the delay element 1311 provides exact ¼ clock delay.
Even if these requirements are perfectly tuned during simulation, it is still hard to make (X-Y) to be exact ¼ clock cycle physically because there are many manufacturing and operating environment factors unable to be pre-considered. Once the delay deviates, the data access would be erroneous. Therefore, a solution to maintaining an appropriate delay during data access is desired in the industrial field.
One object of this invention is to provide a memory controller for controlling access of a memory device. The memory controller comprises a storage buffer and a clock adjustment device. The storage buffer is configured to buffer a data read from the memory device according to a reference clock source. The clock adjustment device is configured to provide the reference clock source and determine whether to adjust the reference clock source in response to the data.
Another object of this invention is to provide a method for controlling access of a memory device. The method comprises the following steps: providing a reference clock source; buffering a data read from the memory device according to the reference clock source; and determining whether to adjust the reference clock source in response to the data.
Another object of this invention is to provide a digital television. The digital television comprises a memory device and a memory controller. The memory device is configured to store a data. The memory controller is configured to provide a reference clock source, buffering the data read from the memory device according to the reference clock source, and determines whether to adjust the reference clock source in response to the buffered data.
The present invention is capable of dynamically adjusting the reference clock source by monitoring the data outputted from the storage buffer of the memory controller. Therefore, an appropriate delay during data access can be maintained.
The detailed technology and preferred embodiments implemented for the subject invention are described in the following paragraphs accompanying the appended drawings for people skilled in this field to well appreciate the features of the claimed invention.
In this specification, the term “according to” is defined as “replying to” or “reacting to.” For example, “according to a signal” means “replying to a signal” or “reacting to a signal” without necessity of direct signal reception. The term “in response to” has a definition similar to that of the term “according to.”
A first embodiment of the present invention is a digital television 3 as illustrated in
The memory device 31 comprises pads 311, 313. The memory controller 33 comprises pads 3301, 3303, wires and buffers 3305, 3307, 3309, a delay element 3311, a latch 3313, a clock adjustment device 333, and a command unit 3315. The pads 311, 313, 3301, 3303, the wires and buffers 3305, 3307, 3309, and the delay element 3311 are similar to the corresponding component shown in
A delay for the clock DQS is variable depending on system requirements, e.g., ½ clock cycle, ¼ clock cycle, or ⅛ clock cycle. In the first embodiment, a delay of ¼ clock cycle is used simply for an exemplification and should not be treated as a limitation of the present invention.
The data DQ is transmitted through the pad 311, the PCB trace 35, the pad 3301, the wires and buffers 3305 and becomes a data DQX before it reaches the latch 3313. The clock DQS is transmitted through the pad 313, the PCB trace 37, the pad 3303, the wires and buffers 3307, the delay element 3311, the wires and buffers 3309 and becomes a clock DQSX before it reaches the latch 3313. Please note that the data DQ, DQX are identical except the time delay. Generally speaking, the data DQ and the clock DQS are simultaneously transmitted from the memory device 31 once the memory device 31 receives a READ command. The latch 3313, a storage buffer, receives the data DQX according to the reference clock source 3330. That is, the latch 3313 holds the data DQX until the clock DQSX reaches the latch 3313. The delay time of the clock DQSX is determined by the delay element 3311 which operates in response to the reference clock source 3330. The reference clock source 3330 is to control the delay element 3311 to provide a delay of ¼ clock cycle on the clock DQS. Rather than providing a fixed clock source, the clock adjustment device 333 is capable of determining whether to adjust the reference clock source 3330 in response to a data 3300 which is the data DQX sent from the latch 3313 after the latch 3313 is triggered by the clock DQSX.
The clock adjustment device 333 comprises a DLL unit 3331, an offset unit 3333, a calibrator 3335, a multiplexer 3337, and an adder 3339. The DLL unit 3331 generates a core delay clock 3334, i.e. ¼ clock cycle, according to an internal clock REFCK, wherein the internal clock REFCK is generated by the digital television 3. The processing unit 39 receives and analyzes the data 3300 to generate a signal 30 after the analysis. In particular, the processing unit 39 analyzes the data 3300 to determine whether the delay is acceptable. If not, the signal 30 will carry information of the adjustment range required. The offset unit 3333, such as a register, generates an offset value 3336 in response to the signal 30. The offset value 3336 is used to be added to the core delay clock 3334 to adjust the delay. Furthermore, the calibrator 3335 directly receives the data 3300 and generates a calibration value 3338 in response to the data 3300. The calibration value 3338 also can be added to the core delay clock 3334 to adjust the delay. The multiplexer 3337 selects one of the offset value 3336 and the calibration value 3338 in response to a selection command 32 generated from the processing unit 39. The selection is determined based on several conditions, such as the functionality or the amounts of power consumption of the offset unit 3333 and the calibrator 3335. The core delay clock 3334 and the selection 3340 are added by the adder 3339 to form the reference clock source 3330 that is then provided to the delay element 3311. The above-mentioned adjustment mechanism may operate during initiation or all the time as long as the data 3300 keeps coming out. In response to the adjusted reference clock source 3330, the delay of the clock DQSX will be optimized. Please note that the offset unit 3333 and the calibrator 3335 do not have to be embedded at the same time. The existence of either one may achieve the delay adjustment.
The block diagram of the calibrator 3335 is shown in
The control unit 405 sets another initial value as a maximum value 404, and continues adding the calibration value 3338 by 1. The control unit 405 determines whether the delay is still acceptable according to the difference. If yes, the calibration value 3338 continues being added by 1 until the delay becomes unacceptable. If the delay becomes unacceptable, that means the biggest calibration value 3338 is derived and the biggest calibration value 3338 is stored to the first register 407, to update the maximum value 404. The maximum value is derived thereby. Afterwards, the calculator 411 averages the maximum value 404 and the minimum value 406 as the calibration value 3338. The reference clock source 3330 is adjusted in response to the calibration value 3338.
If there is no data stored in the memory device 31 and the digital television 3 asks to test the delay, the calibrator 3335 transmits a signal 36 to the command unit 3315. The command unit 3315 transmits a test data 34 to the memory device 31 through the pad 3301, the PCB trace 35, and the pad 311 in response to the signal 34. Then the command unit 3315 issues a read command to the memory device 31 via the leading wire 38. The memory device 31 sends the test data 34 to the memory controller 33 in response to the read command. The aforementioned delay adjustment can be executed thereby.
A second embodiment of the present invention is a method for controlling access of a memory device as illustrated in
Step 517 further comprises the steps shown in
In addition to the steps shown in
Accordingly, the present invention is capable of dynamically adjusting the reference clock source by monitoring the data outputted from the storage buffer of the memory controller. Therefore, the delay during data access can be maintained.
The above disclosure is related to the detailed technical contents and inventive features thereof. People skilled in this field may proceed with a variety of modifications and replacements based on the disclosures and suggestions of the invention as described without departing from the characteristics thereof. Nevertheless, although such modifications and replacements are not fully disclosed in the above descriptions, they have substantially been covered in the following claims as appended.