<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックLPC1788: configuring external SDRAM</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-configuring-external-SDRAM/m-p/1515512#M50022</link>
    <description>&lt;P&gt;I'm using SDRAM ISSI IS42S32200L connected to LPC1788. I configured it with the following code in CAS=3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define CLK0_DELAY     7

Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_EMC);

	/* Setup EMC Delays */
	/* Move all clock delays together */
	LPC_SYSCTL-&amp;gt;EMCDLYCTL = (CLK0_DELAY) | (CLK0_DELAY &amp;lt;&amp;lt;  | (CLK0_DELAY &amp;lt;&amp;lt; 16 | (CLK0_DELAY &amp;lt;&amp;lt; 24));

	/* Setup EMC Clock Divider for divide by 2 */
	/* Setup EMC clock for a divider of 2 from CPU clock. Enable EMC clock for
	   external memory setup of DRAM. */
	Chip_Clock_SetEMCClockDiv(SYSCTL_EMC_DIV2);
	Chip_SYSCTL_PeriphReset(SYSCTL_RESET_EMC);

	/* Init EMC Controller -Enable-LE mode- clock ratio 1:1 */
	Chip_EMC_Init(1, 0, 0);

	/* Init EMC Dynamic Controller */
	const IP_EMC_DYN_CONFIG_T IS42S32800D_config = {
		EMC_NANOSECOND(64000000 / 4096),
		0x01,				/* Command Delayed */
		3,					/* tRP */
		7,					/* tRAS */
		EMC_NANOSECOND(70),	/* tSREX */
		EMC_CLOCK(0x01),	/* tAPR */
		EMC_CLOCK(0x05),	/* tDAL */
		EMC_NANOSECOND(12),	/* tWR */
		EMC_NANOSECOND(60),	/* tRC */
		EMC_NANOSECOND(60),	/* tRFC */
		EMC_NANOSECOND(70),	/* tXSR */
		EMC_NANOSECOND(12),	/* tRRD */
		EMC_CLOCK(0x02),	/* tMRD */
		{
			{
				EMC_ADDRESS_DYCS0,	/* EA Board uses DYCS0 for SDRAM */
				3,			//2,	/* RAS */

				/* Mode Register */
				EMC_DYN_MODE_WBMODE_PROGRAMMED |
				EMC_DYN_MODE_OPMODE_STANDARD |
				EMC_DYN_MODE_CAS_3 |			//EMC_DYN_MODE_CAS_2
				EMC_DYN_MODE_BURST_TYPE_SEQUENTIAL |
				EMC_DYN_MODE_BURST_LEN_4,

				/* DynConfig */
				EMC_DYN_CONFIG_DATA_BUS_32 |
				EMC_DYN_CONFIG_LPSDRAM |
				EMC_DYN_CONFIG_2Mx32_4BANKS_11ROWS_8COLS | 		//EMC_DYN_CONFIG_8Mx16_4BANKS_12ROWS_9COLS |
				EMC_DYN_CONFIG_MD_SDRAM
			},
			{0, 0, 0, 0},
			{0, 0, 0, 0},
			{0, 0, 0, 0}
		}
	};
	Chip_EMC_Dynamic_Init((IP_EMC_DYN_CONFIG_T *) &amp;amp;IS42S32800D_config);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it correct?&lt;/P&gt;&lt;P&gt;It seems it is working, but I have some issues with certain boards, so I want to be sure this isn't related to SDRAM configured in a wrong way (maybe above some hardware limits).&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2022 10:23:50 GMT</pubDate>
    <dc:creator>giusloq</dc:creator>
    <dc:date>2022-09-01T10:23:50Z</dc:date>
    <item>
      <title>LPC1788: configuring external SDRAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-configuring-external-SDRAM/m-p/1515512#M50022</link>
      <description>&lt;P&gt;I'm using SDRAM ISSI IS42S32200L connected to LPC1788. I configured it with the following code in CAS=3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define CLK0_DELAY     7

Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_EMC);

	/* Setup EMC Delays */
	/* Move all clock delays together */
	LPC_SYSCTL-&amp;gt;EMCDLYCTL = (CLK0_DELAY) | (CLK0_DELAY &amp;lt;&amp;lt;  | (CLK0_DELAY &amp;lt;&amp;lt; 16 | (CLK0_DELAY &amp;lt;&amp;lt; 24));

	/* Setup EMC Clock Divider for divide by 2 */
	/* Setup EMC clock for a divider of 2 from CPU clock. Enable EMC clock for
	   external memory setup of DRAM. */
	Chip_Clock_SetEMCClockDiv(SYSCTL_EMC_DIV2);
	Chip_SYSCTL_PeriphReset(SYSCTL_RESET_EMC);

	/* Init EMC Controller -Enable-LE mode- clock ratio 1:1 */
	Chip_EMC_Init(1, 0, 0);

	/* Init EMC Dynamic Controller */
	const IP_EMC_DYN_CONFIG_T IS42S32800D_config = {
		EMC_NANOSECOND(64000000 / 4096),
		0x01,				/* Command Delayed */
		3,					/* tRP */
		7,					/* tRAS */
		EMC_NANOSECOND(70),	/* tSREX */
		EMC_CLOCK(0x01),	/* tAPR */
		EMC_CLOCK(0x05),	/* tDAL */
		EMC_NANOSECOND(12),	/* tWR */
		EMC_NANOSECOND(60),	/* tRC */
		EMC_NANOSECOND(60),	/* tRFC */
		EMC_NANOSECOND(70),	/* tXSR */
		EMC_NANOSECOND(12),	/* tRRD */
		EMC_CLOCK(0x02),	/* tMRD */
		{
			{
				EMC_ADDRESS_DYCS0,	/* EA Board uses DYCS0 for SDRAM */
				3,			//2,	/* RAS */

				/* Mode Register */
				EMC_DYN_MODE_WBMODE_PROGRAMMED |
				EMC_DYN_MODE_OPMODE_STANDARD |
				EMC_DYN_MODE_CAS_3 |			//EMC_DYN_MODE_CAS_2
				EMC_DYN_MODE_BURST_TYPE_SEQUENTIAL |
				EMC_DYN_MODE_BURST_LEN_4,

				/* DynConfig */
				EMC_DYN_CONFIG_DATA_BUS_32 |
				EMC_DYN_CONFIG_LPSDRAM |
				EMC_DYN_CONFIG_2Mx32_4BANKS_11ROWS_8COLS | 		//EMC_DYN_CONFIG_8Mx16_4BANKS_12ROWS_9COLS |
				EMC_DYN_CONFIG_MD_SDRAM
			},
			{0, 0, 0, 0},
			{0, 0, 0, 0},
			{0, 0, 0, 0}
		}
	};
	Chip_EMC_Dynamic_Init((IP_EMC_DYN_CONFIG_T *) &amp;amp;IS42S32800D_config);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it correct?&lt;/P&gt;&lt;P&gt;It seems it is working, but I have some issues with certain boards, so I want to be sure this isn't related to SDRAM configured in a wrong way (maybe above some hardware limits).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 10:23:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-configuring-external-SDRAM/m-p/1515512#M50022</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-09-01T10:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788: configuring external SDRAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-configuring-external-SDRAM/m-p/1516883#M50061</link>
      <description>&lt;P&gt;Hi, Giuseppe,&lt;/P&gt;
&lt;P&gt;I think the so-called CAS=3 means Programmable CAS latency, it is programmed into the MODE REGISTER of SDRAM. The parameter is defined in the&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;MC_DYN_MODE_CAS_3&lt;/LI-CODE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;MC_DYN_MODE_CAS_2&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 08:33:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-configuring-external-SDRAM/m-p/1516883#M50061</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-09-05T08:33:58Z</dc:date>
    </item>
  </channel>
</rss>

