![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_230.png)
IDT DDR Controller
Example of DDR SDRAM Initialization
79RC32438 User Reference Manual
7 - 26
November 4, 2002
Notes
f). CAS Latency
: 2 - 2.5
g). Page Size
: 9 bits
h). Write Recovery time tWR
: 15 nsec ( 3 clock cycles @ 133 MHZ )
i). Auto refresh command period tRFC
: 75 ns ( 10 clock cycles @ 133 MHZ )
j). Precharge Delay tRP
: 20 nsec ( 3 clock cycles @ 133 MHZ )
k). Active to Read or Write delay tRCD
: 20 nsec ( 3 clock cycles @ 133 MHZ)
l). Active to Active/Auto Refresh period tRC
: 65 nsec ( 9 clock cycles @133 MHZ)
m). Active to Precharge tRAS
: 40 nsec ( 6 clock cycles @ 133 MHZ )
DDR Control Register Settings: Assuming DDR controller clock frequency is 133 MHz
DDRC.ATA [ 7-5] : 100b ( 9 clock cycles )
DDRC.DBW[8] : 1 ( 32 bits )
DDRC.WR[10-9] : 00b ( 3 clock cycles )
DDRC.DTYPE[15-11] : 01001b ( 256Mb, 4Mx16x4 DDR )
DDRC.RFC[19-16] : 1010b ( 10 clock cycles )
DDRC.RP[21-20] : 10b ( 3 clock cycles )
DDRC.AP[22] : 0 NOTE-1
DDRC.RCD[24-23] : 10b ( 3 clock cycles )
DDRC.CL[26-25] : 01b ( 2.5 clock cycles )
DDRC.DBM[27] : 0 ( No data bus multiplexing )
DDRC.SDS[28] : 0
DDRC.ATP[30:29] : 01b ( 6 clock cycles )
DDRC.RE[31] : 1 ( refresh enabled after initialization )
NOTE-1: To facilitate the logic analyzer debug, it is recommended to enable the Auto Precharge. If auto
precharge is enabled, the row being accessed is precharged at the completion of a read or write transac-
tion.This would force Row and Column address on the bus for every read and write.
Please note that AP may need to be set if both the Chip selects are being used. This may be required to
preclude a scenario where accesses to the same row of the DDR bank is made for the two chip selects
concurrently.
Prior to the completing the initialization of the DDR SDRAM, the program disables the refresh enable in
the DDR controller. After completion of the initialization, the refresh enable bit is set during the normal oper-
ation of the DDR SDRAM.
#define DDRC_VAL_AT_INIT 0x232A4980
#define DDRC_VAL_NORMAL 0xA32A4980
/* For 64MB DDR the address range for CS0 is 0x0000 0000 - 0x03FF FFFF. The Mask register for CS0
uses upper 6 bits: FC00_0000 for address comparison */
#define DDR0_BASE_VAL 0x00000000
#define DDR0_MASK_VAL 0xFC000000