<?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のトピックRe: SDRAM self refresh</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785742#M31567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both examples mentioned before use the EMC interface, is a good starting point to understand how the External Memory Controller works. What I forgot to mentioned is that you can&amp;nbsp;refer also to the periph_memtest demo in LPCOpen library to adjust the SDRAM initialization code to your needs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2018 14:09:50 GMT</pubDate>
    <dc:creator>victorjimenez</dc:creator>
    <dc:date>2018-08-15T14:09:50Z</dc:date>
    <item>
      <title>SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785739#M31564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a LPC1778 and an external SDRAM (IS42S16800F-7TL) controlled by EMC.&lt;BR /&gt;The memory has an external battery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some trouble to put the SDRAM in self-refresh and to exit it.&lt;BR /&gt;I go in self-refresh when the input voltage is too low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000103;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue PALL command&lt;BR /&gt;for(volatile int i = 0; i &amp;lt; 512; i++);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000183;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue NOP command&lt;BR /&gt;for(volatile int i = 0; i &amp;lt; 512; i++);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicControl |= 1&amp;lt;&amp;lt;2;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//enter self-refresh mode&lt;BR /&gt;while((LPC_EMC-&amp;gt;Status&amp;amp;(1&amp;lt;&amp;lt;2))!=1&amp;lt;&amp;lt;2); &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//wait validation mode self-refresh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the microcontroleur start up, I have about 100 wrong bits in 60Ko of external memory.&lt;BR /&gt;I have this problem with all cards we produced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code when the microcontroleur starts is the same no matter that the external memory is in self-refresh or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//EMC clock&lt;BR /&gt;if(CLKPWR_GetCLK(CLKPWR_CLKTYPE_CPU) &amp;gt; 80000000)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLKPWR_SetCLKDiv(CLKPWR_CLKTYPE_EMC, 1); // CPU clock / 2&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLKPWR_SetCLKDiv(CLKPWR_CLKTYPE_EMC, 0); // Same clock as CPU&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delay_us(1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//EMC pin&lt;BR /&gt;for(i=0;i&amp;lt;16;i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PINSEL_ConfigPin(3,i,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//D0 a D15&lt;BR /&gt;for(i=0;i&amp;lt;=16;i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PINSEL_ConfigPin(4,i,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//A0 a A16&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PINSEL_ConfigPin(4,25,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//WR WE&lt;BR /&gt;PINSEL_ConfigPin(4,24,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//OE&lt;BR /&gt;PINSEL_ConfigPin(4,26,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//BLS0&amp;nbsp;&amp;nbsp; &amp;nbsp;(driver bus)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PINSEL_ConfigPin(2,16,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//p2.16 EMC_CAS&lt;BR /&gt;PINSEL_ConfigPin(2,17,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//p2.17 EMC_RAS&lt;BR /&gt;PINSEL_ConfigPin(2,18,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//p2.18 EMC_CCLK emc_clk0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;PINSEL_ConfigPin(2,22,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//CS2&amp;nbsp;&amp;nbsp; &amp;nbsp;CS_SDRAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PINSEL_ConfigPin(2,26,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//p2.26 EMC_CKE EMC_CKe2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PINSEL_ConfigPin(2,28,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//p2.28 EMC_DQML&lt;BR /&gt;PINSEL_ConfigPin(2,29,1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//p2.29 EMC_DQMH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delay_us(1000);&lt;BR /&gt;//GPIO_OutputValue(2,26,1);&lt;BR /&gt;delay_us(1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_SC-&amp;gt;PCONP&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;|= 0x00000800;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//PCEMC = 1&amp;nbsp; Mise sous tension&lt;BR /&gt;LPC_SC-&amp;gt;EMCDLYCTL&amp;nbsp;&amp;nbsp; = 0x00001010;//0x1000&lt;BR /&gt;/*Set data read delay*/&lt;BR /&gt;LPC_SC-&amp;gt;EMCDLYCTL |=(8&amp;lt;&amp;lt;8);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//FBCLKDLY 4&amp;lt;&amp;lt;8 mini&lt;BR /&gt;LPC_SC-&amp;gt;EMCDLYCTL |= (0x08 &amp;lt;&amp;lt;16);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//LPC_EMC-&amp;gt;Control &amp;nbsp;&amp;nbsp; &amp;nbsp;= 0x00000000;&lt;BR /&gt;LPC_EMC-&amp;gt;Control &amp;nbsp;&amp;nbsp; &amp;nbsp;= 0x00000001;&lt;BR /&gt;LPC_EMC-&amp;gt;Config &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;= 0x00000000;&lt;BR /&gt;LPC_SC-&amp;gt;SCS |= 0x00000001;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Disable Auto-Byte Addressing&lt;BR /&gt;//LPC_SC-&amp;gt;SCS &amp;amp;= 0xFFFFFFFE;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//EMC Shift&amp;nbsp;&amp;nbsp; &amp;nbsp;Control&lt;BR /&gt;LPC_SC-&amp;gt;SCS |= 0x00000004;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Disable burst acces pour CS3&lt;BR /&gt;LPC_SC-&amp;gt;SCS |= 0x00000002;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Disable EMC reset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_EMC-&amp;gt;StaticExtendedWait=0;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Extended wait enabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;//SDRAM external&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicReadConfig=1;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//delay of CCLk with EMCCLKDELAY&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRasCas2=0b1100000011;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//RAS latency:3cclk CAS latency:3cclk&amp;nbsp;&amp;nbsp; &amp;nbsp;//????&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRP=calcul_nb_cclk(22);//20ns mini&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRAS=calcul_nb_cclk(46);//44ns mini 100us maxi&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicSREX=calcul_nb_cclk(70);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//63+1.5ns mini&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicAPR=calcul_nb_cclk(21);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//??? no specification in datasheet&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicWR=MAX(calcul_nb_cclk(6)+2, calcul_nb_cclk(12));//2tck&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicDAL=calcul_nb_cclk(50);//tWR plus tRP&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRC=calcul_nb_cclk(66);//66ns mini&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRFC=calcul_nb_cclk(66);//66ns mini&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicXSR=calcul_nb_cclk(76);//75ns mini&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRRD=calcul_nb_cclk(16);//15ns mini&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicMRD=3;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//2clk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_EMC-&amp;gt;DynamicConfig2=0x00000680;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//mode row bank column 256Mbits 16M*16bits col=9 row=13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// HERE I TRIED TO WRITE A DIFFERENT CODE BASED ON&lt;BR /&gt;// if ((LPC_EMC-&amp;gt;Status&amp;amp;(1&amp;lt;&amp;lt;2))==0)&lt;BR /&gt;// BUT I DON'T KNOW WHAT TO WRITE.&lt;/P&gt;&lt;P&gt;// I know that I should write something like :&lt;/P&gt;&lt;P&gt;// delay_us(100);&lt;BR /&gt;// LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000183;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue NOP command&lt;/P&gt;&lt;P&gt;// delay_us(100);&lt;/P&gt;&lt;P&gt;// LPC_EMC-&amp;gt;DynamicControl &amp;amp;= ~(1&amp;lt;&amp;lt;2);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//exit self-refresh mode&lt;BR /&gt;// while((LPC_EMC-&amp;gt;Status&amp;amp;(1&amp;lt;&amp;lt;2))!=0); &amp;nbsp;&amp;nbsp; &amp;nbsp;// wait exit mode self-refresh&lt;/P&gt;&lt;P&gt;// But this do not works.&lt;/P&gt;&lt;P&gt;// I try to replace the following code by these 4 lines but without success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delay_us(100);&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000183;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue NOP command&lt;BR /&gt;delay_us(100);&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000183;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue NOP command&lt;BR /&gt;delay_us(100);&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000103;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue PALL command&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRefresh&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000002; &amp;nbsp;&amp;nbsp; &amp;nbsp;// ( n * 16 ) -&amp;gt; 32 clock cycles&lt;BR /&gt;for(i= 128; i; --i);&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicRefresh=((EMCClock*(64000/4096)/16)/1000000);&amp;nbsp;&amp;nbsp; &amp;nbsp;//15.625us de refresh CCLk EMCClock&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000083; &amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue MODE command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Lit la donnée volatile et le (void) dit qu'on s'en fout du retour.&lt;BR /&gt;(void) *((volatile uint32_t *)(0xC0000000 | (0x33&amp;lt;&amp;lt;12))); // 8 burst(128bit), 3 CAS latency&amp;nbsp; //bankbit:2 columnbit:9 16bits:1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000000; /* Issue NORMAL command */&lt;BR /&gt;LPC_EMC-&amp;gt;DynamicConfig2&amp;nbsp;&amp;nbsp;&amp;nbsp; |= 0x00080000; // Buffer enable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help will be appreciated.&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:02:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785739#M31564</guid>
      <dc:creator>vincentlegarrec</dc:creator>
      <dc:date>2018-08-14T12:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785740#M31565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;Vincent LE GARREC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LPC1778 and the LPC1788 are from the same family, so you can use the examples provided in the LPCOpen for the LPC1788 as a guide for your project.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can download the LPCOpen from the following page:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/support/developer-resources/software-development-tools/lpc-developer-resources-/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc17xx:LPCOPEN-SOFTWARE-FOR-LPC17XX" title="https://www.nxp.com/support/developer-resources/software-development-tools/lpc-developer-resources-/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc17xx:LPCOPEN-SOFTWARE-FOR-LPC17XX"&gt;LPCOpen Software for LPC17XX|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will find two examples that you can use:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;nandflash_prog&lt;/LI&gt;&lt;LI&gt;norflash_prog&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Both examples use the EMC interface.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 22:29:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785740#M31565</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-08-14T22:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785741#M31566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vincent is asking about _SDRAM_ and _SELF REFRESH_&lt;/P&gt;&lt;P&gt;How does the two samples you direct him to, have anything to do with this ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 11:24:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785741#M31566</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2018-08-15T11:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785742#M31567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both examples mentioned before use the EMC interface, is a good starting point to understand how the External Memory Controller works. What I forgot to mentioned is that you can&amp;nbsp;refer also to the periph_memtest demo in LPCOpen library to adjust the SDRAM initialization code to your needs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 14:09:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785742#M31567</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-08-15T14:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785743#M31568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the link for lpcopen v2.10. I'm using an old one (v2.00). The code is very different so I will compare with mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be more precise, my question is : on microcontroller' startup, my SDRAM is on self-refresh. How do you initialize the EMC and wake up the SDRAM? Do I have to follow the classic procedure then just add LPC_EMC-&amp;gt;CONTROL &amp;amp;= ~(1 &amp;lt;&amp;lt; 2); ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And why do I am loosing some random bits ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 07:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785743#M31568</guid>
      <dc:creator>vincentlegarrec</dc:creator>
      <dc:date>2018-08-16T07:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785744#M31569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made some tests. I have something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can go on self-refresh with the following command :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000103;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue PALL command,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;delay_us(15);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LPC_EMC-&amp;gt;DynamicControl&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000183;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue NOP command,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;delay_us(200);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LPC_EMC-&amp;gt;DynamicControl |= 1&amp;lt;&amp;lt;2;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //enter self-refresh mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;while((LPC_EMC-&amp;gt;Status&amp;amp;(1&amp;lt;&amp;lt;2))!=1&amp;lt;&amp;lt;2); //wait validation of self-refresh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point, I can't read anymore my external RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I wait a while (1s)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I try to exit self-refresh with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_EMC-&amp;gt;DynamicControl |= 0x3 &amp;lt;&amp;lt; 7;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Issue NOP command,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;delay_us(200);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LPC_EMC-&amp;gt;DynamicControl &amp;amp;= ~(1&amp;lt;&amp;lt;2);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //exit self-refresh mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;while((LPC_EMC-&amp;gt;Status&amp;amp;(1&amp;lt;&amp;lt;2))!=0); //attente validation du mode self-refresh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my LPC1778 crashes (I lose debug)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an idea what's wrong on my "exit self-refresh" function ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:38:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785744#M31569</guid>
      <dc:creator>vincentlegarrec</dc:creator>
      <dc:date>2018-08-16T15:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785745#M31570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vincent LE GARREC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you executing the code from the external RAM?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 15:33:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785745#M31570</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-08-20T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785746#M31571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, the code is inside the microcontroller. Actually, I'm wondering if there is not nothing wrong with the schematic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made another test. I enter successfully (I think) in self-refresh with the code I posted two posts above. And I also successfully exit self-refresh (no lost of data) by running the same code I use to init the RAM (see my first post) WITHOUT shutting down the power.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there's something wrong with power off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use a bigger battery (3.6V) without success. I also tried to replace the external RAM (IS42S16800F-7TL) with another same RAM (MT48LC8M16A2P-6A:L) from another constructor and I have the same problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 07:38:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785746#M31571</guid>
      <dc:creator>vincentlegarrec</dc:creator>
      <dc:date>2018-08-21T07:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785747#M31572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;Vincent LE GARREC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your doubt that you are not sure you are actually entering the self-refresh mode. I was checking the example&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;periph_memtest&lt;SPAN&gt;&amp;nbsp; of the LPCOpen. And when you reset the EMC module you go into self-refresh mode, I was able to see this change directly in the registers.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/67166i5AD41ABC56C67B3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.jpg" alt="pastedImage_2.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;And after, in&amp;nbsp; the function&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;initDynMem once you make all the configurations of the memory you change to normal mode by just writing to the DynamicControl register. At this point I'm able to see also in the register that I enter successfully to normal mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/67659i1BBFE761F2D1934F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.jpg" alt="pastedImage_4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Are you able to see these changes in your registers? This way you can be sure that you enter/exit correctly the self-refresh mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mentioned that there is something wrong with the power off.&amp;nbsp;&lt;SPAN style="font-size: 11.5pt; font-family: 'Helvetica',sans-serif; color: #3d3d3d;"&gt;A good idea to&amp;nbsp;see if the problem is due to you are powering off the LPC would be to send the memory to self-refresh mode, then send the LPC to a low power mode (where you keep the state of the pins) and when you wake up&amp;nbsp;the LPC&amp;nbsp;you can check the state of the memory. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Helvetica',sans-serif; color: #3d3d3d;"&gt;Sending the LPC to a low power mode instead of powering off the entire LPC will help to maintain the state of the EMC lines. When you power off the LPC you lose immediately the state of the EMC lines but since the memory is still active you might be changing the configuration of the memory.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2018 23:34:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785747#M31572</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-08-22T23:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785748#M31573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your long explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I'm able to change the "SR" register from 0 to 1 and 1 to 0. The only difference I have with you is the CE register is always HIGH.&lt;/P&gt;&lt;P&gt;I tried to put this register on POWERSAVE just after writing the SR register to ENTER-SELF-REFRESH and write SR register to NORMAL_MODE at wake up but it's worse. I have much more bits corrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fact is I put the SDRAM in self refresh in case of low power. I need the memory even without main power (but with external battery). Thanks for pointing me about the state of the EMC lines. I checked the schematic. I have a door that force the CKE pin to down few time after the low power is detected. So I this time, the SDRAM is already in self-refresh when this door is activate and the LPC is not down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will check if the door is working as excepted. I also will try to sleep and to wake up the LPC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, I will come back in few days after the tries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:34:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785748#M31573</guid>
      <dc:creator>vincentlegarrec</dc:creator>
      <dc:date>2018-08-24T14:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785749#M31574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After few weeks, I think I solved the problem. At least, it looks better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It first, I found a "impossible" case in my code that leave self-refresh during the "alim low" interrupt. I removed that code. I can't tell if that was the problem but it looks to work better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing is I still lose some random bit every time I program the LPC1778. I think it's because the JTAG freeze the CKE pin during programming while the SDRAM is not in self-refresh. Can someone confirm ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now, the problem is over.&lt;/P&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2018 10:01:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785749#M31574</guid>
      <dc:creator>vincentlegarrec</dc:creator>
      <dc:date>2018-09-12T10:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM self refresh</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785750#M31575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vincent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the JTAG freezes the CKE pin and you are not in self-refresh mode&amp;nbsp;then the SDRAM doesn't have any clock signal so it make sense that you lose some random bit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Victor.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2018 16:50:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-self-refresh/m-p/785750#M31575</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-09-17T16:50:04Z</dc:date>
    </item>
  </channel>
</rss>

