FMC and SDRAM example
Following up on my last question about the LTDC interface (That's now working) I'm working through the app note 4861.
Where for the LTDC interface there is a nice walkthrough on how to find the timing values there is nothing like that for the SDRAM selection. bummer.
I have made a board with AS4C4M16SA for the SDRAM, datasheet here: https://www.alliancememory.com/wp-content/uploads/pdf/dram/64M-AS4C4M16SA-CI_v3.0_March%202015.pdf
The timing information is on page 20.
But the app note states that one can either use the CubeMX interface or use the BSP files.
it goes (lightly) over the BSP integration but don't mention the CubeMX at all.
More specifically I am looking for a way to figure out the timing setup from the datasheet:
Those are the value for the SDRAM supplied with the STM32F746G-DISCO board.. is there any pointers on how to adjust these values for a new chip?
Also - since I'm running the TouchGFX integration I have a file called 'HW_Init.cpp' In the top there is a couple of definitions for the mode register.
I have changed this to reflect my new chip:
#define REFRESH_COUNT 1539
#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)
#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0003)
#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0007)
#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200) In the top there is a refresh count - I suspect that this value should also be changed - but to what?
Any help is appreciated!