User`s manual
RX62N Group, RX621 Group 5. Usage Examples
0x0FFFu, // RFC = 4096 cycles
0x00u, // REFW = 1 cycle
0x00u, // ARFI = 3 cycles
0x02u, // ARFC = 2 times
0x00u, // PRC = 3 cycles
0x02u, // CL = 2 cycles
0x01u, // WR = 2 cycles
0x00u, // RP = 1 cycle
0x00u, // RCD = 1 cycle
0x00u, // RAS = 1 cycle
0x0220u // SDMOD = 0x220u
);
/* Perform SDRAM initialization */
R_BSC_Control(PDL_BSC_SDRAM_INITIALIZATION);
/* Start Auto-Refresh */
R_BSC_Control(PDL_BSC_SDRAM_AUTO_REFRESH_ENABLE);
/* Enable SDRAM operation */
R_BSC_Control(PDL_BSC_SDRAM_ENABLE);
/* write SDRAM */
for (i = 0; i < (16 * 1024 * 1024 / 4); i += 2)
{
*(sdram_location_32 + i) = 0xAAAAAAAAu;
*(sdram_location_32 + i + 1) = 0x55555555u;
}
#if SELF_REFRESH_SELECT
/**************** Entering Self-Refresh *********************/
/* Disable SDRAM operation */
R_BSC_Control(PDL_BSC_SDRAM_DISABLE);
/* Check the status flags */
do{
R_BSC_GetStatus(&status1, &status2, &sdram_status);
} while(sdram_status != 0);
/* Start Self-Refresh */
R_BSC_Control(PDL_BSC_SDRAM_SELF_REFRESH_ENABLE);
/**************** In Self-Refresh mode **********************/
#endif
/*********** Entering Deep Software-Standby mode ************/
/* Find out what caused the exit from deep software standby */
R_LPC_GetStatus(
&status_flags
);
/* Configure the NMI pin P35, ensure NMIER.BIT.NMIEN = 1*/
R_INTC_CreateExtInterrupt(
PDL_INTC_NMI,
PDL_INTC_FALLING,
NMI_handler_lpc,
7
);
/* Allow a falling edge on NMI to cancel deep software standby */
/* to ensure uninitialized data (e.g. B section) are retained */
/* SBYCR.OPE = 1, DPSBYCR.IOKEEP = 1 */
R_LPC_Create(\
PDL_LPC_CANCEL_NMI_FALLING | \
PDL_LPC_RAM_USB_DETECT_ON | PDL_LPC_EXT_BUS_ON | \
PDL_LPC_IO_DELAY,
PDL_LPC_STANDBY_64 | PDL_LPC_DEEP_STANDBY_1024
);
R20UT0084EE0112 Rev.1.12 Page 5-12
July. 16, 2014