<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Define struct on external EEPROM</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14987/define-struct-on-external-eeprom</link><description> Hello all, 
I&amp;#39;m facing a little understanding problem. 
At my design I use the AT89C51RD2 micro and also two external memory devices – SRAM and parallel EEPROM. 
At my code I have several structs that I want them to be at the external EEPROM. What I</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Define struct on external EEPROM</title><link>https://community.arm.com/thread/54561?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2002 06:45:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6012d8d9-3db0-43c6-9afc-6ee598e38af1</guid><dc:creator>Ruven H</dc:creator><description>&lt;p&gt;Thanks a lot Jon for your help.&lt;br /&gt;
As I know your advice is OK in case where the size of struct members is byte, but what if one of them is array or string.&lt;br /&gt;
Lets say the first struct member of bob is &amp;quot;char str[7];&amp;quot; and I want the struct to be initialized with &amp;quot;XYZ123&amp;quot;. I can&amp;#39;t use the strcpy function because external EEPROM needs NOPs between each byte write. So I need to declare the string in RAM and then copy it with special function to external EEPROM. The problem is that now I have this string in RAM and also in EEPROM.&lt;br /&gt;
In this way RAM area is corrupt with unuseful data.&lt;br /&gt;
Can you help in this case?&lt;br /&gt;
&lt;br /&gt;
Thanks a lot,&lt;br /&gt;
Roberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Define struct on external EEPROM</title><link>https://community.arm.com/thread/39001?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2002 11:11:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:26618a2b-1168-47a3-b092-9f9da9c8c407</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;There are a few things that I&amp;#39;m assuming here:&lt;br /&gt;
&lt;br /&gt;
1. Your EEPROM is located at 0x8000 in XDATA space.&lt;br /&gt;
&lt;br /&gt;
2. You have a struct (in EEPROM) that you want to read from and write to.&lt;br /&gt;
&lt;br /&gt;
If that&amp;#39;s the case, you can just declare the struct as:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;volatile xdata struct bob _at_ 0x8000;&lt;/pre&gt;
&lt;br /&gt;
And, the first structure member of bob will be at address 0x8000 in XDATA.&lt;br /&gt;
&lt;br /&gt;
Of course, you&amp;#39;ll probably need some special way to write to bob since EEPROM writes are &amp;quot;typically&amp;quot; slower than writes to SRAM and wait states must be inserted manually.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>