2015-05-10 01:47 PM
2015-10-22 01:55 AM
2015-10-22 03:16 AM
Incorrect refresh rate? I don't use FMC with DRAMs but I'd be surprised if 16MHz clock would be enough.
JW2015-10-25 06:22 AM
I have mentioned the SDRAM init code below.
void SDRAM_Init(void){ FMC_SDRAMInitTypeDef FMC_SDRAMInitStructure; FMC_SDRAMTimingInitTypeDef FMC_SDRAMTimingInitStructure; /* Enable FMC clock */ //rccEnableAHB3(RCC_AHB3ENR_FMCEN, FALSE); RCC_AHB3PeriphClockCmd(RCC_AHB3ENR_FMCEN, ENABLE); /* FMC Configuration ---------------------------------------------------------*/ /* FMC SDRAM Bank configuration */ /* TMRD: 2 Clock cycles */ FMC_SDRAMTimingInitStructure.FMC_LoadToActiveDelay =2; /* TXSR: min=70ns 2x62ns (was 6x11.90ns) */ FMC_SDRAMTimingInitStructure.FMC_ExitSelfRefreshDelay =1; /* TRAS: min=42ns 1x62ns (was 4x11.90ns) max=120k (ns) */ FMC_SDRAMTimingInitStructure.FMC_SelfRefreshTime =1; /* TRC: min=63 2x62ns (was 6x11.90ns) */ FMC_SDRAMTimingInitStructure.FMC_RowCycleDelay =1; /* TWR: 2 Clock cycles */ FMC_SDRAMTimingInitStructure.FMC_WriteRecoveryTime =2; /* TRP: 15ns => 1x62ns ( was 2x11.90ns ) */ FMC_SDRAMTimingInitStructure.FMC_RPDelay =1; /* TRCD: 15ns => 1x62ns (was 2x11.90ns) */ FMC_SDRAMTimingInitStructure.FMC_RCDDelay =1; /* FMC SDRAM control configuration */ FMC_SDRAMInitStructure.FMC_Bank = FMC_Bank2_SDRAM; /* Row addressing: [8..0] (was [7:0]) */ FMC_SDRAMInitStructure.FMC_ColumnBitsNumber = FMC_ColumnBits_Number_9b; /* Column addressing: [12..0] (was [11:0]) */ FMC_SDRAMInitStructure.FMC_RowBitsNumber = FMC_RowBits_Number_13b; FMC_SDRAMInitStructure.FMC_SDMemoryDataWidth = FMC_SDMemory_Width_16b; FMC_SDRAMInitStructure.FMC_InternalBankNumber = FMC_InternalBank_Number_4; FMC_SDRAMInitStructure.FMC_CASLatency = FMC_CAS_Latency_2; FMC_SDRAMInitStructure.FMC_WriteProtection = FMC_Write_Protection_Disable; FMC_SDRAMInitStructure.FMC_SDClockPeriod = FMC_SDClock_Period_2; FMC_SDRAMInitStructure.FMC_ReadBurst = FMC_Read_Burst_Enable; FMC_SDRAMInitStructure.FMC_ReadPipeDelay = FMC_ReadPipe_Delay_1; FMC_SDRAMInitStructure.FMC_SDRAMTimingStruct = &FMC_SDRAMTimingInitStructure; /* FMC SDRAM bank initialization */ FMC_SDRAMInit(&FMC_SDRAMInitStructure); /* FMC SDRAM device initialization sequence */ SDRAM_InitSequence(); }I have stored the data in address 0xD03AED64 is 0xD03AEE2C. I could read correctly when I tried continously. However, when I tried to read the data after some time I am getting the value 0x903AED64. My SDRAM is Micron MT48LC16M16A2. It works fine even in 8 Mhz frequency.Thanks,Gigo2015-10-25 10:33 AM
> My SDRAM is Micron MT48LC16M16A2.
So what is its refresh period, and what is your refresh setting? JW2015-10-26 12:29 AM
2015-10-26 03:23 AM
I suggest you to read thoroughly the SDRAM sub-chapter of the FMC chapter in RM and the memory's datasheet, concentrating on the refresh issues.
JW