<?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 external memory access</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1474235#M49172</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;PLEASE SEE THE ATTACHED WORD DOCUMENT FOR DETAILED DESCRIPTION OF THE PROBLEM.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;We are trying to read/write data in to the NVSRAM.For this we have configured the EMC registers as follows: In this we want to configure the EMC Static chip selects to use for the Chip select of NVSRAM. Also as mentioned in the schematic, we intend to configure the EMC for other control signals like OE, BLS0, BLS1,BLS2, WE for the NVSRAM access. In order to generate chip select for the NVSRAM we have used the corresponding memory address range as mentioned in the LPC1788 manual . ( EMC_CS3 , P2.15) The WE signal coming out of the EMC from LPC is used to control the direction of the data buffer for Read/Write Control. The problem is when we are trying to write data and read back from the same memory location of the NVSRAM , then the Chip select is properly generated and WE signal also shows pulsed variations in levels for write and read operations( WE is Low when writing and High when Reading).But when we initiate ONLY READ Operation for reading data from the NVSRAM, the chip selects also is not generated also there is no WE signal too. We are unable to read back the data. Similarly in case of our external ADC we have assigned EMC Static chip selects (EMC_CS0,P4.30)of the EMC to the ADC. Now as there is only read operation involved in the ADC data reading , again we are not getting any chip selects for the same.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 07:44:03 GMT</pubDate>
    <dc:creator>rameshjayaraman</dc:creator>
    <dc:date>2022-06-15T07:44:03Z</dc:date>
    <item>
      <title>LPC1788 external memory access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1474235#M49172</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;PLEASE SEE THE ATTACHED WORD DOCUMENT FOR DETAILED DESCRIPTION OF THE PROBLEM.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;We are trying to read/write data in to the NVSRAM.For this we have configured the EMC registers as follows: In this we want to configure the EMC Static chip selects to use for the Chip select of NVSRAM. Also as mentioned in the schematic, we intend to configure the EMC for other control signals like OE, BLS0, BLS1,BLS2, WE for the NVSRAM access. In order to generate chip select for the NVSRAM we have used the corresponding memory address range as mentioned in the LPC1788 manual . ( EMC_CS3 , P2.15) The WE signal coming out of the EMC from LPC is used to control the direction of the data buffer for Read/Write Control. The problem is when we are trying to write data and read back from the same memory location of the NVSRAM , then the Chip select is properly generated and WE signal also shows pulsed variations in levels for write and read operations( WE is Low when writing and High when Reading).But when we initiate ONLY READ Operation for reading data from the NVSRAM, the chip selects also is not generated also there is no WE signal too. We are unable to read back the data. Similarly in case of our external ADC we have assigned EMC Static chip selects (EMC_CS0,P4.30)of the EMC to the ADC. Now as there is only read operation involved in the ADC data reading , again we are not getting any chip selects for the same.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 07:44:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1474235#M49172</guid>
      <dc:creator>rameshjayaraman</dc:creator>
      <dc:date>2022-06-15T07:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 external memory access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1475795#M49221</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have checked your schematics and the code.&lt;/P&gt;
