36.4.1 Low-power DDR1-SDRAM Initialization
The initialization sequence is generated by software.
The low-power DDR1-SDRAM devices are initialized by the following sequence:
- Program the memory device type in the Memory Device register (MPDDRC_MD).
- Program the shift sampling value in the Read Data Path register (MPDDRC_RD_DATA_PATH).
- Program MPDDRC_IO_CALIBR.
- Program the features of the low-power DDR1-SDRAM device in the MPDDRC Configuration register (MPDDRC_CR) (number of columns, rows, banks, CAS latency and output drive strength) and in the Timing Parameter 0 register/Timing Parameter 1 register (MPDDRC_TPR0/1) (asynchronous timing (TRC, TRAS, etc.)).
- Program Temperature Compensated Self-refresh (TCR), Partial Array Self-Refresh (PASR) and Drive Strength (DS) parameters in the Low-power register (MPDDRC_LPR).
- A NOP command is issued to the low-power DDR1-SDRAM. Program the NOP command in the Mode register (MPDDRC_MR). The application must configure the MODE field to 1 in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access to any low-power DDR1-SDRAM address to acknowledge this command. The clocks which drive the low-power DDR1-SDRAM device are now enabled.
- A pause of at least 200 μs must be observed before a signal toggle.
- A NOP command is issued to the low-power DDR1-SDRAM. Program the NOP command in the MPDDRC_MR. The application must configure the MODE field to 1 in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access to any low-power DDR1-SDRAM address to acknowledge this command. A calibration request is now made to the I/O pad.
- An All Banks Precharge command is issued to the low-power DDR1-SDRAM. Program All Banks Precharge command in the MPDDRC_MR. The application must configure the MODE field to 2 in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access to any low-power DDR1-SDRAM address to acknowledge this command.
- Two auto-refresh (CBR) cycles are provided. Program the Auto-refresh command (CBR) in the MPDDRC_MR. The application must configure the MODE field to 4 in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access to any low-power DDR1-SDRAM location twice to acknowledge these commands.
- An Extended Mode Register Set (EMRS) cycle is issued to program the
low-power DDR1-SDRAM parameters (TCSR, PASR, DS). The application must configure the
MODE field to 5 in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler
instruction just after the read. Perform a write access to the SDRAM to acknowledge this
command. The write address must be chosen so that signal BA[1] is set to 1 and BA[0] is
set to 0. For example: with a 16-bit, 128-Mbit, low-power
DDR1-SDRAM (12 rows, 9 columns, 4 banks), the SDRAM write access should be done at
the address: BASE_ADDRESS_DDR + 0x00800000; with a 32-bit, 1-Gbit, low-power DDR1-SDRAM (14
rows, 10 columns, 4 banks), the SDRAM write access should be done at the address:
BASE_ADDRESS_DDR + 0x08000000. In the case of low-cost and
low-density low-power DDR1-SDRAM (2 internal banks), the write address must be chosen
so that signal BA[0] is set to 1. BA[1] is not used.Note: This address is given as an example only. The real address depends on implementation in the product.
- A Mode Register Set (MRS) cycle is issued to program parameters of the low-power DDR1-SDRAM devices, in particular CAS latency. The application must configure the MODE field to 3 in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access to the low-power DDR1-SDRAM to acknowledge this command. The write address must be chosen so that signals BA[1:0] are set to 0. For example, the SDRAM write access should be done at the address: BASE_ADDRESS_DDR.
- The application must enter Normal mode, write a zero to the MODE field in the MPDDRC_MR. Read the MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access at any location in the low-power DDR1-SDRAM to acknowledge this command.
- Write the refresh rate into the COUNT field in the Refresh Timer register (MPDDRC_RTR). To compute the value, see MPDDRC Refresh Timer Register.
After initialization, the low-power DDR1-SDRAM device is fully functional.