User`s manual
RX62N Group, RX621 Group 5. Usage Examples
/* Check the status flags */
do{
R_BSC_GetStatus(&status1, &status2, &sdram_status);
} while(sdram_status != 0);
/* Stop Self-Refresh */
do {
rtn = R_BSC_Control(PDL_BSC_SDRAM_SELF_REFRESH_DISABLE);
} while (rtn == false);
/* Check the status flags */
do{
R_BSC_GetStatus(&status1, &status2, &sdram_status);
} while(sdram_status != 0);
/* Enable SDRAM operation */
R_BSC_Control(PDL_BSC_SDRAM_ENABLE);
/**************** Out of Self-Refresh mode ******************/
#endif
/* read SDRAM */
for (i=0; i<(16*1024*1024/4); i+=2)
{
if(*(sdram_location_32+i) != 0xAAAAAAAAu)
{
/* An error has occurred */
while(1);
}
if(*(sdram_location_32+i+1) != 0x55555555u)
{
/* An error has occurred */
while(1);
}
/* Read the status flags */
R_BSC_GetStatus(&status1, &status2, &sdram_status);
R_BSC_Control(PDL_BSC_ERROR_CLEAR);
while(1);
}
}
void BSC_error_handler(void)
{
/* Invert the port pin */
R_IO_PORT_Modify(PDL_IO_PORT_0_3, PDL_IO_PORT_XOR, 1);
/* Clear the error signals */
R_BSC_Control(PDL_BSC_ERROR_CLEAR);
}
void NMI_handler_lpc(void)
{
nop();
}
Figure 5-7: Example of SDRAM Bus Controller use
R20UT0084EE0112 Rev.1.12 Page 5-14
July. 16, 2014