&lt;P&gt;Because you use 16 bits data width SRAM, you should have connected the EMC_A1 to SRAM_A0, EMC_A2 to SRAM_A1,... But you connect the EMC_A0 to SRAM_A0, EMC_A1 to SRAM_A1,....&lt;/P&gt;
&lt;P&gt;In you connection that EMC_A0 to SRAM_A0, EMC_A1 to SRAM_A1,...are connected, you have to set the EMCSC bit in SCS register&lt;/P&gt;
&lt;P&gt;LPC_SC-&amp;gt;SCS=0x00000025; // The EMCES bit must be set&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1655450705912.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/183708iFAACAF4D409115E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1655450705912.png" alt="xiangjun_rong_0-1655450705912.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have checked the timing configuration, I think it is okay&lt;/P&gt;
&lt;P&gt;LPC_EMC-&amp;gt;StaticConfig3 = 0x00080001; //working&lt;BR /&gt;//LPC_EMC-&amp;gt;StaticConfig3 = 0x00080101; // Bit 1:0: 01 for 16 bit, bit 6=0 Chip Slect Low &lt;BR /&gt;// Bit 8=0 Extended wait disabled, bit 19 Buffer disable, Bit 20=0 Write Not protected &lt;BR /&gt;LPC_EMC-&amp;gt;StaticWaitWen3 = 0x0000000F; // Bit Static Memory write enable delay&lt;BR /&gt;LPC_EMC-&amp;gt;StaticWaitOen3 = 0x0000000F; // Bit Static Memory write enable delay &lt;BR /&gt;LPC_EMC-&amp;gt;StaticWaitRd3 = 0x0000001F; // Bit Static Memory write enable delay&lt;BR /&gt;LPC_EMC-&amp;gt;StaticWaitPage3 = 0x00000000; // Bit Static Memory write enable delay &lt;BR /&gt;LPC_EMC-&amp;gt;StaticWaitWr3 = 0x0000001F; // Bit Static Memory write enable delay&lt;BR /&gt;LPC_EMC-&amp;gt;StaticWaitTurn3 = 0x0000000F; // Bit Static Memory write enable delay &lt;/P&gt;
&lt;P&gt;When you access the external memory, I suggest you use a loop so that you can see if the timing is correct&lt;/P&gt;
&lt;P&gt;uint16_t temp;&lt;/P&gt;
&lt;P&gt;for(;;)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;*(uint16_t *)NVsram_locationfor2=0xaaaa; //using 16 bits access&lt;/P&gt;
&lt;P&gt;__asm("nop");&lt;/P&gt;
&lt;P&gt;temp=*(uint16_t *)NVsram_locationfor2;&lt;/P&gt;
&lt;P&gt;__asm("nop");&lt;/P&gt;
&lt;P&gt;}&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;</description>
      <pubDate>Fri, 17 Jun 2022 07:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1475795#M49221</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-06-17T07:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 external memory access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1475939#M49228</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please have a look at the EMC registers and review them for&amp;nbsp; corrections, if any&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_EMC-&amp;gt;pconp=0x00000800&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_EMC-&amp;gt;control=0x00000005 ( This is the value given before the EMC registers are configured ( for low power mode), at the end of initialization of all the registers, the value is set to 0x00000001, for normal power mode)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_EMC-&amp;gt;config=0x00000000&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_EMC-&amp;gt;SCS=0x00000025 ( as suggested by you)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_EMC-&amp;gt;StaticConfig3 = 0x00080081( also for&amp;nbsp;StaticConfig0,StaticConfig1,StaticConfig2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_EMC-&amp;gt;EMCCLKSEL=0x00000001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LPC_&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 10:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1475939#M49228</guid>
      <dc:creator>rameshjayaraman</dc:creator>
      <dc:date>2022-06-17T10:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 external memory access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1476412#M49236</link>
      <description>Hi,
I think you can use the code and have a try
LPC_SC-&amp;gt;PCONP    |= 0x00000800;  						// set PCEMC bit 11 for EMC ENABLE
  LPC_SC-&amp;gt;EMCDLYCTL = 0x00000001; 					 	// EMC Delay conrol register
  LPC_EMC-&amp;gt;Control 	= 0x00000001;  						// EMC Control ....enable EMc by set Bit 0
  LPC_EMC-&amp;gt;Config  	= 0x00000000;	
LPC_EMC-&amp;gt;SCS=0x00000025 ( as suggested by you)
LPC_EMC-&amp;gt;StaticConfig3 = 0x00000081( also for StaticConfig0,StaticConfig1,StaticConfig2)

Hope it can help you
BR
XiangJun Rong</description>
      <pubDate>Mon, 20 Jun 2022 02:57:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-external-memory-access/m-p/1476412#M49236</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-06-20T02:57:18Z</dc:date>
    </item>
  </channel>
</rss>

