<?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: Internal EEPROM access</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Internal-EEPROM-access/m-p/1187151#M42981</link>
    <description>&lt;P&gt;Hi, Stephen,&lt;/P&gt;
&lt;P&gt;Pls download the LPC open package from the link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX" target="_blank"&gt;https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is eeprom example code in the directory:&lt;/P&gt;
&lt;P&gt;C:\DriveE\LPCOpenDirectory\Keil_IAR\LPC4337\LPC43xx_18xx\examples_43xx_18xx\periph_eeprom\src&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just copy part of the code from eeprom.c&lt;/P&gt;
&lt;P&gt;/* Read data from EEPROM */&lt;BR /&gt;/* size must be multiple of 4 bytes */&lt;BR /&gt;STATIC void EEPROM_Read(uint32_t pageOffset, uint32_t pageAddr, uint32_t* ptr, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;uint32_t i = 0;&lt;BR /&gt;uint32_t *pEepromMem = (uint32_t*)EEPROM_ADDRESS(pageAddr,pageOffset);&lt;BR /&gt;for(i = 0; i &amp;lt; size/4; i++) {&lt;BR /&gt;ptr[i] = pEepromMem[i];&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Erase a page in EEPROM */&lt;BR /&gt;STATIC void EEPROM_Erase(uint32_t pageAddr)&lt;BR /&gt;{&lt;BR /&gt;uint32_t i = 0;&lt;BR /&gt;uint32_t *pEepromMem = (uint32_t*)EEPROM_ADDRESS(pageAddr,0);&lt;BR /&gt;for(i = 0; i &amp;lt; EEPROM_PAGE_SIZE/4; i++) {&lt;BR /&gt;pEepromMem[i] = 0;&lt;BR /&gt;#if AUTOPROG_ON&lt;BR /&gt;Chip_EEPROM_WaitForIntStatus(LPC_EEPROM, EEPROM_INT_ENDOFPROG);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;BR /&gt;#if (AUTOPROG_ON == 0)&lt;BR /&gt;Chip_EEPROM_EraseProgramPage(LPC_EEPROM);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Write data to a page in EEPROM */&lt;BR /&gt;/* size must be multiple of 4 bytes */&lt;BR /&gt;STATIC void EEPROM_Write(uint32_t pageOffset, uint32_t pageAddr, uint32_t* ptr, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;uint32_t i = 0;&lt;BR /&gt;uint32_t *pEepromMem = (uint32_t*)EEPROM_ADDRESS(pageAddr,pageOffset);&lt;/P&gt;
&lt;P&gt;if(size &amp;gt; EEPROM_PAGE_SIZE - pageOffset)&lt;BR /&gt;size = EEPROM_PAGE_SIZE - pageOffset;&lt;/P&gt;
&lt;P&gt;for(i = 0; i &amp;lt; size/4; i++) {&lt;BR /&gt;pEepromMem[i] = ptr[i];&lt;BR /&gt;#if AUTOPROG_ON&lt;BR /&gt;Chip_EEPROM_WaitForIntStatus(LPC_EEPROM, EEPROM_INT_ENDOFPROG);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;#if (AUTOPROG_ON == 0)&lt;BR /&gt;Chip_EEPROM_EraseProgramPage(LPC_EEPROM);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;for lpc43xx, there are 16KB EEPROM, which consists of 128 pages, each pages includes 128 bytes(32 words)&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>Mon, 23 Nov 2020 05:21:06 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2020-11-23T05:21:06Z</dc:date>
    <item>
      <title>Internal EEPROM access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Internal-EEPROM-access/m-p/1186920#M42972</link>
      <description>&lt;P&gt;I'm looking for code examples for internal EEPROM access for the LPC4337 and there is next to nothing out there.&lt;/P&gt;&lt;P&gt;Appreciate any feedback however trivial.&lt;/P&gt;&lt;P&gt;It's a great micro, but support seems limited.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 02:15:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Internal-EEPROM-access/m-p/1186920#M42972</guid>
      <dc:creator>mail_stephen201</dc:creator>
      <dc:date>2020-11-21T02:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Internal EEPROM access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Internal-EEPROM-access/m-p/1187151#M42981</link>
      <description>&lt;P&gt;Hi, Stephen,&lt;/P&gt;
&lt;P&gt;Pls download the LPC open package from the link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX" target="_blank"&gt;https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is eeprom example code in the directory:&lt;/P&gt;
&lt;P&gt;C:\DriveE\LPCOpenDirectory\Keil_IAR\LPC4337\LPC43xx_18xx\examples_43xx_18xx\periph_eeprom\src&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just copy part of the code from eeprom.c&lt;/P&gt;
&lt;P&gt;/* Read data from EEPROM */&lt;BR /&gt;/* size must be multiple of 4 bytes */&lt;BR /&gt;STATIC void EEPROM_Read(uint32_t pageOffset, uint32_t pageAddr, uint32_t* ptr, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;uint32_t i = 0;&lt;BR /&gt;uint32_t *pEepromMem = (uint32_t*)EEPROM_ADDRESS(pageAddr,pageOffset);&lt;BR /&gt;for(i = 0; i &amp;lt; size/4; i++) {&lt;BR /&gt;ptr[i] = pEepromMem[i];&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Erase a page in EEPROM */&lt;BR /&gt;STATIC void EEPROM_Erase(uint32_t pageAddr)&lt;BR /&gt;{&lt;BR /&gt;uint32_t i = 0;&lt;BR /&gt;uint32_t *pEepromMem = (uint32_t*)EEPROM_ADDRESS(pageAddr,0);&lt;BR /&gt;for(i = 0; i &amp;lt; EEPROM_PAGE_SIZE/4; i++) {&lt;BR /&gt;pEepromMem[i] = 0;&lt;BR /&gt;#if AUTOPROG_ON&lt;BR /&gt;Chip_EEPROM_WaitForIntStatus(LPC_EEPROM, EEPROM_INT_ENDOFPROG);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;BR /&gt;#if (AUTOPROG_ON == 0)&lt;BR /&gt;Chip_EEPROM_EraseProgramPage(LPC_EEPROM);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Write data to a page in EEPROM */&lt;BR /&gt;/* size must be multiple of 4 bytes */&lt;BR /&gt;STATIC void EEPROM_Write(uint32_t pageOffset, uint32_t pageAddr, uint32_t* ptr, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;uint32_t i = 0;&lt;BR /&gt;uint32_t *pEepromMem = (uint32_t*)EEPROM_ADDRESS(pageAddr,pageOffset);&lt;/P&gt;
&lt;P&gt;if(size &amp;gt; EEPROM_PAGE_SIZE - pageOffset)&lt;BR /&gt;size = EEPROM_PAGE_SIZE - pageOffset;&lt;/P&gt;
&lt;P&gt;for(i = 0; i &amp;lt; size/4; i++) {&lt;BR /&gt;pEepromMem[i] = ptr[i];&lt;BR /&gt;#if AUTOPROG_ON&lt;BR /&gt;Chip_EEPROM_WaitForIntStatus(LPC_EEPROM, EEPROM_INT_ENDOFPROG);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;#if (AUTOPROG_ON == 0)&lt;BR /&gt;Chip_EEPROM_EraseProgramPage(LPC_EEPROM);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;for lpc43xx, there are 16KB EEPROM, which consists of 128 pages, each pages includes 128 bytes(32 words)&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>Mon, 23 Nov 2020 05:21:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Internal-EEPROM-access/m-p/1187151#M42981</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-11-23T05:21:06Z</dc:date>
    </item>
  </channel>
</rss>

