<?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>difference between data and program memory</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38045/difference-between-data-and-program-memory</link><description> 
what is the difference between data and program memory? 
help me please.. 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/89322?ContentTypeID=1</link><pubDate>Mon, 20 Oct 2008 13:11:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:90f3a9c8-a106-4b16-ba73-bb5e462f675e</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
Correctly spelled as:&lt;br /&gt;
Harvard architecture&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/52657?ContentTypeID=1</link><pubDate>Mon, 20 Oct 2008 05:28:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1e559845-2bf7-40ff-8289-aed06a7a0243</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
Harward architecture&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/124983?ContentTypeID=1</link><pubDate>Fri, 17 Oct 2008 13:58:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:73068728-f2c4-458e-a11e-9de50610bb48</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Unused trunk space or knee space is left unused in a car also.&lt;/p&gt;

&lt;p&gt;
You often have to design for worst-case requirements and end up
with mostly unused extra capacity.&lt;/p&gt;

&lt;p&gt;
If you do use IAP methods to store information in the program
space (for the chpis that supports this), you should make use of
checksums to give the program the ability to decide if a valid
configuration has been stored, or if it should run with default
values.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/114333?ContentTypeID=1</link><pubDate>Fri, 17 Oct 2008 13:50:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a3b75ac6-42f3-4d12-82aa-4902bc5141fb</guid><dc:creator>AJ Boston</dc:creator><description>&lt;p&gt;&lt;p&gt;
Right. Allowing users to write into the program memory blocks
would invariably lead to problems, if the user is using a variable
that could become corrupt. On the other hand unused program memory
would continue to be unused&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/101201?ContentTypeID=1</link><pubDate>Fri, 17 Oct 2008 12:35:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d738c478-b1a9-4f6f-8a73-a47f2a376cac</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
If you do not store and access constants in the program memory,
then you need the startup code to copy the constants from the program
memory into the RAM on program startup. But requiring two copies of
the variable is obviously a waste of space.&lt;/p&gt;

&lt;p&gt;
The program memory is non-volatile and keeps its contents after
power-off. But newer memory architectures, such as the flash memory
in just about every new processor, can be erased and reprogrammed in
the system (ISP = in-system-programming) and even by the running
application (IAP = In Application Programming).&lt;/p&gt;

&lt;p&gt;
This allows field upgrades of the processor. But it may also be
used to store configuration data in the program memory.&lt;/p&gt;

&lt;p&gt;
But since it is intended for program memory and for field upgrades
of the application, you can normally not write individual bytes. And
each write normally takes quite long time and may require a full
block to be erased. Because of this, it will not work for normal
variables. You can&amp;#39;t just do a memory write like you can with the RAM
memory.&lt;/p&gt;

&lt;p&gt;
A number of processors - such as the 8051 - separates program and
data memory. This is called a Harward architecture. The processor has
one set of instructions to access data memory and another set of
instructions to access program memory. This allows the compiler to
select suitable instructions when accessing a constant stored in the
program memory. But there will not exist any instructions for writing
into the program memory.&lt;/p&gt;

&lt;p&gt;
The solution to the above problem - how to write into the program
memory for processors with separated program and data address spaces
- is normally to allow special function registers indirectly access
and write new data, or to create a double-mapped memory area where
you can access a mapped memory block using either data operations or
program operations.&lt;/p&gt;

&lt;p&gt;
Most newer processors unifies the address space for program and
data, allowing the same processor instructions to access data or
program memory. This is called a von Neumann architecture. It is just
the address of the memory access that specifies if the access is
within the range of a data memory or a program memory.&lt;/p&gt;

&lt;p&gt;
But in the end - yes, program memory is off limits. But only for
&amp;quot;normal&amp;quot; write instructions. The compiler can produce code to pick up
constants from the program memory. And some processors have invented
methods to allow blocks of the program memory to be erased and
rewritten with new information.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/76787?ContentTypeID=1</link><pubDate>Fri, 17 Oct 2008 12:00:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f53d22ae-1085-44ec-a3cc-650b7fcff6ea</guid><dc:creator>AJ Boston</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&lt;br /&gt;
Some chips allows parts of the program memory to be modified in
blocks (segments), but you can&amp;#39;t store variables in the program
memory.&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
To be honest I am a bit surprised. I thought that program memory was
off limits to the user for anything, constants or variables in
general.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: difference between data and program memory</title><link>https://community.arm.com/thread/52658?ContentTypeID=1</link><pubDate>Fri, 17 Oct 2008 07:22:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c9ed5faa-2ebf-4b9d-bae3-82c2c969e6cc</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Data memory = where you place your variables. You can read and
write values.&lt;/p&gt;

&lt;p&gt;
Program memory = where the application is stored. Some chips
allows parts of the program memory to be modified in blocks
(segments), but you can&amp;#39;t store variables in the program memory. It
is normally possible to store constants - i.e. initialized variables
that you do not change - in the program memory.&lt;/p&gt;

&lt;p&gt;
Your PC also has data memory and program memory. But the program
memory is very small in the PC - it is just for storage of the BIOS -
the boot messages you see when the PC boots, and (often, but not
always) the configiguration pages where you define if you have a
floppy installed, if the computer should support a USB keyboard
etc.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>