Patent Publication Number: US-5897659-A

Title: Modifying RAS timing based on wait states to accommodate different speed grade DRAMs

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application relates to co-pending application Ser. No. 08/813,729 (pending) (Attorney Reference No: M-4800 US), entitled &#34;INTEGRATING A DRAM CONTROLLER ONTO A MICROCONTROLLER&#34;, by Gittinger et al., filed the same day as the present application and which is incorporated herein by reference. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to accessing dynamic random access memories (DRAMS) and more particularly to modifying a row address strobe (RAS) for DRAMs based on the existence of waits states. 
     2. Description of the Related Art 
     DRAMs require a minimum amount of time (RAS precharge time) between active row address strobes. Referring to FIG. 1, that minimum time period 110 occurs where RAS is inactive (high). The time period is required because once RAS transitions to inactive, it must remain inactive for the minimum time shown at 110 to precharge the internal circuitry in the DRAM for the next active cycle. The RAS high time or precharge time varies according to the access speed of the DRAM. For example, a DRAM with 50 nanosecond access time can have a 30 ns RAS precharge time. A 60 ns DRAM can have a 35 ns precharge time and a DRAM with 70 ns access times can have a precharge time of 40 ns. Note that the use of the term &#34;RAS&#34; rather than &#34;RAS&#34; is for convenience and is not intended to suggest the active state of the signal. 
     When DRAM controllers control DRAMs with different access speeds, the DRAM controller must account for the different DRAM timing requirements. One such timing requirement, besides the RAS precharge requirement is the RAS pulse width shown in FIG. 1 as time period 120. In order to account for slower DRAMs, it is known to insert wait states in the DRAM access cycle so that the RAS and CAS strobes are extended. However, inserting wait states to extend the RAS active strobe does not solve the problem of having different RAS precharge (inactive or high time) requirements for DRAMs with different access speeds. 
     SUMMARY OF THE INVENTION 
     It has been discovered to provide a DRAM controller that modifies the RAS strobe by deasserting RAS earlier relative to the end of a DRAM access cycle when wait states are inserted in a DRAM bus cycle. The earlier deassertion of the row address strobe when wait states are inserted in the DRAM bus cycle relative to the end of the DRAM access cycle provides for a longer DRAM RAS precharge time (or high time) needed by slower DRAMs. 
     In one embodiment, the length of time that RAS is asserted is shortened by half a clock cycle relative to the end of the DRAM access cycle (T cycle) in order to increase the high time of RAS between deassertion and a subsequent assertion of RAS. That allows slower DRAMs with longer RAS high time requirements to be controlled by the same circuit that supports faster DRAMs. One benefit of modifying RAS as disclosed herein is that software does not have to configure the DRAM controller for RAS deassertion time. Also, there is no need to add an extra register to store the configuration for memory speed, thus making the DRAM controller smaller, easier to build and easier to program. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The present invention may be better understood, and its numerous objects, features, and advantages made apparent to those skilled in the art by referencing the accompanying drawings wherein the use of the same reference symbol in different drawings indicates similar or identical items. 
     FIG. 1 is a timing diagram illustrating the RAS high time requirements. 
     FIG. 2 is a timing diagram illustrating the RAS high time provided when no wait states are inserted according to one embodiment of the present invention. 
     FIG. 3 shows the insertion of two wait states to extend the RAS cycle and the earlier deassertion of RAS to lengthen RAS high time. 
     FIG. 4 shows the insertion of n wait states. 
     FIG. 5a shows a first part of a circuit used to control the deassertion of RAS based on the existence of wait states. 
     FIG. 5b shows a second part of the circuit of FIG. 5a used to control the deassertion of RAS based on the existence of wait states. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT(S) 
     Referring to FIG. 2, a timing diagram illustrates the operation of a DRAM controller according to one embodiment of the present invention. FIG. 2 illustrates the operation of the DRAM controller when no wait states are inserted in the bus cycle. The timing diagram shows two clocks PH1 and PH2, which are nonoverlapping clocks of opposite phase. In the embodiment shown, each DRAM access cycle is divided into T cycles (T1-T4). The beginning of the DRAM access cycle is marked by the beginning of T1 and the end of the access cycle is defined by the end of T4. The particular T cycle that is occurring is provided on a four bit bus, with one bit indicating one T cycle. Thus, as shown in FIGS. 2, 3 and 4, T1 is indicated by a 1 on the four bits T1-T4, T2 by a 2, T3 by a 4 and T4 by an 8. RAS, is asserted during the T1 cycle on the rising edge of the PH1 clock. RAS lasts for two and a half T clock cycles (T1, T2 and half of T3) and is deasserted during the second half of T3 on the rising edge of the PH2 clock. RAS can be asserted again for the next access during the following T1 cycle. That provides for a RAS deassertion time of approximately 37.5 ns when the T clock period is 25 ns (40 MHz clock). That may be sufficient for a DRAM with, e.g., a 50 ns access time. However, when DRAMs with 60 or 70 ns are utilized, that deassertion time may not be sufficient. Accordingly, the deassertion time must be extended to meet the RAS high time requirements of the slower DRAMs. It is possible to wait extra T cycles when slower DRAMs are used but that would have the disadvantage of slowing down DRAM access and/or result in unique control logic for each speed grade DRAM supported along with a requirement to programmmably select which control logic to utilize according to the speed of the DRAM. 
     FIG. 3 illustrates an approach to support the longer RAS precharge time requirements of slower DRAMs that has less hardware and speed impact that the alternatives just mentioned. When slower DRAMs are utilized, the RAS active pulse width is also typically longer compared to the faster DRAMs. The longer pulse width requirement can be solved by adding wait states into the bus cycle. For example, FIG. 3 shows two wait states, TW1 and TW2, inserted in the bus cycle at 301. Wait states can be programmed into the DRAM controller by writing a value into a programmable register. The number of wait states corresponding to that value will be inserted into all DRAM access cycles at the end of T2, until the register is written with a different value. For example, in a DRAM controller incorporated into a &#39;186 compatible microcontroller, two bits R1 and R0, can be provided in a programmable register (e.g., the upper memory chip select register) to determine the number of wait states to insert. For details on programming wait states for a DRAM controller incorporated in a &#39;186 based microcontroller, see &#34;INTEGRATING A DRAM CONTROLLER ONTO A MICROCONTROLLER&#34;, mentioned previously. 
     Because slower DRAMs, e.g., 60 nanosecond (ns) and 70 ns DRAMs, require more RAS high time for precharge between cycles than faster DRAMs, when wait states are inserted, as shown in FIGS. 3 and 4, the RAS signal is brought high in the first half of the T3 clock cycle. This occurs on the rising edge of PH1 at 303 rather than in the second half of the T3 cycle on the rising edge of PH2 as is done when there are no wait states. The deassertion of RAS earlier in the T3 cycle provides additional inactive time for RAS between cycles for the slower DRAMs. For certain DRAMs that additional time of half a T cycle (e.g. approximately 12.5 ns in one embodiment) is sufficient to provide the necessary precharge time for RAS so that the timing for the subsequent assertion of RAS in the next T1 cycle is the same for different speed grade DRAMs. 
     FIG. 4 shows another timing diagram with n wait states inserted. Other signals (UCS, LCS, RAS0, RAS1, and CASH, CASL) that are used in an embodiment in which a DRAM controller is integrated into a &#39;186 microcontroller are also shown. 
     Referring to FIGS. 5a and 5b, a circuit to modify RAS timing when wait states are inserted in DRAM access cycle is shown. In one embodiment of the invention, when wait states are active, T3 is kept asserted on the T1-T4 signal lines. In other words, wait states extend the number of T3 cycles. A wait state circuit 561 may include a programmable register. The wait state circuit 561 extends the number of T3 cycles by the number of wait states in the programmable register when a valid DRAM access requiring wait states occurs and provides a signal 560 indicating the existence of wait states. 
     The RAS is generated by the circuit in FIGS. 5a and 5b in accordance with the timing diagrams of FIGS. 2, 3 and 4. Gate 501 causes transistor 506 to switch on during PH1 of T1 when refresh is not active and lower memory chip select (LCS) is asserted. Lower memory chip select (LCS) is a signal in a &#39;186 microcontroller that is asserted when an address within a programmable memory block is being accessed. In another embodiment of the invention, the LCS signal may instead be a signal indicating that a DRAM access is taking place. Gate 505 is used to assert RAS when refresh is active. When no wait states are present in the DRAM access bus cycle, gate 509 will go high on the rising edge of PH2 of T3 causing transistor 504 to switch on, thus deasserting RAS, as shown in FIG. 2. The T1-T4 signals 551, are respectively latched in latches 553, 555, 557 and 559. 
     However, when wait states are active, then T3 will be blocked by gate 552 whose output is low when WAIT STATE is asserted. The WAIT STATE signal shown in FIG. 3 is available on the rising edge of PH2, which is one half T cycle before the T cycle actually begins a wait state. That ensures that the signal indicating the next wait state is available and stable on the rising edge of PH1. The WAIT STATE signal is only valid during T3 cycles when a value of 4 is on the T1-T4 bits as shown in FIG. 3. When there are no wait states as shown in FIG. 2, WAIT STATE is inactive (high) during PH2 of T2 and PH1 of T3. Referring to FIG. 3, WAIT STATE is valid and active (low) from the rising edge of PH2 in T2 until the rising edge of PH2 in the last wait state (ere TW2). At the rising edge of PH2 in TW2, WAIT STATE goes inactive and remains that way until the rising edge of PH2 in T3 at which point the signal is not valid for the purposes of the circuit shown in FIGS. 5a and 5b. When WAIT STATE is deasserted on the rising edge of PH2, in the last wait state cycle as shown in FIGS. 3 and 4, the &#34;last T3&#34; signal goes active indicating that the next T cycle is the last T3. WAIT STATE from latch 570 is still high because it was latched during T2. Thus gate 507 becomes high on the rising edge of PH1 during T3, causing RAS to be deasserted at that time as shown in FIG. 4. Remember that wait states may be programmably set in one or more registers. When no wait states are inserted, WAIT STATE rises on PH2 of T2 to indicate an inactive state and deasserts on PH2 of T3. 
     With a circuit such as the one described in FIGS. 5a and 5b, the insertion of wait states during a DRAM access cycle, causes the logic controlling deassertion of RAS to deassert RAS earlier relative to the end of the T4 cycle. In the particular embodiment shown, the deassertion was a half a T cycle earlier. In other embodiments, the time of the earlier deassertion will depend upon the clocks used in the DRAM controller and the requirements of the slower DRAM. Thus, for instance, in other embodiments, RAS may be deasserted, e.g., a whole cycle earlier or a quarter cycle earlier, than the end of the DRAM access cycle, as long as other timing requirements of the DRAMs are met. 
     The description of the invention set forth herein is illustrative, and is not intended to limit the scope of the invention as set forth in the following claims. For instance the invention may be utilized in a microcontroller on which a DRAM controller is integrated or may be used on any DRAM controller. Variations and modifications of the embodiments disclosed herein, may be made based on the description set forth herein, without departing from the scope and spirit of the invention as set forth in the following claims.