II BUS MODULES: SDRAM CONTROLLER (SDRAMC)
II-4-10
EPSON
S1C33E07 TECHNICAL MANUAL
II.4.1.5 Control and Operation of SDRAM Interface
Initializing SDRAM
To use SDRAM, it must be initialized by following the procedure below after switching power on.
1. Setting SDRAM interface pins
Switch over the pins shared with general-purpose input/output ports or other peripheral functions for
SDRAM use by setting the relevant Port Function Select Register. For details of pin functions and how to
switch over, see Section I.3.3, “Switching Over the Multiplexed Pin Functions.”
2. Initializing the SDRAMC registers
Set up the SDRAMC registers in the following order:
(1) SDRAM Configuration Register (0x301604)
Set SDRAM size/address-related parameters and access timing parameters.
(2) SDRAM Refresh Register (0x301608)
Set the auto-refresh and self-refresh counters.
(3) SDRAM Initial Register (0x301600)
Set SDON (D4) to 1 (SDRAMC enabled).
(4) SDRAM Application Configuration Register (0x301610)
Set CAS latency and enable the SDAPP and arbiter. Also enable double frequency mode and instruction
queue buffer if necessary.
3. Wait after SDRAM power-on
After the power to SDRAM is turned on, the NOP state (#SDCS = 1) must be maintained for a certain time
(e.g., 100 s, 200 s or more). Because this time varies with each SDRAM, refer to the specifications of the
SDRAM being used.
4. Executing an SDRAM initial sequence
In order to initialize the SDRAM, the PALL (Precharge All), REF (Auto Refresh), and MRS (Mode
Register Set) commands must be executed sequentially. Note that the initialization sequence depends on the
SDRAM.
Example 1: PALL
→ REF → REF → MRS (→ EMRS)
Example 2: PALL
→ MRS → REF → REF (→ REF → REF → REF → REF → REF → REF)
Refer to the specifications of the SDRAM to be used for the initialization sequence.
Each command can be executed using the control bit shown below.
To execute the PALL (Precharge All) command:
Write 0x12 to the SDRAM Initial Register (0x301600); INIPRE (D1/0x301600) should be set to 1.
Then write any data to any address in the SDRAM. This dummy write is required as the trigger to send
the PALL command.
INIPRE: PALL Command Enable for Initialization Bit in the SDRAM Initial Register (D1/0x301600)
To execute the REF (Auto Refresh) command:
Write 0x11 to the SDRAM Initial Register (0x301600); INIREF (D0/0x301600) should be set to 1.
Then write any data to any address in the SDRAM. This dummy write is required as the trigger to send
the REF command.
INIREF: REF Command Enable for Initialization Bit in the SDRAM Initial Register (D0/0x301600)
When executing the REF command twice or more, insert the nop instruction between the executions.
Execute REF command
→ Execute nop → Execute REF command (→ REF → nop → REF . . .)
The SDRAM timing parameters set in the SDRAM Configuration Register (0x301604) is not effective
in this manual initialization sequence. Therefore, enough number of nop instructions must be executed
to satisfy the SDRAM timings.